linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [Bug 13865] New: Can only resume with HP_WMI selected on compaq nc6000 when 4c395bdd3f2ca8f7e8efad881e16071182c3b8ca is reverted
       [not found] <bug-13865-10028@http.bugzilla.kernel.org/>
@ 2009-07-29 20:57 ` Rafael J. Wysocki
  2009-07-29 21:31   ` [Bug 13865] " Frans Pop
  2009-07-30 10:42   ` [Bug 13865] [PATCH] hp-wmi: check that an input device exists in resume handler Frans Pop
  0 siblings, 2 replies; 8+ messages in thread
From: Rafael J. Wysocki @ 2009-07-29 20:57 UTC (permalink / raw)
  To: Frans Pop
  Cc: bugzilla-daemon, Len Brown, ACPI Devel Maling List, pm list, LKML

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: power-management_other@kernel-bugs.osdl.org
>         ReportedBy: cedric@belbone.be
>         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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug 13865] Can only resume with HP_WMI selected on compaq nc6000 when 4c395bdd3f2ca8f7e8efad881e16071182c3b8ca is reverted
  2009-07-29 20:57 ` [Bug 13865] New: Can only resume with HP_WMI selected on compaq nc6000 when 4c395bdd3f2ca8f7e8efad881e16071182c3b8ca is reverted Rafael J. Wysocki
@ 2009-07-29 21:31   ` Frans Pop
  2009-07-29 22:57     ` Frans Pop
  2009-07-30  9:20     ` Cédric Godin
  2009-07-30 10:42   ` [Bug 13865] [PATCH] hp-wmi: check that an input device exists in resume handler Frans Pop
  1 sibling, 2 replies; 8+ messages in thread
From: Frans Pop @ 2009-07-29 21:31 UTC (permalink / raw)
  To: cedric; +Cc: bugzilla-daemon, ACPI Devel Maling List, pm list, Matthew Garrett

On Wednesday 29 July 2009, Rafael J. Wysocki wrote:
> On Wednesday 29 July 2009, you wrote:
> > 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.

I'll at least give it a try.

Cedric, as a start, can you please provide the output of the following 
commands after the system is booted and with hp-wmi loaded:
$ grep . /sys/devices/platform/hp-wmi/*
$ ls -l /dev/input/*
$ cat /proc/bus/input/devices

Does an unload and reload of the module work correctly? What gets output 
in dmesg by that?

The strange thing is that the resume function does not do anything that's 
not also done in hp_wmi_input_setup(). The only thing I can think of is 
that we might need to test for wmi_has_guid(HPWMI_EVENT_GUID) because 
that model simply does not support input events.

Cheers,
FJP

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bug 13865] Can only resume with HP_WMI selected on compaq nc6000 when 4c395bdd3f2ca8f7e8efad881e16071182c3b8ca is reverted
  2009-07-29 21:31   ` [Bug 13865] " Frans Pop
@ 2009-07-29 22:57     ` Frans Pop
  2009-07-30  9:20     ` Cédric Godin
  1 sibling, 0 replies; 8+ messages in thread
From: Frans Pop @ 2009-07-29 22:57 UTC (permalink / raw)
  To: cedric, linux-kernel
  Cc: bugzilla-daemon, ACPI Devel Maling List, pm list, Matthew Garrett

On Wednesday 29 July 2009, Frans Pop wrote:
> The strange thing is that the resume function does not do anything
> that's not also done in hp_wmi_input_setup(). The only thing I can
> think of is that we might need to test for
> wmi_has_guid(HPWMI_EVENT_GUID) because that model simply does not
> support input events.

If that is the problem, the following patch will hopefully fix it.
This patch is against .31-rc4 but will need only minor changes to
apply against .30.

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-by: cedric@belbone.be
Signed-off-by: Frans Pop <elendil@planet.nl>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>

diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 369bd43..63c9214 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -540,11 +540,13 @@ static int hp_wmi_resume_handler(struct 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);
+	}
 
 	if (wifi_rfkill)
 		rfkill_set_states(wifi_rfkill,

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Bug 13865] Can only resume with HP_WMI selected on compaq nc6000 when 4c395bdd3f2ca8f7e8efad881e16071182c3b8ca is reverted
  2009-07-29 21:31   ` [Bug 13865] " Frans Pop
  2009-07-29 22:57     ` Frans Pop
@ 2009-07-30  9:20     ` Cédric Godin
  2009-07-30  9:56       ` Frans Pop
  1 sibling, 1 reply; 8+ messages in thread
From: Cédric Godin @ 2009-07-30  9:20 UTC (permalink / raw)
  To: Frans Pop
  Cc: bugzilla-daemon, ACPI Devel Maling List, pm list, Matthew Garrett

Frans Pop wrote:
> On Wednesday 29 July 2009, Rafael J. Wysocki wrote:
>   
>> On Wednesday 29 July 2009, you wrote:
>>     
>>> 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.
>>     
>
> I'll at least give it a try.
>
> Cedric, as a start, can you please provide the output of the following 
> commands after the system is booted and with hp-wmi loaded:
> $ grep . /sys/devices/platform/hp-wmi/*
> $ ls -l /dev/input/*
> $ cat /proc/bus/input/devices
>
> Does an unload and reload of the module work correctly? What gets output 
> in dmesg by that?
>
> The strange thing is that the resume function does not do anything that's 
> not also done in hp_wmi_input_setup(). The only thing I can think of is 
> that we might need to test for wmi_has_guid(HPWMI_EVENT_GUID) because 
> that model simply does not support input events.
>
> Cheers,
> FJP
>   
I tested your patch (from buzilla) and now I can resume.

Thanks ! You have my tested-by ;-)

PS: I suppose you don't need this infos anymore ?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bug 13865] Can only resume with HP_WMI selected on compaq nc6000 when 4c395bdd3f2ca8f7e8efad881e16071182c3b8ca is reverted
  2009-07-30  9:20     ` Cédric Godin
@ 2009-07-30  9:56       ` Frans Pop
  0 siblings, 0 replies; 8+ messages in thread
From: Frans Pop @ 2009-07-30  9:56 UTC (permalink / raw)
  To: Cédric Godin, linux-kernel
  Cc: bugzilla-daemon, ACPI Devel Maling List, pm list, Matthew Garrett

On Thursday 30 July 2009, Cédric Godin wrote:
> > The strange thing is that the resume function does not do anything
> > that's not also done in hp_wmi_input_setup(). The only thing I can
> > think of is that we might need to test for
> > wmi_has_guid(HPWMI_EVENT_GUID) because that model simply does not
> > support input events.
>
> I tested your patch (from buzilla) and now I can resume.

Great.

> Thanks ! You have my tested-by ;-)
>
> PS: I suppose you don't need this infos anymore ?

I'd still like to see the following if it's not too much trouble, 
basically to confirm that the theory was indeed correct.

$ grep . /sys/devices/platform/hp-wmi/*
$ cat /proc/bus/input/devices

Thanks,
FJP

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bug 13865] [PATCH] hp-wmi: check that an input device exists in resume handler
  2009-07-29 20:57 ` [Bug 13865] New: Can only resume with HP_WMI selected on compaq nc6000 when 4c395bdd3f2ca8f7e8efad881e16071182c3b8ca is reverted Rafael J. Wysocki
  2009-07-29 21:31   ` [Bug 13865] " Frans Pop
@ 2009-07-30 10:42   ` Frans Pop
  2009-07-30 12:37     ` Matthew Garrett
  1 sibling, 1 reply; 8+ messages in thread
From: Frans Pop @ 2009-07-30 10:42 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: bugzilla-daemon, Len Brown, ACPI Devel Maling List, pm list, LKML,
	Cédric Godin

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 <elendil@planet.nl>
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 <cedric@belbone.be>
Signed-off-by: Frans Pop <elendil@planet.nl>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>

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;
 }
--
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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Bug 13865] [PATCH] hp-wmi: check that an input device exists in resume handler
  2009-07-30 10:42   ` [Bug 13865] [PATCH] hp-wmi: check that an input device exists in resume handler Frans Pop
@ 2009-07-30 12:37     ` Matthew Garrett
  2009-07-30 21:17       ` Len Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Garrett @ 2009-07-30 12:37 UTC (permalink / raw)
  To: Frans Pop
  Cc: Rafael J. Wysocki, bugzilla-daemon, Len Brown,
	ACPI Devel Maling List, pm list, LKML, Cédric Godin

On Thu, Jul 30, 2009 at 12:42:05PM +0200, Frans Pop wrote:
> From: Frans Pop <elendil@planet.nl>
> 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 <cedric@belbone.be>
> Signed-off-by: Frans Pop <elendil@planet.nl>
> Cc: Matthew Garrett <mjg59@srcf.ucam.org>
Acked-by: Matthew Garrett <mjg@redhat.com>

-- 
Matthew Garrett | mjg59@srcf.ucam.org
--
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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Bug 13865] [PATCH] hp-wmi: check that an input device exists in resume handler
  2009-07-30 12:37     ` Matthew Garrett
@ 2009-07-30 21:17       ` Len Brown
  0 siblings, 0 replies; 8+ messages in thread
From: Len Brown @ 2009-07-30 21:17 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Frans Pop, Rafael J. Wysocki, bugzilla-daemon,
	ACPI Devel Maling List, pm list, LKML, Cédric Godin

[-- Attachment #1: Type: TEXT/PLAIN, Size: 317 bytes --]

> > Reported-and-tested-by: Cédric Godin <cedric@belbone.be>
> > Signed-off-by: Frans Pop <elendil@planet.nl>
> > Cc: Matthew Garrett <mjg59@srcf.ucam.org>

> Acked-by: Matthew Garrett <mjg@redhat.com>

Applied -- and i'll put it on my queue for 2.6.30.stable.

thanks,
Len Brown, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-07-30 21:17 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <bug-13865-10028@http.bugzilla.kernel.org/>
2009-07-29 20:57 ` [Bug 13865] New: Can only resume with HP_WMI selected on compaq nc6000 when 4c395bdd3f2ca8f7e8efad881e16071182c3b8ca is reverted Rafael J. Wysocki
2009-07-29 21:31   ` [Bug 13865] " Frans Pop
2009-07-29 22:57     ` Frans Pop
2009-07-30  9:20     ` Cédric Godin
2009-07-30  9:56       ` Frans Pop
2009-07-30 10:42   ` [Bug 13865] [PATCH] hp-wmi: check that an input device exists in resume handler Frans Pop
2009-07-30 12:37     ` Matthew Garrett
2009-07-30 21:17       ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).