Get KDB to work on the IMB HS20 Blade 8843 platform.
Symptoms: after doing the \eKDB to get into kdb, we would
get stuck in kdba_local_arch_setup(), waiting forever for
the KBD_STAT_OBF status bit to set. The same was true
for the exit processing in kdba_local_arch_cleanup().
Fix: so use code similar to that in kdb_kbdsend() and
change the 'while forever' to a 'timeout for loop' and
give up if the KBD_STAT_OBF bit never appears.
This change lets us drop into and exit kdb sessions on a
Blade 8843.
Note: after dropping into kdb and spending several minutes
in the kdb session (regardless of whether constantly
typing kdb commands, or leaving the session idle), the
Blade's console session will timeout and drop back into the
"system>" prompt, and the blade will need to be reset and
rebooted. This patch does _not_ fix this timeout issue.
However, if you exit the kdb session with a 'go' command
before the timeout occurs, then the system console will
not drop back to the "system>" prompt, and the system will
continue to function properly.
Tested on a IBM HS20 Blade 8843.
Miscellenous comments:
1. In order to get kdb=early to work on a Blade 8843, you
have to use "console=uart,io,0x2f8,19200n" instead of
the usual "console=ttyS0,19200" format. (The early
kdb session does not have the problem where we drop
back into the "system>" prompt.)
2. These code changes were also tested on a non-blade
system to ensure that these code changes function
properly with 'normal' systems.
3. The x86_64 versions of kdba_local_arch_setup() and
kdba_local_arch_cleanup() routines are empty, so no
changes were made for x86_64.
Author: John Blackwood <[EMAIL PROTECTED]>
Signed-off-by: Joe Korty <[EMAIL PROTECTED]>
Index: 2.6.26-rc9/arch/x86/kdb/kdba_io.c
===================================================================
--- 2.6.26-rc9.orig/arch/x86/kdb/kdba_io.c 2008-07-10 12:14:26.000000000
-0400
+++ 2.6.26-rc9/arch/x86/kdb/kdba_io.c 2008-07-10 13:29:22.000000000 -0400
@@ -561,13 +561,15 @@
void kdba_local_arch_setup(void)
{
#ifdef CONFIG_VT_CONSOLE
+ int timeout;
unsigned char c;
while (kbd_read_status() & KBD_STAT_IBF);
kbd_write_command(KBD_CCMD_READ_MODE);
mdelay(1);
while (kbd_read_status() & KBD_STAT_IBF);
- while ( !(kbd_read_status() & KBD_STAT_OBF) );
+ for (timeout = 200 * 1000; timeout &&
+ (!(kbd_read_status() & KBD_STAT_OBF)); timeout--);
c = kbd_read_input();
c &= ~KBD_MODE_KBD_INT;
while (kbd_read_status() & KBD_STAT_IBF);
@@ -584,13 +586,15 @@
void kdba_local_arch_cleanup(void)
{
#ifdef CONFIG_VT_CONSOLE
+ int timeout;
unsigned char c;
while (kbd_read_status() & KBD_STAT_IBF);
kbd_write_command(KBD_CCMD_READ_MODE);
mdelay(1);
while (kbd_read_status() & KBD_STAT_IBF);
- while ( !(kbd_read_status() & KBD_STAT_OBF) );
+ for (timeout = 200 * 1000; timeout &&
+ (!(kbd_read_status() & KBD_STAT_OBF)); timeout--);
c = kbd_read_input();
c |= KBD_MODE_KBD_INT;
while (kbd_read_status() & KBD_STAT_IBF);
---------------------------
Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.