kdb
[Top] [All Lists]

[PATCH 2] kdb-fixups-lockdep

To: kdb@xxxxxxxxxxx
Subject: [PATCH 2] kdb-fixups-lockdep
From: Joe Korty <joe.korty@xxxxxxxx>
Date: Mon, 12 Oct 2009 11:20:23 -0400
Reply-to: Joe Korty <joe.korty@xxxxxxxx>
User-agent: Mutt/1.4.2.1i
Make kdb CONFIG_LOCKDEP friendly.

Use of a serial line console with kdb and lockdep enabled
generates lots of lockdep warnings on kdb/entry edit.

So fix the circular locking dependency between the
kdb_printf and the 8250's port->lock, by suppressing all
use of port->lock by the 8250 serial driver when kdb_printf
is active.

This means that the allowed locking direction is:
        port->lock ---> kdb_printf_lock

Signed-off-by: Joe Korty <joe.korty@xxxxxxxx>

Index: 2.6.31.3-kdb/kdb/kdb_io.c
===================================================================
--- 2.6.31.3-kdb.orig/kdb/kdb_io.c      2009-10-12 11:05:01.000000000 -0400
+++ 2.6.31.3-kdb/kdb/kdb_io.c   2009-10-12 11:06:50.000000000 -0400
@@ -540,6 +540,7 @@
        } else {
                __acquire(kdb_printf_lock);
        }
+       atomic_inc(&kdb_8250);
 
        diag = kdbgetintenv("LINES", &linecount);
        if (diag || linecount <= 1)
@@ -774,6 +775,7 @@
        if (logging) {
                console_loglevel = saved_loglevel;
        }
+       atomic_dec(&kdb_8250);
        if (KDB_STATE(PRINTF_LOCK) && got_printf_lock) {
                got_printf_lock = 0;
                spin_unlock_irqrestore(&kdb_printf_lock, flags);

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 2] kdb-fixups-lockdep, Joe Korty <=