All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frans Pop <elendil@planet.nl>
To: cedric@belbone.be, linux-kernel@vger.kernel.org
Cc: bugzilla-daemon@bugzilla.kernel.org,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	pm list <linux-pm@lists.linux-foundation.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>
Subject: Re: [Bug 13865] Can only resume with HP_WMI selected on compaq nc6000 when 4c395bdd3f2ca8f7e8efad881e16071182c3b8ca is reverted
Date: Thu, 30 Jul 2009 00:57:47 +0200	[thread overview]
Message-ID: <200907300057.48669.elendil@planet.nl> (raw)
In-Reply-To: <200907292331.34214.elendil@planet.nl>

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,

  reply	other threads:[~2009-07-29 22:57 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 20:57 ` Rafael J. Wysocki
2009-07-29 21:31   ` [Bug 13865] " Frans Pop
2009-07-29 22:57     ` Frans Pop [this message]
2009-07-29 22:57     ` Frans Pop
2009-07-30  9:20     ` Cédric Godin
2009-07-30  9:20     ` Cédric Godin
2009-07-30  9:56       ` Frans Pop
2009-07-30  9:56       ` Frans Pop
2009-07-29 21:31   ` 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 10:42   ` Frans Pop
2009-07-30 10:42     ` Frans Pop
2009-07-30 12:37     ` Matthew Garrett
2009-07-30 12:37       ` Matthew Garrett
2009-07-30 21:17       ` Len Brown
2009-07-30 21:17       ` Len Brown
2009-07-30 12:37     ` Matthew Garrett
2009-08-02 19:06 2.6.31-rc5: Reported regressions 2.6.29 -> 2.6.30 Rafael J. Wysocki
2009-08-02 19:09 ` [Bug #13865] Can only resume with HP_WMI selected on compaq nc6000 when 4c395bdd3f2ca8f7e8efad881e16071182c3b8ca is reverted Rafael J. Wysocki
2009-08-02 22:53   ` Frans Pop
2009-08-02 22:53     ` Frans Pop
     [not found]     ` <200908030053.27869.elendil-EIBgga6/0yRmR6Xm/wNWPw@public.gmane.org>
2009-08-03 15:18       ` Rafael J. Wysocki
2009-08-03 15:18         ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200907300057.48669.elendil@planet.nl \
    --to=elendil@planet.nl \
    --cc=bugzilla-daemon@bugzilla.kernel.org \
    --cc=cedric@belbone.be \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mjg59@srcf.ucam.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.