All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: linux-kernel@vger.kernel.org, Adam Morley <adam.morley@gmail.com>
Subject: Re: psmouse doesn't seem to reinitialize after mem suspend (acpi) when using i8042 on ALi M1553 ISA bridge with 2.6.11.11 or 2.6.12-rc5?
Date: Tue, 7 Jun 2005 22:52:39 -0500	[thread overview]
Message-ID: <200506072252.40120.dtor_core@ameritech.net> (raw)
In-Reply-To: <b70d7380050606002834116fea@mail.gmail.com>

On Monday 06 June 2005 02:28, Adam Morley wrote:
> Hi Dimitry,
> 
> On 6/5/05, Dmitry Torokhov <dtor_core@ameritech.net> wrote:
> > On Sunday 05 June 2005 21:24, Adam Morley wrote:
> >  > When I do a mem suspend (echo mem > /sys/power/state), either through
> > > a lid switch ACPI action, or manually echo'ing the parameter, the
> > > mouse doesn't work after un-suspending.  It seems like it is no longer
> > > detected/initialized.  cat'ing the device file doesn't produce output,
> > > and gpm and X don't get mouse inputs.
> > 
> > Could you please try booting 2.6.12-rc5 with "i8042.debug" on the kernel
> > command line; suspend, resume and post your dmesg?
> 
> Sure.  Here it is.  Suspend was done using acpid using a lid action. 
> psmouse was modprobe -r'ed before suspend and modprobe'ed back in
> after resume.
>

We are trying to resume but KBC signals timeout condition every time we
ping AUX port:

> drivers/input/serio/i8042.c: 60 -> i8042 (command) [220701]
> drivers/input/serio/i8042.c: 47 -> i8042 (parameter) [220701]
> drivers/input/serio/i8042.c: d4 -> i8042 (command) [220703]
> drivers/input/serio/i8042.c: f2 -> i8042 (parameter) [220703]
> drivers/input/serio/i8042.c: fe <- i8042 (interrupt, AUX, 12, timeout) [220725]
> drivers/input/serio/i8042.c: d4 -> i8042 (command) [220726]
> drivers/input/serio/i8042.c: ed -> i8042 (parameter) [220726]
> drivers/input/serio/i8042.c: fe <- i8042 (interrupt, AUX, 12, timeout) [220747]
> drivers/input/serio/i8042.c: 60 -> i8042 (command) [220748]
> drivers/input/serio/i8042.c: 45 -> i8042 (parameter) [220748]
> drivers/input/serio/i8042.c: 60 -> i8042 (command) [220943]
> drivers/input/serio/i8042.c: 47 -> i8042 (parameter) [220943]
> drivers/input/serio/i8042.c: d4 -> i8042 (command) [220943]
> drivers/input/serio/i8042.c: f2 -> i8042 (parameter) [220943]
> drivers/input/serio/i8042.c: fe <- i8042 (interrupt, AUX, 12, timeout) [220965]

Could you please try the patch below?

-- 
Dmitry

From: Vojtech Pavlik <vojtech@suse.cz>

Input: Only write the CTR in i8042 resume function. Reading it is
       wrong, since it may (will) contain nonsensical data.

Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

 drivers/input/serio/i8042.c |   48 +++++++++++++++++++++++++-------------------
 1 files changed, 28 insertions(+), 20 deletions(-)

Index: work/drivers/input/serio/i8042.c
===================================================================
--- work.orig/drivers/input/serio/i8042.c
+++ work/drivers/input/serio/i8042.c
@@ -698,6 +698,26 @@ static void i8042_timer_func(unsigned lo
 	i8042_interrupt(0, NULL, NULL);
 }
 
+static int i8042_ctl_test(void)
+{
+	unsigned char param;
+
+	if (!i8042_reset)
+		return 0;
+
+	if (i8042_command(&param, I8042_CMD_CTL_TEST)) {
+		printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n");
+		return -1;
+	}
+
+	if (param != I8042_RET_CTL_TEST) {
+		printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n",
+			 param, I8042_RET_CTL_TEST);
+		return -1;
+	}
+
+	return 0;
+}
 
 /*
  * i8042_controller init initializes the i8042 controller, and,
@@ -719,21 +739,8 @@ static int i8042_controller_init(void)
 		return -1;
 	}
 
-	if (i8042_reset) {
-
-		unsigned char param;
-
-		if (i8042_command(&param, I8042_CMD_CTL_TEST)) {
-			printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n");
-			return -1;
-		}
-
-		if (param != I8042_RET_CTL_TEST) {
-			printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n",
-				 param, I8042_RET_CTL_TEST);
-			return -1;
-		}
-	}
+	if (i8042_ctl_test())
+		return -1;
 
 /*
  * Save the CTR for restoral on unload / reboot.
@@ -806,9 +813,7 @@ static void i8042_controller_reset(void)
  * Reset the controller if requested.
  */
 
-	if (i8042_reset)
-		if (i8042_command(&param, I8042_CMD_CTL_TEST))
-			printk(KERN_ERR "i8042.c: i8042 controller reset timeout.\n");
+	i8042_ctl_test();
 
 /*
  * Disable MUX mode if present.
@@ -920,8 +925,11 @@ static int i8042_resume(struct device *d
 	if (level != RESUME_ENABLE)
 		return 0;
 
-	if (i8042_controller_init()) {
-		printk(KERN_ERR "i8042: resume failed\n");
+	if (i8042_ctl_test())
+		return -1;
+
+	if (i8042_command(&i8042_ctr, I8042_CMD_CTL_WCTR)) {
+		printk(KERN_ERR "i8042: Can't write CTR\n");
 		return -1;
 	}
 

  reply	other threads:[~2005-06-08  3:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-06  2:24 psmouse doesn't seem to reinitialize after mem suspend (acpi) when using i8042 on ALi M1553 ISA bridge with 2.6.11.11 or 2.6.12-rc5? Adam Morley
2005-06-06  6:25 ` Dmitry Torokhov
2005-06-06  7:28   ` Adam Morley
2005-06-08  3:52     ` Dmitry Torokhov [this message]
2005-06-08  4:58       ` Adam Morley
2005-06-08  6:17         ` Dmitry Torokhov
     [not found]           ` <b70d73800506080009c20eeff@mail.gmail.com>
     [not found]             ` <d120d50005060808273707bb8@mail.gmail.com>
     [not found]               ` <b70d7380050608093138eb42df@mail.gmail.com>
2005-06-09  2:27                 ` Adam Morley
2005-06-09  2:43                   ` Dmitry Torokhov
2005-06-09  4:03                     ` Adam Morley
2005-06-14  5:22                       ` Adam Morley
2005-06-14  5:37                         ` Dmitry Torokhov
     [not found]                           ` <b70d738005061322453f4280d@mail.gmail.com>
2005-06-21  2:34                             ` Adam Morley

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=200506072252.40120.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=adam.morley@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 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.