Patchwork timeout during PS/2 keyboard init

login
register
about
Submitter Scott
Date 2010-09-08 23:01:54
Message ID <0984FC1823304EB6BAB26C319C950DD3@m3a78>
Download mbox | patch
Permalink /patch/1892/
State Accepted
Commit r5798
Headers show

Comments

Scott - 2010-09-08 23:01:54
]-----Original Message-----
]From: coreboot-bounces@coreboot.org [mailto:coreboot-bounces@coreboot.org] On Behalf Of Marc Jones
]Sent: Wednesday, September 08, 2010 03:17 PM
]To: Scott Duplichan
]Cc: coreboot@coreboot.org
]Subject: Re: [coreboot] [PATCH] timeout during PS/2 keyboard init
]
]On Wed, Sep 8, 2010 at 1:11 PM, Scott Duplichan <scott@notabs.org> wrote:
]> Thanks Marc. This patch avoids a timeout during PS/2 keyboard
]> initialization. It can reduce KBC init time by up to 400 ms on
]> real hardware, and by a minute or so on AMD simnow.
]>
]>
]> Signed-off-by: Scott Duplichan <scott@notabs.org>
]>
]> Index: src/pc80/keyboard.c
]> ===================================================================
]> --- src/pc80/keyboard.c (revision 5788)
]> +++ src/pc80/keyboard.c (working copy)
]> @@ -242,7 +242,7 @@
]>        outb(0x60, KBD_COMMAND);
]>        if (!kbc_input_buffer_empty()) return;
]>        outb(0x61, KBD_DATA);   /* send cmd: enable keyboard and IRQ 1 */
]> -       if (kbc_output_buffer_full()) {
]> +       if (kbc_input_buffer_empty()) {
]
]
]I think you meant !kbc_input_buffer_empty()?

Good catch. You are correct. While the previous patch avoids the timeout,
it does not correct the reversed check for when to log the error message.
The revised patch below includes the logging fix, in addition to the
timeout avoidance of the original patch.

]Marc
]
]-- 
]http://se-eng.com


Signed-off-by: Scott Duplichan <scott@notabs.org>
Marc Jones - 2010-09-09 20:37:50
On Wed, Sep 8, 2010 at 5:01 PM, Scott Duplichan <scott@notabs.org> wrote:
> ]-----Original Message-----
> ]From: coreboot-bounces@coreboot.org [mailto:coreboot-bounces@coreboot.org] On Behalf Of Marc Jones
> ]Sent: Wednesday, September 08, 2010 03:17 PM
> ]To: Scott Duplichan
> ]Cc: coreboot@coreboot.org
> ]Subject: Re: [coreboot] [PATCH] timeout during PS/2 keyboard init
> ]
> ]On Wed, Sep 8, 2010 at 1:11 PM, Scott Duplichan <scott@notabs.org> wrote:
> ]> Thanks Marc. This patch avoids a timeout during PS/2 keyboard
> ]> initialization. It can reduce KBC init time by up to 400 ms on
> ]> real hardware, and by a minute or so on AMD simnow.
> ]>
> ]>
> ]> Signed-off-by: Scott Duplichan <scott@notabs.org>
> ]>
> ]> Index: src/pc80/keyboard.c
> ]> ===================================================================
> ]> --- src/pc80/keyboard.c (revision 5788)
> ]> +++ src/pc80/keyboard.c (working copy)
> ]> @@ -242,7 +242,7 @@
> ]>        outb(0x60, KBD_COMMAND);
> ]>        if (!kbc_input_buffer_empty()) return;
> ]>        outb(0x61, KBD_DATA);   /* send cmd: enable keyboard and IRQ 1 */
> ]> -       if (kbc_output_buffer_full()) {
> ]> +       if (kbc_input_buffer_empty()) {
> ]
> ]
> ]I think you meant !kbc_input_buffer_empty()?
>
> Good catch. You are correct. While the previous patch avoids the timeout,
> it does not correct the reversed check for when to log the error message.
> The revised patch below includes the logging fix, in addition to the
> timeout avoidance of the original patch.
>
> ]Marc
> ]
> ]--
> ]http://se-eng.com
>
>
> Signed-off-by: Scott Duplichan <scott@notabs.org>
>
> Index: src/pc80/keyboard.c
> ===================================================================
> --- src/pc80/keyboard.c (revision 5788)
> +++ src/pc80/keyboard.c (working copy)
> @@ -242,7 +242,7 @@
>        outb(0x60, KBD_COMMAND);
>        if (!kbc_input_buffer_empty()) return;
>        outb(0x61, KBD_DATA);   /* send cmd: enable keyboard and IRQ 1 */
> -       if (kbc_output_buffer_full()) {
> +       if (!kbc_input_buffer_empty()) {
>                printk(BIOS_ERR, "Timeout during final keyboard enable\n");
>                return;
>        }
>
>

Acked-by: Marc Jones <marcj303@gmail.com>

r5798

Patch

Index: src/pc80/keyboard.c
===================================================================
--- src/pc80/keyboard.c	(revision 5788)
+++ src/pc80/keyboard.c	(working copy)
@@ -242,7 +242,7 @@ 
 	outb(0x60, KBD_COMMAND);
 	if (!kbc_input_buffer_empty()) return;
 	outb(0x61, KBD_DATA);	/* send cmd: enable keyboard and IRQ 1 */
-	if (kbc_output_buffer_full()) {
+	if (!kbc_input_buffer_empty()) {
 		printk(BIOS_ERR, "Timeout during final keyboard enable\n");
 		return;
 	}