mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Jerome Lacoste <jerome.lacoste@gmail.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: i8042 no mouse on resume. (i8042: failed to resume active multiplexor, mouse won't work.)
Date: Sat, 3 Jul 2010 14:20:15 -0700	[thread overview]
Message-ID: <20100703212015.GA32052@core.coreip.homeip.net> (raw)
In-Reply-To: <AANLkTilPJ6Vod4zU4gfOC3id-Cxy_Ho4I5lxMh5fLaCV@mail.gmail.com>

On Sat, Jul 03, 2010 at 10:26:13AM +0200, Jerome Lacoste wrote:
> On Fri, Jul 2, 2010 at 12:42 AM, Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> > On Fri, Jul 02, 2010 at 12:28:17AM +0200, Jerome Lacoste wrote:
> >> On Thu, Jul 1, 2010 at 11:19 PM, Jerome Lacoste
> >> <jerome.lacoste@gmail.com> wrote:
> >> > On Thu, Jul 1, 2010 at 6:24 PM, Dmitry Torokhov
> >> > <dmitry.torokhov@gmail.com> wrote:
> >> >> Hi Jerome,
> >> >>
> >> > [...]
> >> >>> * the hardware is a Lenovo 3000 N100
> >> >>
> >> >> We already trying to disable MUX mode on Lenovo 3000 N100, see
> >> >> drivers/input/serio/i8042-x86ia64io.h:
> >> >>
> [...]
> >> > System Information
> >> >        Manufacturer: LENOVO
> >> >        Product Name: 0768BKG
> >> >        Version: 3000 N100
> >> >
> >> > according to dmidecode
> >>
> >> Note: I will try the i8042.nomux option, but can't reboot until tomorrow.
> >
> > Could you please also try i8042.reset instead of i8042.nomux?
> 
> the i8042.reset works so far after 5 resumes.
> 
> Tested with: Linux expresso2 2.6.32-23-generic #37-Ubuntu SMP Fri Jun
> 11 07:54:58 UTC 2010 i686 GNU/Linux
> 
> Should I test something else ?
> 

Coudl you please try the patch below?

Thanks.

-- 
Dmitry


Input: i8042 - reset keyboard controller wehen resuming from S2R

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Some laptops, such as Lenovo 3000 N100, require keyboard controller reset
in order to have touchpad operable after suspend to RAM. Even if box does
not need the reset it should be safe to do so, so instead of chasing
after misbehaving boxes and grow DMI tables. let's reset the controller
unconditionally.

Reported-by: Jerome Lacoste <jerome.lacoste@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/serio/i8042.c |   65 +++++++++++++++++++++++++++----------------
 1 files changed, 41 insertions(+), 24 deletions(-)


diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 6440a8f..258b98b 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -861,9 +861,6 @@ static int i8042_controller_selftest(void)
 	unsigned char param;
 	int i = 0;
 
-	if (!i8042_reset)
-		return 0;
-
 	/*
 	 * We try this 5 times; on some really fragile systems this does not
 	 * take the first time...
@@ -1020,7 +1017,8 @@ static void i8042_controller_reset(void)
  * Reset the controller if requested.
  */
 
-	i8042_controller_selftest();
+	if (i8042_reset)
+		i8042_controller_selftest();
 
 /*
  * Restore the original control register setting.
@@ -1094,23 +1092,11 @@ static void i8042_dritek_enable(void)
 #ifdef CONFIG_PM
 
 /*
- * Here we try to restore the original BIOS settings to avoid
- * upsetting it.
- */
-
-static int i8042_pm_reset(struct device *dev)
-{
-	i8042_controller_reset();
-
-	return 0;
-}
-
-/*
  * Here we try to reset everything back to a state we had
  * before suspending.
  */
 
-static int i8042_pm_restore(struct device *dev)
+static int i8042_controller_resume(bool force_reset)
 {
 	int error;
 
@@ -1118,9 +1104,11 @@ static int i8042_pm_restore(struct device *dev)
 	if (error)
 		return error;
 
-	error = i8042_controller_selftest();
-	if (error)
-		return error;
+	if (i8042_reset || force_reset) {
+		error = i8042_controller_selftest();
+		if (error)
+			return error;
+	}
 
 /*
  * Restore original CTR value and disable all ports
@@ -1162,6 +1150,28 @@ static int i8042_pm_restore(struct device *dev)
 	return 0;
 }
 
+/*
+ * Here we try to restore the original BIOS settings to avoid
+ * upsetting it.
+ */
+
+static int i8042_pm_reset(struct device *dev)
+{
+	i8042_controller_reset();
+
+	return 0;
+}
+
+static int i8042_pm_resume(struct device *dev)
+{
+	/*
+	 * On resume from S2R we always try to reset the controller
+	 * to bring it in a sane state. (In case of S2D we expect
+	 * BIOS to reset the controller for us.)
+	 */
+	return i8042_controller_resume(true);
+}
+
 static int i8042_pm_thaw(struct device *dev)
 {
 	i8042_interrupt(0, NULL);
@@ -1169,9 +1179,14 @@ static int i8042_pm_thaw(struct device *dev)
 	return 0;
 }
 
+static int i8042_pm_restore(struct device *dev)
+{
+	return i8042_controller_resume(false);
+}
+
 static const struct dev_pm_ops i8042_pm_ops = {
 	.suspend	= i8042_pm_reset,
-	.resume		= i8042_pm_restore,
+	.resume		= i8042_pm_resume,
 	.thaw		= i8042_pm_thaw,
 	.poweroff	= i8042_pm_reset,
 	.restore	= i8042_pm_restore,
@@ -1389,9 +1404,11 @@ static int __init i8042_probe(struct platform_device *dev)
 
 	i8042_platform_device = dev;
 
-	error = i8042_controller_selftest();
-	if (error)
-		return error;
+	if (i8042_reset) {
+		error = i8042_controller_selftest();
+		if (error)
+			return error;
+	}
 
 	error = i8042_controller_init();
 	if (error)

  reply	other threads:[~2010-07-03 21:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-01  5:00 Jerome Lacoste
2010-07-01 16:24 ` Dmitry Torokhov
2010-07-01 21:19   ` Jerome Lacoste
2010-07-01 22:28     ` Jerome Lacoste
2010-07-01 22:42       ` Dmitry Torokhov
2010-07-03  8:26         ` Jerome Lacoste
2010-07-03 21:20           ` Dmitry Torokhov [this message]
2010-07-04  4:53             ` Henrique de Moraes Holschuh
2010-07-04  5:26               ` Dmitry Torokhov
2010-07-12 14:28             ` Jerome Lacoste
2010-07-12 16:07               ` Dmitry Torokhov
2010-07-02  0:49       ` Henrique de Moraes Holschuh

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=20100703212015.GA32052@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=jerome.lacoste@gmail.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®