Skip to contentSkip to conversation

i8042 controller on Toshiba Satellite P10 notebook - patch

PATCH Jaco Kroon 4 participants 18 messages Apr 4, 2005 – Apr 6, 2005 Input drivers

lore
Share & tools
lore

Jaco Kroon

author
#0 lore raw

Hello all

A while back there was quite a discussion on this issue and then specifically "i8042 timing issues". I refer you to
http://lkml.org/lkml/2005/1/27/11 for more detail.

It turns out that it was the case that the i8042 controller responds too late on commands, for example, we issue a AUX_LOOP command, whilst waiting for the response it would time out, however, when issuing AUX_TEST we will get the response for AUX_LOOP. It turns out this is also true for the MUX and KBD parts of the driver. The attached patch resolves this issue by providing a configurable option to issue commands that expects results twice (not sure whether this is a good idea - but it seems all commands either set some value or query some value). Between the two commands it calls i8042_flush() to make sure that there are not any earlier responses in the buffer.

I've built the patch against linux-2.6.11.6 and it should apply cleanly (I've attached the patch cause it is about 80 lines in length and I fear mozilla will break the formatting).

The patch fixes the problem for me - not sure how many other people out there has the same issue. It provides a configurable option which can be selected in the kernel configuration to actually enable this (albeit enabling it should only result in a minor performance hit should it be enabled needlessly - I think). Should the option not be enabled the code remains 100% unchanged (except for one extra level of indentation).

I'm not sure what the policy regarding #ifdefs are, especially considering they enclose the endpoints of a loop, please review and comment.

Jaco

Signature · 3 lines
There are only 10 kinds of people in this world,
  those that understand binary and those that don't.
http://www.kroon.co.za/
drivers/input/serio/Kconfig +13 -0
diff -rau linux-2.6.11.6.orig/drivers/input/serio/Kconfig linux-2.6.11.6/drivers/input/serio/Kconfig
@@ -31,6 +31,19 @@
 	  To compile this driver as a module, choose M here: the
 	  module will be called i8042.
 
+config SERIO_I8042_DELAYEDRESPONSEKLUDGE
+	tristate "i8042 delayed response kludge"
+	default n
+	depends on SERIO_I8042
+	---help---
+	  The Toshiba Satellite P10 series has a delayed response on the i8042
+	  device which controls the mouse/keyboard.  Whilst the keyboard can
+	  function without this kludge it is required for the touchpad.  Whilst
+	  the kludge should not break other systems I highly recommend saying N
+	  on all systems but those who suffer this problem.
+
+	  If unsure, say N.
+
 config SERIO_SERPORT
 	tristate "Serial port line discipline"
 	default y
drivers/input/serio/i8042.c +29 -12

53 lines not on this page · raw message

maintainer
#1 lore raw

Hi,

Quoted 5 lines · Jaco Kroon

Hello all

A while back there was quite a discussion on this issue and then specifically "i8042 timing issues". I refer you to
http://lkml.org/lkml/2005/1/27/11 for more detail.

...

I was under impression that "usb-handoff" kernel parameter fixed the problem and therefore the patch is not needed. Am I wrong?

Signature · 1 line
Dmitry
author
#2 lore raw
Quoted 6 lines · Dmitry Torokhov

Hi,

Quoted 2 lines · Jaco Kroon

Hello all

Quoted 9 lines
Quoted 3 lines

A while back there was quite a discussion on this issue and then specifically "i8042 timing issues". I refer you to
http://lkml.org/lkml/2005/1/27/11 for more detail.

...

I was under impression that "usb-handoff" kernel parameter fixed the problem and therefore the patch is not needed. Am I wrong?

Yes, to a certain extent. usb-handoff causes the whole notebook to lock up at the next reboot (as in it doesn't even come up with the BIOS splash screen). The only way to recover from that is to disconnect all power from the notebook, leave it for a couple of seconds, reconnect and only then can you go on. It does however help with the whole touchpad/keyboard problem (can't remember whether it fixes the keyboard requires usb-1.1 or the AUX problem).

Jaco

Signature · 3 lines
There are only 10 kinds of people in this world,
  those that understand binary and those that don't.
http://www.kroon.co.za/
maintainer
#3 lore raw
Quoted 17 lines · Jaco Kroon
Quoted 6 lines · Dmitry Torokhov

Hi,

Quoted 2 lines · Jaco Kroon

Hello all

Quoted 9 lines
Quoted 3 lines

A while back there was quite a discussion on this issue and then specifically "i8042 timing issues". I refer you to
http://lkml.org/lkml/2005/1/27/11 for more detail.

...

I was under impression that "usb-handoff" kernel parameter fixed the problem and therefore the patch is not needed. Am I wrong?

Quoted 8 lines

Yes, to a certain extent. usb-handoff causes the whole notebook to lock up at the next reboot (as in it doesn't even come up with the BIOS splash screen). The only way to recover from that is to disconnect all power from the notebook, leave it for a couple of seconds, reconnect and only then can you go on. It does however help with the whole touchpad/keyboard problem (can't remember whether it fixes the keyboard requires usb-1.1 or the AUX problem).

I see... Have you tried compiling i8042, atkbd and psmouse as modules and adjusting the init scripts so they are all loaded after USB drivers are loaded - does it also cause lock up on reboot? I wonder if it is usb-handoff probem or it is a bigger problem with USB on your Toshiba.

Signature · 1 line
Dmitry
author
#4 lore raw
Quoted 19 lines · Dmitry Torokhov
Quoted 10 lines · Jaco Kroon
Quoted 9 lines · Dmitry Torokhov
Quoted 3 lines · Jaco Kroon

A while back there was quite a discussion on this issue and then specifically "i8042 timing issues". I refer you to
http://lkml.org/lkml/2005/1/27/11 for more detail.

I was under impression that "usb-handoff" kernel parameter fixed the problem and therefore the patch is not needed. Am I wrong?

Quoted 8 lines

Yes, to a certain extent. usb-handoff causes the whole notebook to lock up at the next reboot (as in it doesn't even come up with the BIOS splash screen). The only way to recover from that is to disconnect all power from the notebook, leave it for a couple of seconds, reconnect and only then can you go on. It does however help with the whole touchpad/keyboard problem (can't remember whether it fixes the keyboard requires usb-1.1 or the AUX problem).

Quoted 5 lines

I see... Have you tried compiling i8042, atkbd and psmouse as modules and adjusting the init scripts so they are all loaded after USB drivers are loaded - does it also cause lock up on reboot? I wonder if it is usb-handoff probem or it is a bigger problem with USB on your Toshiba.

I'm not so sure that it a usb problem. Remember that acpi=off also fixes the problem - but also result in the black void of death as I've come to call it. I would not be surprised whichever way this one goes (bug in kernel or bug in hardware).

As for loading the modules i8042, atkbd and psmouse (in that order):
black void of death.

Jaco

Signature · 3 lines
There are only 10 kinds of people in this world,
  those that understand binary and those that don't.
http://www.kroon.co.za/
maintainer
#5 lore raw
Quoted 4 lines · Jaco Kroon

As for loading the modules i8042, atkbd and psmouse (in that order):
black void of death.

Hmm.. remind me, if you boot with usb-handoff does it switch the i8042 into active multiplexing mode (you get 4 AUX serio ports)?

Signature · 1 line
Dmitry
author
#6 lore raw
Quoted 8 lines · Dmitry Torokhov
Quoted 3 lines · Jaco Kroon

As for loading the modules i8042, atkbd and psmouse (in that order):
black void of death.

Hmm.. remind me, if you boot with usb-handoff does it switch the i8042 into active multiplexing mode (you get 4 AUX serio ports)?

Checking my logs it actually looks like usb-handoff did get 4 ports. With my patch, however, I only get:

serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 AUX port at 0x60,0x64 irq 1

Quoted 1 line

From the code I understand that this means that i8042_nomux != 0 or

i8042_check_mux() return != 0. So I assume that with the patch that check_mux returns non-zero (and reversed logic means that 0 implies the check succeeds, ie, it _fails_ with my patch installed). I don't know which is the prefered mode of operation though (I guess MUX with 4 AUX ports?).

With my patch I do get the ALPS support though - something which I didn't get with usb-handoff, nor with acpi=off, nor with simply hacking out the AUX_LOOP and AUX_TEST tests and just assuming the hardware is there (I saw ALPS yesterday for the first time in my life for that matter).

OT: I think I prefer synaptics multi-finger tapping to the tapping in specific locations to get right and middle clicking, but that is another story that probably has nothing to do with the kernel, and quite likely something that is configurable in the synaptics xorg driver.

Jaco

Signature · 3 lines
There are only 10 kinds of people in this world,
  those that understand binary and those that don't.
http://www.kroon.co.za/
maintainer
#7 lore raw
Quoted 6 lines · Jaco Kroon
Quoted 5 lines · Dmitry Torokhov
Quoted 3 lines · Jaco Kroon

As for loading the modules i8042, atkbd and psmouse (in that order):
black void of death.

Quoted 9 lines
Quoted 3 lines

Hmm.. remind me, if you boot with usb-handoff does it switch the i8042 into active multiplexing mode (you get 4 AUX serio ports)?

Checking my logs it actually looks like usb-handoff did get 4 ports. With my patch, however, I only get:

serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 AUX port at 0x60,0x64 irq 1

Ok, try booting with "usb-handoff i8042.nomux". If that cures death-on-reboot problem then Vojtech already has a patch in 2.6.12-rc1:

http://linux.bkbits.net:8080/linux-2.5/cset@41f8e2d7j4JtjbrlrI5eYgQQ86yDhg

Quoted 7 lines
Quoted 1 line

From the code I understand that this means that i8042_nomux != 0 or

i8042_check_mux() return != 0. So I assume that with the patch that check_mux returns non-zero (and reversed logic means that 0 implies the check succeeds, ie, it _fails_ with my patch installed). I don't know which is the prefered mode of operation though (I guess MUX with 4 AUX ports?).

Yes, with 4 ports your external mouse is independent from the touhpad. When you have only 1 port you can't use touchpad's extended mode together with an external mouse.

Quoted 5 lines

With my patch I do get the ALPS support though - something which I didn't get with usb-handoff, nor with acpi=off, nor with simply hacking out the AUX_LOOP and AUX_TEST tests and just assuming the hardware is there (I saw ALPS yesterday for the first time in my life for that matter).

Hmm, I'd like to debug that once we resolve reboot problems.

Quoted 5 lines

OT: I think I prefer synaptics multi-finger tapping to the tapping in specific locations to get right and middle clicking, but that is another story that probably has nothing to do with the kernel, and quite likely something that is configurable in the synaptics xorg driver.

You should be able to control that in xorg.conf.

Signature · 1 line
Dmitry
author
#8 lore raw
Quoted 1 line · Dmitry Torokhov

Ok, try booting with "usb-handoff i8042.nomux". If that cures

yes, it cures both problems (death on reboot and ALPS), in fact. But I must have *both* params. nomux without usb-handoff causes all input devices to fail. Thanks goodness for ssh. Anyway - I'm now running a clean 2.6.11.6 kernel that *works*.

Quoted 4 lines

death-on-reboot problem then Vojtech already has a patch in 2.6.12-rc1:

http://linux.bkbits.net:8080/linux-2.5/cset@41f8e2d7j4JtjbrlrI5eYgQQ86yDhg

Yes, this should fix the death-on-reboot (why oh why can't the BIOS just "do the right thing"), it still won't get me alps though. For that I need the nomux option - ie, a total different codepath than what that patch attends to. And it probably won't fix the keyboard problem. This sucks (don't get me wrong - I appreciate that my hardware is now functioning properly - only things afaik that doesn't work now is the SD card reader and suspend/hibernate and with ati-drivers there is not a chance in hell that that'll ever work, neither of which is of critical importance for me).

Quoted 3 lines

Yes, with 4 ports your external mouse is independent from the touhpad. When you have only 1 port you can't use touchpad's extended mode together with an external mouse.

No external PS/2 port :).

Quoted 6 lines
Quoted 4 lines

With my patch I do get the ALPS support though - something which I didn't get with usb-handoff, nor with acpi=off, nor with simply hacking out the AUX_LOOP and AUX_TEST tests and just assuming the hardware is there (I saw ALPS yesterday for the first time in my life for that matter).

Hmm, I'd like to debug that once we resolve reboot problems.

Anything else that you would like me to try?

Quoted 6 lines
Quoted 4 lines

OT: I think I prefer synaptics multi-finger tapping to the tapping in specific locations to get right and middle clicking, but that is another story that probably has nothing to do with the kernel, and quite likely something that is configurable in the synaptics xorg driver.

You should be able to control that in xorg.conf.

My thoughts exactly. The same goes for gpm.

Thanks a lot for your time, patience and knowledge.

Jaco

Signature · 3 lines
There are only 10 kinds of people in this world,
  those that understand binary and those that don't.
http://www.kroon.co.za/
maintainer
#9 lore raw
Quoted 23 lines · Jaco Kroon
Quoted 1 line · Dmitry Torokhov

Ok, try booting with "usb-handoff i8042.nomux". If that cures

yes, it cures both problems (death on reboot and ALPS), in fact. But I must have *both* params. nomux without usb-handoff causes all input devices to fail. Thanks goodness for ssh. Anyway - I'm now running a clean 2.6.11.6 kernel that *works*.

Quoted 4 lines

death-on-reboot problem then Vojtech already has a patch in 2.6.12-rc1:

http://linux.bkbits.net:8080/linux-2.5/cset@41f8e2d7j4JtjbrlrI5eYgQQ86yDhg

Yes, this should fix the death-on-reboot (why oh why can't the BIOS just "do the right thing"), it still won't get me alps though. For that I need the nomux option - ie, a total different codepath than what that patch attends to. And it probably won't fix the keyboard problem. This sucks (don't get me wrong - I appreciate that my hardware is now functioning properly - only things afaik that doesn't work now is the SD card reader and suspend/hibernate and with ati-drivers there is not a chance in hell that that'll ever work, neither of which is of critical importance for me).

Quoted 6 lines
Quoted 3 lines

Yes, with 4 ports your external mouse is independent from the touhpad. When you have only 1 port you can't use touchpad's extended mode together with an external mouse.

No external PS/2 port :).

A-haa.. Well, in that case we'll cheat ;) and just disable MUX mode for your Toshiba via a DMI quirk, like we do for certain Fujitsus. If there is no external port there is no reason to have the controller in MUX mode.

Could you please send me output of 'dmidecode' utility?

Signature · 1 line
Dmitry
author
#10 lore raw
Quoted 6 lines · Dmitry Torokhov

A-haa.. Well, in that case we'll cheat ;) and just disable MUX mode for your Toshiba via a DMI quirk, like we do for certain Fujitsus. If there is no external port there is no reason to have the controller in MUX mode.

Could you please send me output of 'dmidecode' utility?

Ah yes. Your lucky it's only a 37KB download. Some nice tools...

It's a _lot_ of output so I'm again rather attaching it (gzipped).

Would this quirk also imply usb-handoff?

One (hopefully) last query, lspci reports the following device (which I assume is the SD card reader):

0000:02:04.2 Class 0805: ENE Technology Inc: Unknown device 0550

How can one confirm what this is?

Jaco

Signature · 3 lines
There are only 10 kinds of people in this world,
  those that understand binary and those that don't.
http://www.kroon.co.za/
#11 lore raw
Quoted 7 lines · Jaco Kroon
Quoted 5 lines · Dmitry Torokhov

A-haa.. Well, in that case we'll cheat ;) and just disable MUX mode for your Toshiba via a DMI quirk, like we do for certain Fujitsus. If there is no external port there is no reason to have the controller in MUX mode.

Quoted 6 lines
Quoted 1 line

Could you please send me output of 'dmidecode' utility?

Ah yes. Your lucky it's only a 37KB download. Some nice tools...

It's a _lot_ of output so I'm again rather attaching it (gzipped).

Ok, great! Please try the patch below (against 2.6.12-rc{1|2}).

Quoted 2 lines

Would this quirk also imply usb-handoff?

No, just nomux. We are still battling whether we shoudl have usb-handoff on by default.

Quoted 6 lines

One (hopefully) last query, lspci reports the following device (which I assume is the SD card reader):

0000:02:04.2 Class 0805: ENE Technology Inc: Unknown device 0550

How can one confirm what this is?

Not sure, sorry.

Signature · 44 lines
Dmitry

===================================================================

Input: automatically disable MUX mode on Toshiba Satellite P10
       because it interferes with ALPS touchpad detection and
       causes horrible death on reboot. Since P10 does not have
       external PS/2 ports MUX mode does not have any advantages
       over legacy mode anyway.


 i8042-x86ia64io.h |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletion(-)

Index: dtor/drivers/input/serio/i8042-x86ia64io.h
===================================================================
--- dtor.orig/drivers/input/serio/i8042-x86ia64io.h
+++ dtor/drivers/input/serio/i8042-x86ia64io.h
@@ -88,9 +88,11 @@ static struct dmi_system_id __initdata i
 };
 
 /*
- * Some Fujitsu notebooks are ahving trouble with touhcpads if
+ * Some Fujitsu notebooks are having trouble with touchpads if
  * active multiplexing mode is activated. Luckily they don't have
  * external PS/2 ports so we can safely disable it.
+ * ... apparently some Toshibas don't like MUX mode either and
+ * die horrible death on reboot.
  */
 static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = {
 	{
@@ -121,6 +123,13 @@ static struct dmi_system_id __initdata i
 			DMI_MATCH(DMI_PRODUCT_NAME, "FMVLT70H"),
 		},
 	},
+	{
+		.ident = "Toshiba P10",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P10"),
+		},
+	},
 	{ }
 };
maintainer
#13 lore raw
In reply to Stefan Seyfried
Quoted 8 lines · Stefan Seyfried
Quoted 7 lines · Jaco Kroon
Quoted 5 lines · Dmitry Torokhov
Quoted 4 lines

OT: I think I prefer synaptics multi-finger tapping to the tapping in specific locations to get right and middle clicking, but that is another story that probably has nothing to do with the kernel, and quite likely something that is configurable in the synaptics xorg driver.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

You should be able to control that in xorg.conf.

My thoughts exactly. The same goes for gpm.

No. AFAIK multifinger taps are handled by the touchpad firmware, but not on ALPS touchpads, only on synaptics.

Yes, you are right... I meant one could remap actions to corner and multi-finger taps in xorg.conf but if hardware does not recognize multi-finger taps then you are out of luck.

Signature · 1 line
Dmitry
#12 lore raw
In reply to Jaco Kroon
Quoted 10 lines · Jaco Kroon
Quoted 6 lines · Dmitry Torokhov
Quoted 4 lines

OT: I think I prefer synaptics multi-finger tapping to the tapping in specific locations to get right and middle clicking, but that is another story that probably has nothing to do with the kernel, and quite likely something that is configurable in the synaptics xorg driver.

You should be able to control that in xorg.conf.

My thoughts exactly. The same goes for gpm.

No. AFAIK multifinger taps are handled by the touchpad firmware, but not on ALPS touchpads, only on synaptics.

Regards,

Stefan

author
#14 lore raw
In reply to Dmitry Torokhov
Quoted 5 lines · Dmitry Torokhov
Quoted 4 lines · Stefan Seyfried
Quoted 3 lines · Jaco Kroon
Quoted 1 line · Dmitry Torokhov

You should be able to control that in xorg.conf.

Quoted 9 lines
Quoted 4 lines
Quoted 1 line

My thoughts exactly. The same goes for gpm.

No. AFAIK multifinger taps are handled by the touchpad firmware, but not on ALPS touchpads, only on synaptics.

Yes, you are right... I meant one could remap actions to corner and multi-finger taps in xorg.conf but if hardware does not recognize multi-finger taps then you are out of luck.

Argh... This is going to take some getting used to. Why would ALPS not have multi-finger detection? That was such a cool feature. gpm seems to be having problems getting the tapping thing right though but I should most probably just rtfm a bit more :).

btw Dmitri, that patch does not seem to work. But the kernel panic that kicks in when X starts up does imply that _something_ changed. No sync however, so no stack trace in the logs either. In fact, looking at the dmesg part of those two boot attempts the serio i8042 driver doesn't even manage to find the KBD or AUX ports (No keyboard or mouse).

I can do more trouble shooting at a later point. For now I'll just use "i8042.nomux=1 usb-handoff" to boot with. Thanks for the effort.

Jaco

Signature · 3 lines
There are only 10 kinds of people in this world,
  those that understand binary and those that don't.
http://www.kroon.co.za/
maintainer
#15 lore raw
Quoted 7 lines · Jaco Kroon

btw Dmitri, that patch does not seem to work. But the kernel panic that kicks in when X starts up does imply that _something_ changed. No sync however, so no stack trace in the logs either. In fact, looking at the dmesg part of those two boot attempts the serio i8042 driver doesn't even manage to find the KBD or AUX ports (No keyboard or mouse).

I wounder how it could be. The patch just does i8042_nomux=1, exactly as i8042.nomux does. Can I get that panic trace, please? I assume you see it on the screen?

Quoted 2 lines

I can do more trouble shooting at a later point. For now I'll just use "i8042.nomux=1 usb-handoff" to boot with. Thanks for the effort.

You were still using "usb-handoff" with my patch, weren't you? Only "i8042.nomux" can be dropped.

Signature · 1 line
Dmitry
author
#16 lore raw
Quoted 11 lines · Dmitry Torokhov
Quoted 5 lines · Jaco Kroon

btw Dmitri, that patch does not seem to work. But the kernel panic that kicks in when X starts up does imply that _something_ changed. No sync however, so no stack trace in the logs either. In fact, looking at the dmesg part of those two boot attempts the serio i8042 driver doesn't even manage to find the KBD or AUX ports (No keyboard or mouse).

I wounder how it could be. The patch just does i8042_nomux=1, exactly as i8042.nomux does. Can I get that panic trace, please? I assume you see it on the screen?

Black screen. That is it. Will try again tomorrow if I can - right now I dearly need some sleep.

Quoted 5 lines
Quoted 2 lines

I can do more trouble shooting at a later point. For now I'll just use "i8042.nomux=1 usb-handoff" to boot with. Thanks for the effort.

You were still using "usb-handoff" with my patch, weren't you? Only "i8042.nomux" can be dropped.

Yes.

Jaco

Signature · 3 lines
There are only 10 kinds of people in this world,
  those that understand binary and those that don't.
http://www.kroon.co.za/
author
#17 lore raw
In reply to Dmitry Torokhov
Quoted 11 lines · Dmitry Torokhov
Quoted 5 lines · Jaco Kroon

btw Dmitri, that patch does not seem to work. But the kernel panic that kicks in when X starts up does imply that _something_ changed. No sync however, so no stack trace in the logs either. In fact, looking at the dmesg part of those two boot attempts the serio i8042 driver doesn't even manage to find the KBD or AUX ports (No keyboard or mouse).

I wounder how it could be. The patch just does i8042_nomux=1, exactly as i8042.nomux does. Can I get that panic trace, please? I assume you see it on the screen?

I just realised that in my haste I tested it against the 2.6.11.6 kernel, not the 2.6.12rc{1,2} as you instructed. I'll retest as soon as I can.

Signature · 3 lines
There are only 10 kinds of people in this world,
  those that understand binary and those that don't.
http://www.kroon.co.za/