From: Vojtech Pavlik <vojtech@suse.cz>
To: Jaco Kroon <jaco@kroon.co.za>
Cc: sebekpi@poczta.onet.pl, Andrew Morton <akpm@osdl.org>,
Linus Torvalds <torvalds@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: i8042 access timings
Date: Thu, 27 Jan 2005 11:25:07 +0100 [thread overview]
Message-ID: <20050127102507.GC2702@ucw.cz> (raw)
In-Reply-To: <41F888CB.8090601@kroon.co.za>
On Thu, Jan 27, 2005 at 08:23:07AM +0200, Jaco Kroon wrote:
> Sebastian Piechocki wrote:
> >As I said I'm sending you mails from kernel masters:)
> Thanks.
>
> >If you haven't such a problem, please send them your dmesg with
> >i8042.debug and acpi=off.
>
> I made an alternative plan. I applied a custom patch that gives me far less
> output and prevents scrolling and gets what I hope is what is required.
... could you just increase the timeout value to some insane amount?
That should take care of the AUX_LOOP output getting back only after
issuing the next command.
Also, can you check if adding 'usb-handoff' to the kernel command line
helps you as well as it helped Sebastian?
>
>
> With acpi=on I get the following output:
> i8042_init()
> ACPI: PS/2 Keyboard Controller [KBC0] at I/O 0x60, 0x64, irq 1
> ACPI: PS/2 Mouse Controller [MSE0] at irq 12
> i8042_controller_init()
> i8042_flush()
> i8042_check_aux()
> i8042_flush()
> i8042_check_aux: param_in=0x5a, command=AUX_LOOP, param_out=5a <= -1
> i8042_check_aux: param_in=??, command=AUX_TEST, param_out=a5 <= 0
> i8042_allocate_kbd_port()
> i8042_port_register()
>
> With acpi=off I get this:
> i8042_init()
> i8042: ACPI detection disabled
> i8042_controller_init()
> i8042_flush()
> i8042_check_aux()
> i8042_flush()
> i8042_check_aux: passed
> i8042_check_mux()
> i8042_enable_mux_mode()
> i8042_flush()
> i8042_open(): mux_version==19
> i8042.c: Detected active multiplexing controller, rev 1.9.
> i8042_enable_mux_ports()
> i8042_allocate_mux_port()
> i8042_port_register()
>
> Ok, some explanation is probably in order, I just put a printk(KERN_INFO
> "function_name()\n" at the top of practically every function and then I
> filled up i8042_check_aux() because that is where the error is detected.
> In the first case (the interesting one) these lines pop up:
>
> i8042_check_aux: param_in=0x5a, command=AUX_LOOP, param_out=5a <= -1
> i8042_check_aux: param_in=??, command=AUX_TEST, param_out=a5 <= 0
>
> Which indicates (as far as my understanding goes) that the command times
> out, as such the param value stays the same (ready for re-use in the
> second command). The second commands succeeds but does not return one
> of the expected (0x00, 0xff, 0xfa) values, instead it returns the value
> as expected by the first command (0xa5). The last value on both lines
> is the return value. From the second snippet:
>
> i8042_flush()
> i8042_check_aux: passed
>
> Indicates that the outer test passed first time round, ie, exit code 0
> and return param of 0xa5. What I have done to get mine working with
> acpi=on is applied the following patch (apologies if mozilla breaks this):
>
> ======================
> --- linux-2.6.10/drivers/input/serio/i8042.c 2004-12-24
> 23:33:52.000000000 +0200
> +++ linux-2.6.10-patched/drivers/input/serio/i8042.c 2005-01-24
> 21:44:33.790291480 +0200
> @@ -595,7 +595,7 @@
> */
>
> if (i8042_command(¶m, I8042_CMD_AUX_TEST)
> - || (param && param != 0xfa && param != 0xff))
> + || (param && param != 0xfa && param != 0xa5 &&
> param != 0xff))
> return -1;
> }
>
> ======================
>
> Which I don't think is the proper solution, more likely the problem lies
> in the i8042_command function. Unfortunately I don't have time right
> now to add more debug code (to possibly only issue those dbg statements
> upto a certain point in order to reduce the amount of output).
>
> > As I remember with acpi=off i8042 detects multplexer MUX with four ports!
> > I tried to make a hack for mux detection, but mux was detected and
> touchpad
> > was not:(
> Yes. This seems correct, however the touchoad worked "perfectly" for me
> when I booted with acpi=off.
>
> >Dmitry,
> > did you see this one?
> >
> >Since everything but the I8042_CMD_AUX_LOOP/AUX_TEST thing apparently
> >works, this is not the case of ACPI setting the wrong ports or something
> >fundamental like that. It looks like some state of the keyboard controller
> >just disables the loopback command and/or the AUX_TEST command.
> >
> >Might the "no KBD" case be something similar?
> I'm probably a bit off here, but what "no KBD" case? On these
> particular notebooks we both had to compile in specifically USB1.1
> support in order to have keyboard support, but since I want USB support
> in any case this is not a problem for me (although I would love to know
> what caused this).
>
> >Sebastian, can you make your hack also print out what the errors were (in
> >particular, was it "i8042_command()" that failed, or was it that the
> >return value was different from the expected ones, and if so - what?)
> I hope my debug did exactly that.
>
> From the orriginal mail sent to me by Sebastian:
> >>In method:
> >> i8042_check_aux
> >>
> >>There is:
> >>param = 0x5a;
> >> if (i8042_command(¶m, I8042_CMD_AUX_LOOP) || param != 0xa5)
> >>{
> >>
> >>/*
> >>* External connection test - filters out AT-soldered PS/2 i8042's
> >>* 0x00 - no error, 0x01-0x03 - clock/data stuck, 0xff - general error
> >>* 0xfa - no error on some notebooks which ignore the spec
> >>* Because it's common for chipsets to return error on perfectly
> >>functioning
> >>* AUX ports, we test for this only when the LOOP command failed.
> >>*/
> >>
> >> if (i8042_command(¶m, I8042_CMD_AUX_TEST)
> >> || (param && param != 0xfa && param != 0xff))
> >> return -1;
> >> }
> >>
> >>I have commented the line with return -1.
> >>I know that this solution is very stupid, but works fine.
> >>I use 2.6.11-rc1-mm1 kernel, and my touchpad is detected as ALPS.
> >>
> >>I think this is some special situation, that need extra detection
> >>possibility? Am I right?
> Not sure yet. It could be that the patch I've got covers all cases but
> highly unlikely.
>
> >>I can imagine a new chipset (I don't have the ATI IXP handy) that
> >>wouldn't care to implement the loopback and test commands on the AUX
> >>port. But what really surprises me here that disabling ACPI actually
> >>helps.
> But I do. So if you have any ideas I could try, or documentation to
> point me at, now is the time.
>
> >>Since Sebastian writes that the AUX check ends with a timeout, we also
> >>know that it never returns any datam so adding the printk() is probably
> >>pointless.
> From the above - isn't it simply that the timeout is too short?
> Somehow enabling ACPI makes the timer go weird? Will disabling HPET
> make a difference?
>
> >>Sebastian, here are a few shots in the dark: Does disabling Legacy USB
> >>emulation in the BIOS help? It might. Could you enable i8042.c DEBUG and
> >>compare the traces in the working and non-working cases side by side
> >>whether there is anything different prior to this failure point?
>
> It doesn't look like there is any "legacy USB" options in the BIOS. I
> might just be missing it though :).
>
> Right, long mail, sorry about that.
>
> Jaco
> --
> There are only 10 kinds of people in this world,
> those that understand binary and those that don't.
> http://www.kroon.co.za/
>
--
Vojtech Pavlik
SuSE Labs, SuSE CR
next prev parent reply other threads:[~2005-01-27 10:39 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200501260040.46288.sebekpi@poczta.onet.pl>
2005-01-27 6:23 ` i8042 access timings Jaco Kroon
2005-01-27 10:25 ` Vojtech Pavlik [this message]
2005-01-27 11:12 ` Sebastian Piechocki
2005-01-27 11:31 ` Vojtech Pavlik
2005-01-27 17:33 ` Jaco Kroon
2005-01-27 18:09 ` Linus Torvalds
2005-01-27 20:29 ` Andries Brouwer
2005-01-27 20:41 ` Dmitry Torokhov
2005-01-27 23:11 ` Andries Brouwer
2005-01-28 13:17 ` Vojtech Pavlik
2005-01-28 14:20 ` Jaco Kroon
2005-01-28 18:39 ` Vojtech Pavlik
2005-01-29 19:59 ` Jaco Kroon
2005-01-29 23:21 ` Dmitry Torokhov
2005-01-29 20:02 ` Randy.Dunlap
2005-01-27 20:51 ` Jaco Kroon
2005-01-27 21:17 ` Linus Torvalds
2005-01-27 22:12 ` Jaco Kroon
2005-01-27 22:36 ` Linus Torvalds
2005-01-27 23:40 ` Dmitry Torokhov
2005-01-28 5:52 ` Jaco Kroon
2005-02-04 19:54 ` Bukie Mabayoje
2005-01-28 11:04 ` Vojtech Pavlik
2005-01-27 20:23 ` Andries Brouwer
2005-01-25 7:41 Dmitry Torokhov
2005-01-25 10:51 ` Andries Brouwer
2005-01-25 19:17 ` Dmitry Torokhov
2005-01-25 19:25 ` Vojtech Pavlik
2005-01-25 19:41 ` Dmitry Torokhov
2005-01-25 19:46 ` Andries Brouwer
2005-01-25 20:37 ` Lee Revell
2005-01-27 15:14 ` Alan Cox
2005-01-27 16:24 ` Vojtech Pavlik
2005-01-27 16:34 ` Bill Rugolsky Jr.
2005-01-27 16:37 ` Vojtech Pavlik
2005-02-13 0:16 ` Bill Rugolsky Jr.
2005-02-13 8:22 ` Vojtech Pavlik
2005-02-13 16:17 ` Bill Rugolsky Jr.
2005-01-27 17:45 ` Andries Brouwer
2005-01-28 14:55 ` Vojtech Pavlik
2005-01-25 12:44 ` Alan Cox
2005-01-25 12:44 ` Alan Cox
2005-01-26 15:43 ` Vojtech Pavlik
2005-01-26 16:36 ` Dmitry Torokhov
2005-01-26 17:05 ` linux-os
2005-01-26 18:30 ` Dmitry Torokhov
2005-01-27 10:19 ` Vojtech Pavlik
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=20050127102507.GC2702@ucw.cz \
--to=vojtech@suse.cz \
--cc=akpm@osdl.org \
--cc=jaco@kroon.co.za \
--cc=linux-kernel@vger.kernel.org \
--cc=sebekpi@poczta.onet.pl \
--cc=torvalds@osdl.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