linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jaco Kroon <jaco@kroon.co.za>
To: Linus Torvalds <torvalds@osdl.org>
Cc: sebekpi@poczta.onet.pl, Vojtech Pavlik <vojtech@suse.cz>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: i8042 access timings
Date: Fri, 28 Jan 2005 07:52:11 +0200	[thread overview]
Message-ID: <41F9D30B.6050102@kroon.co.za> (raw)
In-Reply-To: <Pine.LNX.4.58.0501271426420.2362@ppc970.osdl.org>

Linus Torvalds wrote:
 >
 > On Fri, 28 Jan 2005, Jaco Kroon wrote:
 >
 >>>>ok, how would I try this?  Where can I find an example to code it 
from?
 >>>> Sorry, I should probably be grepping ...
 >>>
 >>>If the udelay() didn't work, then this one isn't worth worryign about
 >>>either. Back to the drawing board.
 >>
 >>Yea.  But for interrests sake, what do you mean with a serializing IO
 >>instruction?
 > If you use "outb_p()" instead of an "outb()", the regular IO instruction
 > will be followed by another out to another port on the motherboard: that
 > will not only cause a delay, it should also force at least the host 
bridge
 > to have no outstanding posted writes (the host bridge shouldn't post IO
 > port writes anyway, but hey, it won't hurt to try to make even more sure
 > of that).

No go.  Does not help at all.  Very nifty idea to force another 
character through the bus to cause a delay though.

 >>I also tried increasing the total timeout value to about 5 seconds
 >>(versus the default half second), still no success, so the device is
 >>simply not sending back the requested values.
 >
 >
 > If it was the other way around (that it works with ACPI _on_), I'd 
assume
 > that ACPI just disables some broken BIOS SMM emulation code. But I just
 > don't see ACPI _enabling_ SMM emulation. That would be just too strange,
 > and against the whole point of the legacy keyboard emulation stuff - you
 > want to do legacy keyboard emulation if the OS is old, not if it's new.

I don't see this notebook running any non-ACPI enabled OS.  It would 
just be too broken (consider the black screen of void if one boots with 
acpi=off).  Some very old legacy OSs would not even have USB1.1 support 
which will kill the keyboard.

 >
 > It may be that ACPI ends up enabling some silly power control SMM 
sequence
 > that wakes up on keyboard accesses, and screws up the emulation. That
 > sounds pretty strange too, I have to say - even if SMM/ACPI would like to
 > trap keyboard command sequences, I'd have expected it to just pass them
 > through after looking at them.

Why?  If it is going to make the screen dimmer/brighter after pressing 
the keys - what is the use of passing them through to the OS?  After 
all, the user has already seen the "effect" these keys caused and giving 
them to the OS to do something else with will end up being counter 
intuitive to the user.
 >
 > One option may be that SMM/ACPI traps the _received_ characters, and
 > incorrectly eats the reply, because it thinks it's some special key
 > sequence (and should cause SMM/ACPI to make the screen brighter or
 > something silly like that).

Interresting idea.  The Fn+F6/F7 keys does indeed make the screen 
brighter and dimmer, and afaik these gets trapped by SMM/ACPI in the 
BIOS and never even gets to Linux.

 > Does anybody know/remember what the keycode 0xA5 means?

 >>I still stand with the theory that it is sending back the value we want
 >>for the first request on the second one (managed to get this one by
 >>explicitly turning i8042_debug on and off in the code):
 >>
 >>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()
 >>drivers/input/serio/i8042.c: 20 -> i8042 (command) [4]
 >>drivers/input/serio/i8042.c: 47 <- i8042 (return) [4]
 >>drivers/input/serio/i8042.c: 60 -> i8042 (command) [5]
 >>drivers/input/serio/i8042.c: 56 -> i8042 (parameter) [5]
 >>i8042_check_aux()
 >>drivers/input/serio/i8042.c: Interrupt 12, without any data [9]
 >>i8042_flush()
 >>drivers/input/serio/i8042.c: d3 -> i8042 (command) [13]
 >>drivers/input/serio/i8042.c: 5a -> i8042 (parameter) [13]
 >>drivers/input/serio/i8042.c:      -- i8042 (timeout) [875]
 >>i8042_check_aux: param_in=0x5a, command=AUX_LOOP, param_out=5a <= -1
 >>drivers/input/serio/i8042.c: a9 -> i8042 (command) [879]
 >>drivers/input/serio/i8042.c: a5 <- i8042 (return) [879]
 >>i8042_check_aux: param_in=??, command=AUX_TEST, param_out=a5 <= 0
 >>
 >>I've rebooted a couple of times and that interrupt is in exactly the
 >>same place every time.  And int 12 is indeed the AUX device, could this
 >>be a clue?
 >
 > Does it change if you change the initial value of "param" (0x5a) to
 > something else?

I've changed the initial input to 0xbb and the output from the second 
command changed to 0x44.  So it does indeed look like my theory might be 
workable.  Just a thought, the acpi_driver i8042_acpi_aux_driver struct 
has an .add option, that gets called when ACPI detects the AUX device. 
ic8042_acpi_aux_add() gets called *before* we attempt 
initialisation/detectiong of the device.  Shouln't this be sufficient to 
say yes, there is such a device, this is it's port and irq numbers?  As 
such, do we still need to go through the AUX_LOOP and AUX_TEST process 
to determine whether the device is installed or not?  On the other hand, 
why would asking ACPI what the correct interrupt is break it?

In i8042_platform_init() (i8042-x86ia64io.h) there is a commented 
request_region() statement.  Would this make a difference, and also, 
from the comment it would make sense to reserve that region, so why is 
it commented out in the first place?

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/

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

  parent reply	other threads:[~2005-01-28  6:01 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
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 [this message]
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=41F9D30B.6050102@kroon.co.za \
    --to=jaco@kroon.co.za \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sebekpi@poczta.onet.pl \
    --cc=torvalds@osdl.org \
    --cc=vojtech@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).