Update kdb patches.
authorAndreas Schwab <schwab@suse.de>
Tue, 8 Aug 2006 09:57:04 +0000 (09:57 +0000)
committerAndreas Schwab <schwab@suse.de>
Tue, 8 Aug 2006 09:57:04 +0000 (09:57 +0000)
suse-commit: 85b4841dc3f0eccf73438f093e4e62ec5fd6fff4

drivers/serial/8250.c
include/linux/kdb.h
kdb/ChangeLog
kdb/kdbmain.c
kdb/modules/kdbm_vm.c

index ce18782..0354947 100644 (file)
@@ -45,8 +45,8 @@
 #include <asm/irq.h>
 
 #include "8250.h"
-#ifdef CONFIG_KDB
 #include <linux/kdb.h>
+#ifdef CONFIG_KDB
 /*
  * kdb_serial_line records the serial line number of the first serial console.
  * NOTE: The kernel ignores characters on the serial line unless a user space
@@ -1205,7 +1205,9 @@ receive_chars(struct uart_8250_port *up, int *status, struct pt_regs *regs)
                if ((up->port.line == kdb_serial_line) && kdb_on == 1) {
                    if (ch == *kdb_serial_ptr) {
                        if (!(*++kdb_serial_ptr)) {
+                           atomic_inc(&kdb_8250);
                            kdb(KDB_REASON_KEYBOARD, 0, regs);
+                           atomic_dec(&kdb_8250);
                            kdb_serial_ptr = kdb_serial_str;
                            break;
                        }
@@ -2286,7 +2288,7 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count)
        if (up->port.sysrq) {
                /* serial8250_handle_port() already took the lock */
                locked = 0;
-       } else if (oops_in_progress) {
+       } else if (oops_in_progress || KDB_8250()) {
                locked = spin_trylock(&up->port.lock);
        } else
                spin_lock(&up->port.lock);
index e039ea4..098145c 100644 (file)
@@ -34,12 +34,15 @@ extern int kdb_putuserarea_size(unsigned long, void *, size_t);
  * number whenever the kernel debugger is entered.
  */
 extern volatile int kdb_initial_cpu;
+extern atomic_t kdb_event;
+extern atomic_t kdb_8250;
 #ifdef CONFIG_KDB
 #define KDB_IS_RUNNING() (kdb_initial_cpu != -1)
+#define KDB_8250() (atomic_read(&kdb_8250) != 0)
 #else
 #define KDB_IS_RUNNING() (0)
+#define KDB_8250() (0)
 #endif /* CONFIG_KDB */
-extern atomic_t kdb_event;
 
 /*
  * kdb_on
index c987c4a..41b1f97 100644 (file)
@@ -1,3 +1,17 @@
+2006-08-04 Keith Owens  <kaos@sgi.com>
+
+       * kdb v4.4-2.6.18-rc3-common-1.
+
+2006-07-18 Keith Owens  <kaos@sgi.com>
+
+       * 8250.c locking has been fixed so there is no need to break spinlocks
+         for keyboard entry.
+       * kdb v4.4-2.6.18-rc2-common-2.
+
+2006-07-18 Keith Owens  <kaos@sgi.com>
+
+       * kdb v4.4-2.6.18-rc2-common-1.
+
 2006-07-12 Keith Owens  <kaos@sgi.com>
 
        * Remove dead KDB_REASON codes.
index e6d6c71..44d33de 100644 (file)
@@ -50,6 +50,7 @@
  */
 volatile int kdb_flags;
 atomic_t kdb_event;
+atomic_t kdb_8250;
 
 /*
  * kdb_lock protects updates to kdb_initial_cpu.  Used to
@@ -1724,9 +1725,6 @@ kdb(kdb_reason_t reason, int error, struct pt_regs *regs)
        case KDB_REASON_NMI:
                KDB_FLAG_SET(CATASTROPHIC);     /* kernel state is dubious now */
                break;
-       case KDB_REASON_KEYBOARD:
-               bust_spinlocks(1);
-               break;
        default:
                break;
        }
index 9c254cd..b5d5f2e 100644 (file)
@@ -783,15 +783,14 @@ kdbm_sc(int argc, const char **argv, const char **envp, struct pt_regs *regs)
                   sc->device, sc->list.next, sc->done);
        kdb_printf("serial_number = %ld  retries = %d\n",
                   sc->serial_number, sc->retries);
-       kdb_printf("cmd_len = %d\n",
-                  sc->cmd_len);
+       kdb_printf("cmd_len = %d\n", sc->cmd_len);
        kdb_printf("cmnd = [%2.2x/%2.2x/%2.2x/%2.2x/%2.2x/%2.2x/%2.2x/%2.2x/%2.2x/%2.2x/%2.2x/%2.2x]\n",
                   sc->cmnd[0], sc->cmnd[1], sc->cmnd[2], sc->cmnd[3], sc->cmnd[4],
                   sc->cmnd[5], sc->cmnd[6], sc->cmnd[7], sc->cmnd[8], sc->cmnd[9],
                   sc->cmnd[10], sc->cmnd[11]);
        kdb_printf("request_buffer = 0x%p  request_bufflen = %d\n",
                   sc->request_buffer, sc->request_bufflen);
-       kdb_printf("use_sg = %d sglist_len = %d\n",
+       kdb_printf("use_sg = %d  sglist_len = %d\n",
                   sc->use_sg, sc->sglist_len);
        kdb_printf("underflow = %d transfersize = %d\n",
                   sc->underflow, sc->transfersize);