lkml.org 
[lkml]   [2008]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    SubjectRe: [lockdep warning] INFO: inconsistent lock state, serial8250_interrupt(), &port_lock_key
    From
    On Wed, Jul 23, 2008 at 11:36:04AM +0200, Ingo Molnar wrote:
    >
    > * Ingo Molnar <mingo@elte.hu> wrote:
    >
    > > =================================
    > > [ INFO: inconsistent lock state ]
    > > 2.6.26-tip-06509-gb4ebc67-dirty #13600
    > > ---------------------------------
    >
    > the upstream component of that is: v2.6.26-6077-gc010b2f
    >
    > i.e. my suspicion is that this got introduced via the recent tty
    > changes.

    Hi,

    i hit the same warning here. How about the following fix (this is at least what
    i think happens):
    --

    serial8250_startup() might unconditionally enable irqs after releasing
    &up->port.lock while we're still servicing an interrupt.

    Signed-off-by: Borislav Petkov <petkovbb@gmail.com>

    --
    diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
    index 27f34a9..55eca08 100644
    --- a/drivers/serial/8250.c
    +++ b/drivers/serial/8250.c
    @@ -1874,7 +1874,7 @@ static int serial8250_startup(struct uart_port *port)
    * the interrupt is enabled. Delays are necessary to
    * allow register changes to become visible.
    */
    - spin_lock(&up->port.lock);
    + spin_lock_irqsave(&up->port.lock, flags);
    if (up->port.flags & UPF_SHARE_IRQ)
    disable_irq_nosync(up->port.irq);

    @@ -1890,7 +1890,7 @@ static int serial8250_startup(struct uart_port *port)

    if (up->port.flags & UPF_SHARE_IRQ)
    enable_irq(up->port.irq);
    - spin_unlock(&up->port.lock);
    + spin_unlock_irqrestore(&up->port.lock, flags);

    /*
    * If the interrupt is not reasserted, setup a timer to
    --
    Regards/Gruß,
    Boris.
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2008-07-24 08:55    [W:0.029 / U:0.424 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site