Skip to contentSkip to conversation

AT Keyboard not present?

Linux-ia64 KOCHI Takayoshi 9 participants 16 messages Sep 7, 2001 – Sep 21, 2001 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

Recently I noticed

keyboard: Timeout - AT keyboard not present?

message appears when the kernel tries to control keyboard LEDs (i.e. CAPS, NumLock, ScrLock).
I don't see any symptoms in X environment, this is only at VGA console. I remember this was the behavior of ia64 linux of very early days, but fixed at some point.

Does someone have ideas?

Regards,

Signature · 1 line
KOCHI Takayoshi <[email protected]/[email protected]>
#1 lore raw
Quoted 3 lines · KOCHI Takayoshi

Recently I noticed

keyboard: Timeout - AT keyboard not present?

I guess this happens because you are using a USB keyboard and the kernel looks for a PS/2 keyboard. New machines from Dell ship with a USB keyboard by default. Till the USB modules are loaded, I see this error (once or twice). Once the USB modules are loaded, this message disappears. Is there any way to prevent this happening ? I saw that when using RedHat's kernel, this message doesn't show up. What do I need to suppress this message if I have a USB keyboard ?

-kitty.

Signature · 2 lines
Krishnakumar B <kitty at cs dot wustl dot edu>
Distributed Object Computing Laboratory, Washington University in St.Louis
#2 lore raw
In reply to KOCHI Takayoshi
Quoted 5 lines · Krishnakumar B
Quoted 3 lines · KOCHI Takayoshi

Recently I noticed

keyboard: Timeout - AT keyboard not present?

Quoted 7 lines

I guess this happens because you are using a USB keyboard and the kernel looks for a PS/2 keyboard. New machines from Dell ship with a USB keyboard by default. Till the USB modules are loaded, I see this error (once or twice). Once the USB modules are loaded, this message disappears. Is there any way to prevent this happening ? I saw that when using RedHat's kernel, this message doesn't show up. What do I need to suppress this message if I have a USB keyboard ?

The only way to supress the message is to hack it out of the kernel.

The message comes from the fact the BIOS does legacy device emulation for USB keyboards and mice. I think the ia64 BIOS supports this as well. However, the emulation isn't perfect and will cause messages like this.

When the HC driver loads, it turns this off and natively handles the USB keyboard.

The real fix is to use USB drivers as early as possible. The emulation wasn't designed to be perfect.

JE

#3 lore raw
In reply to KOCHI Takayoshi
Quoted 11 lines · Johannes Erdfelt

The only way to supress the message is to hack it out of the kernel.

The message comes from the fact the BIOS does legacy device emulation for USB keyboards and mice. I think the ia64 BIOS supports this as well. However, the emulation isn't perfect and will cause messages like this.

When the HC driver loads, it turns this off and natively handles the USB keyboard.

The real fix is to use USB drivers as early as possible.

How does one do this ? Can it be loaded via initrd ? I got some symbol referencing errors while doing this. Then the uhci module was loaded as usual when booting and this time there were no symbol referencing errors.

-kitty.

Signature · 2 lines
Krishnakumar B <kitty at cs dot wustl dot edu>
Distributed Object Computing Laboratory, Washington University in St.Louis
#4 lore raw
In reply to KOCHI Takayoshi
Quoted 8 lines · Krishnakumar B
Quoted 7 lines · Johannes Erdfelt

The only way to supress the message is to hack it out of the kernel.

The message comes from the fact the BIOS does legacy device emulation for USB keyboards and mice. I think the ia64 BIOS supports this as well. However, the emulation isn't perfect and will cause messages like this.

Quoted 8 lines
Quoted 4 lines

When the HC driver loads, it turns this off and natively handles the USB keyboard.

The real fix is to use USB drivers as early as possible.

How does one do this ? Can it be loaded via initrd ? I got some symbol referencing errors while doing this. Then the uhci module was loaded as usual when booting and this time there were no symbol referencing errors.

There should be no reason it can't be loaded via initrd.

Any symbol problems would most likely be a problem with the distribution you are using.

JE

#5 lore raw
In reply to KOCHI Takayoshi

The problem gets worse when you do not have a PS2 controller on the machine at all. Kernel spews out a screenful of this message as it boots up. An easy way to get rid of these messages is to undefine KBD_REPORT_TIMEOUTS in pc_keyb.h. This still does not get rid of the delays caused by the timeouts. If I could figure out a way to reliably determine if the PS2 controller exists or not, I would like to get rid of the delays as well.

--
Khalid

Quoted 33 lines · Johannes Erdfelt
Quoted 5 lines · Krishnakumar B
Quoted 3 lines · KOCHI Takayoshi

Recently I noticed

keyboard: Timeout - AT keyboard not present?

Quoted 7 lines

I guess this happens because you are using a USB keyboard and the kernel looks for a PS/2 keyboard. New machines from Dell ship with a USB keyboard by default. Till the USB modules are loaded, I see this error (once or twice). Once the USB modules are loaded, this message disappears. Is there any way to prevent this happening ? I saw that when using RedHat's kernel, this message doesn't show up. What do I need to suppress this message if I have a USB keyboard ?

The only way to supress the message is to hack it out of the kernel.

The message comes from the fact the BIOS does legacy device emulation for USB keyboards and mice. I think the ia64 BIOS supports this as well. However, the emulation isn't perfect and will cause messages like this.

When the HC driver loads, it turns this off and natively handles the USB keyboard.

The real fix is to use USB drivers as early as possible. The emulation wasn't designed to be perfect.

JE

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64

Signature · 4 lines
==================================
Khalid Aziz                              Linux Systems Operation R&D
(970)898-9214                                        Hewlett-Packard
[email protected]                                    Fort Collins, CO
#6 lore raw
In reply to KOCHI Takayoshi

Sorry, I didn't include the configuration of my machine.

It was a BigSur with a PS/2 keyboard and a PS/2 mouse. I didn't configure usb driver in the kernel nor load as a module.

Quoted 5 lines · On Fri, 7 Sep 2001 14:05:52 -0500 Krishnakumar B <[email protected]> wrote:
Quoted 3 lines · KOCHI Takayoshi

Recently I noticed

keyboard: Timeout - AT keyboard not present?

Quoted 7 lines

I guess this happens because you are using a USB keyboard and the kernel looks for a PS/2 keyboard. New machines from Dell ship with a USB keyboard by default. Till the USB modules are loaded, I see this error (once or twice). Once the USB modules are loaded, this message disappears. Is there any way to prevent this happening ? I saw that when using RedHat's kernel, this message doesn't show up. What do I need to suppress this message if I have a USB keyboard ?

Regards,

Signature · 1 line
KOCHI Takayoshi <[email protected]/[email protected]>
#7 lore raw
In reply to KOCHI Takayoshi
Quoted 3 lines · KOCHI Takayoshi

It was a BigSur with a PS/2 keyboard and a PS/2 mouse. I didn't configure usb driver in the kernel nor load as a module.

I have the same here with no USB on the machine at all. I think I had it since 2.4.7. The keyboard works fine, though - obviously timeouts occur randomly but usually the keyboard answers requests just fine.

Martin

Signature · 4 lines
Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1	    mailto:[email protected]
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy
#8 lore raw
In reply to KOCHI Takayoshi

I can verify this on my BigSur as well. No USB peripherals and no modules loaded. Hitting the CAPS lock key causes the message and a delay. The keyboard LED never comes on. This machine was recently upgraded to BIOS 117, and also to kernel 2.4.9.

Quoted 24 lines · Martin Wilck
Quoted 3 lines · KOCHI Takayoshi

It was a BigSur with a PS/2 keyboard and a PS/2 mouse. I didn't configure usb driver in the kernel nor load as a module.

I have the same here with no USB on the machine at all. I think I had it since 2.4.7. The keyboard works fine, though - obviously timeouts occur randomly but usually the keyboard answers requests just fine.

Martin

--

Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1        mailto:[email protected]
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64

#9 lore raw
In reply to KOCHI Takayoshi

Same test also fails in 2.4.7 ... I found a 2.4.3 kernel still in my /boot/efi, capslock test works with that.

In 2.4.7/2.4.9 even though the caps-lock light never comes on and the timeout message is printed, caps lock mode *is* turned on (subsequent alphabetic chars echo in upper-case).

-Tony

-----Original Message-----
From: Michael Madore [mailto:[email protected]]
Sent: Monday, September 10, 2001 2:43 PM
To: Martin Wilck
Cc: KOCHI Takayoshi; [email protected]
Subject: Re: [Linux-ia64] AT Keyboard not present?

I can verify this on my BigSur as well. No USB peripherals and no modules loaded. Hitting the CAPS lock key causes the message and a delay. The keyboard LED never comes on. This machine was recently upgraded to BIOS 117, and also to kernel 2.4.9.

Quoted 20 lines · Martin Wilck
Quoted 3 lines · KOCHI Takayoshi

It was a BigSur with a PS/2 keyboard and a PS/2 mouse. I didn't configure usb driver in the kernel nor load as a module.

I have the same here with no USB on the machine at all. I think I had it since 2.4.7. The keyboard works fine, though - obviously timeouts occur randomly but usually the keyboard answers requests just fine.

Martin

--

Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1        mailto:[email protected]
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy
Quoted 4 lines

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64

_______________________________________________
Linux-IA64 mailing list
[email protected]
http://lists.linuxia64.org/lists/listinfo/linux-ia64

#10 lore raw
In reply to KOCHI Takayoshi
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Tony

tony> Same test also fails in 2.4.7 ... I found a 2.4.3 kernel still tony> in my /boot/efi, capslock test works with that.

tony> In 2.4.7/2.4.9 even though the caps-lock light never comes on tony> and the timeout message is printed, caps lock mode *is* turned tony> on (subsequent alphabetic chars echo in upper-case).

I suspect the problem was introduced in 2.4.7 (or thereabouts) when the keyboard interface was changed. I didn't notice it until a few days ago because it only happens when working at the Linux console. While it's not a fatal problem, it would be good if it were fixed. A patch would be welcome.

	--david
#11 lore raw
In reply to KOCHI Takayoshi
Quoted 11 lines · KOCHI Takayoshi

Recently I noticed

keyboard: Timeout - AT keyboard not present?

message appears when the kernel tries to control keyboard LEDs (i.e. CAPS, NumLock, ScrLock).
I don't see any symptoms in X environment, this is only at VGA console. I remember this was the behavior of ia64 linux of very early days, but fixed at some point.

Does someone have ideas?

The following patch fixes this for me. It seems that after the SET_LEDS command is written, the keyboard sets it's status bit to say the acknowledge is available, but never generates an interrupt. Or maybe it does generate the interrupt and somehow it gets cleared without the keyboard driver being called.

Richard

drivers/char/pc_keyb.c +13 -0
@@ -512,6 +512,19 @@
 		reply_expected = 1;
 		kbd_write_output_w(data);
 		for (;;) {
+#ifdef __ia64__
+			/* On my ia64 box, at least, we don't always get an int
+			 * from the k/b when the acknowledge is available, so
+			 * do a manual status check.  Interrupts are enabled
+			 * (jiffies changes, at least).
+			 * Richard Hirst <[email protected]>
+			 */
+			unsigned long flags;
+
+			spin_lock_irqsave(&kbd_controller_lock, flags);
+			handle_kbd_event();
+			spin_unlock_irqrestore(&kbd_controller_lock, flags);
+#endif
 			if (acknowledge)
 				return 1;
 			if (resend)
#12 lore raw
In reply to KOCHI Takayoshi
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Richard Hirst

Richard> The following patch fixes this for me. It seems that after Richard> the SET_LEDS command is written, the keyboard sets it's Richard> status bit to say the acknowledge is available, but never Richard> generates an interrupt. Or maybe it does generate the Richard> interrupt and somehow it gets cleared without the keyboard Richard> driver being called.

Glad to see you're making progress on this, but the patch looks suspicious to me. There shouldn't be anything ia64 specific in this code. It would be good to understand why the keyboard interrupt gets lost.

	--david
#13 lore raw
In reply to KOCHI Takayoshi
Quoted 4 lines · David Mosberger

Glad to see you're making progress on this, but the patch looks suspicious to me. There shouldn't be anything ia64 specific in this code. It would be good to understand why the keyboard interrupt gets lost.

I agree, this patch is most likely just masking the real problem.

Richard

#14 lore raw
In reply to KOCHI Takayoshi
Quoted 4 lines · David Mosberger

Glad to see you're making progress on this, but the patch looks suspicious to me. There shouldn't be anything ia64 specific in this code. It would be good to understand why the keyboard interrupt gets lost.

Turns out the interrupt isn't lost, it is just held off until the previous one has been completely serviced...

User hits CapsLock

CPU enters arch/ia64/kernel/irq_ia64.c:ia64_handle_irq()

which calls arch/ia64/kernel/irq.c:do_IRQ()

which calls the kb interrupt handler

and then do_IRQ() sees local_softirq_pending() and calls do_softirq()

that will run the keyboard tasklet, which calls
drivers/char/pc_keyb.c:pckbd_leds()

pckbd_leds() calls send_data() which expects the kb to generate interrupts

those interrupts can't happen because we havn't yet returned to ia64_handle_irq() and called ia64_eoi() for the last one

eventually send_data() gives up and returns, we unwind and call ia64_eio() and the keyboard interrupts.

I'm guessing that ia64_eoi() is needed before the next k/b int can happen, but it sounds logical.

The answer _might_ be to move the call to do_softirq() from the end of do_IRQ() to the end of ia64_handle_irq(). I've tried that, and it works, but I don't claim to know the ia64 interrupt h/w or s/w, so there may be nasty side-effects. Calling do_softirq() only once all pending ints have been completely serviced sounds more correct to me anyway.

Richard

#15 lore raw
In reply to KOCHI Takayoshi

Hi Richard,

Some good hunting!

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · Richard Hirst

Richard> Turns out the interrupt isn't lost, it is just held off Richard> until the previous one has been completely serviced...

  Richard>   User hits CapsLock
  Richard>   CPU enters arch/ia64/kernel/irq_ia64.c:ia64_handle_irq()
  Richard>   which calls arch/ia64/kernel/irq.c:do_IRQ()
  Richard>   which calls the kb interrupt handler
  Richard>   and then do_IRQ() sees local_softirq_pending() and calls

Richard> do_softirq()
Richard> that will run the keyboard tasklet, which calls
Richard> drivers/char/pc_keyb.c:pckbd_leds()
Richard> pckbd_leds() calls send_data() which expects the kb to
Richard> generate interrupts
Richard> those interrupts can't happen because we havn't yet
Richard> returned to ia64_handle_irq() and called ia64_eoi() for the Richard> last one
Richard> eventually send_data() gives up and returns, we unwind and Richard> call ia64_eio() and the keyboard interrupts.

Ah, yes, this makes tons of sense.

Richard> I'm guessing that ia64_eoi() is needed before the next k/b Richard> int can happen, but it sounds logical.

Yes, that's what we used to do until the softirq-rewrite happened in 2.4.7.

Richard> The answer _might_ be to move the call to do_softirq() from Richard> the end of do_IRQ() to the end of ia64_handle_irq(). I've Richard> tried that, and it works, but I don't claim to know the Richard> ia64 interrupt h/w or s/w, so there may be nasty Richard> side-effects. Calling do_softirq() only once all pending Richard> ints have been completely serviced sounds more correct to Richard> me anyway.

That's probably the best thing to do for now. For 2.5, the idea is to have a single, platform-independent irq.c and for this reason, I'm trying to keep the ia64 version as close to the x86 version as possible. But this obviously is something that needs to be changed.

Thanks,

	--david