public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Patch?: linux-2.5.33/drivers/input/keyboard/atkbd.c allow SETLEDS to fail
@ 2002-09-09 15:04 Adam J. Richter
  2002-09-09 15:20 ` Vojtech Pavlik
  0 siblings, 1 reply; 7+ messages in thread
From: Adam J. Richter @ 2002-09-09 15:04 UTC (permalink / raw)
  To: vojtech; +Cc: linux-kernel

On Mon, 9 Sep 2002 at 16:07:23 +0200, Vojtech Pavlik wrote:
>On Mon, Sep 09, 2002 at 06:51:11AM -0700, Adam J. Richter wrote:

>> 	I have a computer with an Iwill VD133 motherboard doing
>> USB-to-PS/2 keyboard emulation (built into the chipset somewhere)
>> for a BTC 7932M USB keyboard.  Under this configuration, the
>> SETLEDS command in atkbd_probe fails (the first atkbd_sendbyte
>> in atkbd_command fails), but the keyboard otherwise works if
>> that failure is ignored.
[...]

>I cannot do that, since then the keyboard identification will give too
>many positives.

	What real problem does that cause?  There are other tests that
the keyboard still has to pass.  Does this change even cause a false
positive in any real case?  As I understand it, this is how it was
prior to 2.5.32.


>I assume you have an USB keyboard, and the BIOS emulates a PS/2 keyboard
>for non-USB capable OSes.

>Well, fix Linux irq router code, instead of damaging the keyboard code.

	How is the Linux IRQ routing code broken?  As far as I know,
it only reads the information given to it and cannot reprogram the
hardware.

	My understanding is that the BIOS is responsible for setting
up the IRQ routes of each device and writing them into each device's
PCI configuration register dword 15 byte 0 (INTERRUPT_LINE), which is
normally just 8 bits of RAM.  The mechanism for *making* those routes
is vendor specific and handled by the BIOS at boot time.  In the
particular case of my VD133, it apparently uses a Via VT82C598 PCI
bridge ("Apollo MVP3 AGP"), which I think is the component that would
have the secret bits for setting up routing from the main PCI bus to
the interrupt controllers.  And those bits do appear to be secret.
While I have found programming information for a number of Via chips
on my VD133 motherboard, I have only been able to find technical
marketing information on the VT82C598, and the form for requesting
additional information from the Via web site says they normally only
give more detailed documentation to high-volume partners under
non-disclosure agreements.

	By the way, there is a note in drivers/pci/quirks.c that
mentioned that a different Via chipset did IRQ configuration for the
USB device by having the write to the INTERRUPT_LINE register actually
do the configuration. I tried it ("setpci -v -s 00:01.0 INTERRUPT_LINE=7"),
but that didn't update the kernel's idea of the IRQ routing (although
I could read it back from hardware with "lspci -H 1 -vv -s 00:01.0").

	However, even if some further development of this kludge works
(I would welcome that), I suspect that the bug that I am reporting is
common to many USB emulated keyboards, and that my fix does not cause
a real problem, and applications that do not need USB for any other
purpose to avoid including or configuring Linux USB.

	On the other hand, if there is real hardware is broken by my
change (and kernels prior to 2.5.32 I assume), that would change things,
and I'd be interested in knowing what that hardware is and how it breaks.

Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Patch?: linux-2.5.33/drivers/input/keyboard/atkbd.c allow SETLEDS to fail
@ 2002-09-09 13:51 Adam J. Richter
  2002-09-09 14:07 ` Vojtech Pavlik
  0 siblings, 1 reply; 7+ messages in thread
From: Adam J. Richter @ 2002-09-09 13:51 UTC (permalink / raw)
  To: vojtech; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1306 bytes --]

	I have a computer with an Iwill VD133 motherboard doing
USB-to-PS/2 keyboard emulation (built into the chipset somewhere)
for a BTC 7932M USB keyboard.  Under this configuration, the
SETLEDS command in atkbd_probe fails (the first atkbd_sendbyte
in atkbd_command fails), but the keyboard otherwise works if
that failure is ignored.

	I noticed this when my keyboard stopped working in 2.5.32.
I have verified that 2.5.31 (and probably all kernels before it)
also do not set the LEDs on my USB-emulating-PS/2 keyboard.

	I cannot say whether the problem occurs with other USB
keyboards because I don't have one handy.

	One cannot run the USB keyboard "natively" via Linux USB on this
motherboard because the BIOS does not seem to set an IRQ line for the USB
controller.  I've tried booting with "pci=biosirq", and I think I've tried
all the relevant BIOS menu options, and I'm running the latest BIOS,
and the VD133 product has been terminated.  So the patch does seem to be
"necessary" to support some configurations, at least for now.

-- 
Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

[-- Attachment #2: kbd.diff --]
[-- Type: text/plain, Size: 755 bytes --]

--- linux-2.5.33/drivers/input/keyboard/atkbd.c	2002-08-31 15:05:31.000000000 -0700
+++ linux/drivers/input/keyboard/atkbd.c	2002-09-09 06:29:04.000000000 -0700
@@ -359,13 +359,13 @@
 #endif
 
 /*
- * Next we check we can set LEDs on the keyboard. This should work on every
- * keyboard out there. It also turns the LEDs off, which we want anyway.
+ * Turn off LEDs.  This command fails on at least a BTC 7932M USB keyboard
+ * connected to an Iwill VD133 motherboard that is configured to emulate
+ * a PS/2 keyboard via USB.
  */
 
 	param[0] = 0;
-	if (atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS))
-		return -1;
+	atkbd_command(atkbd, param, ATKBD_CMD_SETLEDS);
 
 /*
  * Then we check the keyboard ID. We should get 0xab83 under normal conditions.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-09-11 23:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-09 15:04 Patch?: linux-2.5.33/drivers/input/keyboard/atkbd.c allow SETLEDS to fail Adam J. Richter
2002-09-09 15:20 ` Vojtech Pavlik
2002-09-10 16:05   ` Adam J. Richter
2002-09-10 16:40     ` Vojtech Pavlik
2002-09-11 23:17     ` Horst von Brand
  -- strict thread matches above, loose matches on Subject: below --
2002-09-09 13:51 Adam J. Richter
2002-09-09 14:07 ` Vojtech Pavlik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox