From patchwork Thu Jul 30 10:42:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frans Pop X-Patchwork-Id: 38288 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6UAgC3I018798 for ; Thu, 30 Jul 2009 10:42:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752787AbZG3KmK (ORCPT ); Thu, 30 Jul 2009 06:42:10 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752708AbZG3KmK (ORCPT ); Thu, 30 Jul 2009 06:42:10 -0400 Received: from cpsmtpm-eml110.kpnxchange.com ([195.121.3.14]:51295 "EHLO CPSMTPM-EML110.kpnxchange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752602AbZG3KmJ convert rfc822-to-8bit (ORCPT ); Thu, 30 Jul 2009 06:42:09 -0400 Received: from aragorn.fjphome.nl ([84.85.147.182]) by CPSMTPM-EML110.kpnxchange.com with Microsoft SMTPSVC(7.0.6001.18000); Thu, 30 Jul 2009 12:42:08 +0200 From: Frans Pop To: "Rafael J. Wysocki" Subject: Re: [Bug 13865] [PATCH] hp-wmi: check that an input device exists in resume handler Date: Thu, 30 Jul 2009 12:42:05 +0200 User-Agent: KMail/1.9.9 Cc: bugzilla-daemon@bugzilla.kernel.org, Len Brown , ACPI Devel Maling List , pm list , LKML , =?utf-8?q?C=C3=A9dric_Godin?= References: <200907292257.41573.rjw@sisk.pl> In-Reply-To: <200907292257.41573.rjw@sisk.pl> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200907301242.07973.elendil@planet.nl> X-OriginalArrivalTime: 30 Jul 2009 10:42:08.0696 (UTC) FILETIME=[634B3380:01CA1102] Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Wednesday 29 July 2009, Rafael J. Wysocki wrote: > On Wednesday 29 July 2009, you wrote: > > http://bugzilla.kernel.org/show_bug.cgi?id=13865 > > > > Just for testing I enabled HP_WMI. But from then, I could not resume > > anymore. I just reverted the last git commit on the > > 'drivers/platform/x86/hp-wmi.c' code > > (4c395bdd3f2ca8f7e8efad881e16071182c3b8ca) and now I can resume. The > > problem still persists on .31-rc serie Here's the final patch, tested by Cédric. (And properly against mainline.) From: Frans Pop Subject: hp-wmi: check that an input device exists in resume handler Some systems may not support input events, or registering the input handler may have failed. So check that an input device exists before trying to set the docking and tablet mode state during resume. Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=13865 Reported-and-tested-by: Cédric Godin Signed-off-by: Frans Pop Cc: Matthew Garrett Acked-by: Matthew Garrett --- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index ca50856..a2ad53e 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -520,11 +520,13 @@ static int hp_wmi_resume_handler(struct platform_device *device) * the input layer will only actually pass it on if the state * changed. */ - - input_report_switch(hp_wmi_input_dev, SW_DOCK, hp_wmi_dock_state()); - input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE, - hp_wmi_tablet_state()); - input_sync(hp_wmi_input_dev); + if (hp_wmi_input_dev) { + input_report_switch(hp_wmi_input_dev, SW_DOCK, + hp_wmi_dock_state()); + input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE, + hp_wmi_tablet_state()); + input_sync(hp_wmi_input_dev); + } return 0; }