On Wednesday 29 July 2009, you wrote:
> http://bugzilla.kernel.org/show_bug.cgi?id=13865
>
> Summary: Can only resume with HP_WMI selected on compaq nc6000
> when 4c395bdd3f2ca8f7e8efad881e16071182c3b8ca is
> reverted
> Product: Power Management
> Version: 2.5
> Kernel Version: 2.6.30
> Platform: All
> OS/Version: Linux
> Tree: Mainline
> Status: NEW
> Severity: normal
> Priority: P1
> Component: Hibernation/Suspend
> AssignedTo: [email protected]
> ReportedBy: [email protected]
> Regression: No
>
>
> 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
Frans, that's something for you to take care of.
Best,
Rafael
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 <[email protected]>
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 <[email protected]>
Signed-off-by: Frans Pop <[email protected]>
Cc: Matthew Garrett <[email protected]>
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;
}
On Thu, Jul 30, 2009 at 12:42:05PM +0200, Frans Pop wrote:
> From: Frans Pop <[email protected]>
> 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 <[email protected]>
> Signed-off-by: Frans Pop <[email protected]>
> Cc: Matthew Garrett <[email protected]>
Acked-by: Matthew Garrett <[email protected]>
--
Matthew Garrett | [email protected]
> > Reported-and-tested-by: C?dric Godin <[email protected]>
> > Signed-off-by: Frans Pop <[email protected]>
> > Cc: Matthew Garrett <[email protected]>
> Acked-by: Matthew Garrett <[email protected]>
Applied -- and i'll put it on my queue for 2.6.30.stable.
thanks,
Len Brown, Intel Open Source Technology Center