Re: 2.6.0-test11-mm1

From: Paul Mackerras
Date: Wed Dec 17 2003 - 19:02:54 EST


Andrew Morton writes:

> Diego Calleja García <aradorlinux@xxxxxxxx> wrote:
>
> > local_bh_enable() was called in hard irq context. This is probably a bug
> > Call Trace:
> > [<c0127b96>] local_bh_enable+0x96/0xa0
> > [<e08fc4d8>] ppp_asynctty_receive+0x78/0xd0 [ppp_async]
> > [<c01cec6c>] flush_to_ldisc+0xdc/0x130
> > [<c01ecc17>] receive_chars+0x227/0x240
> > [<c01eccd5>] transmit_chars+0xa5/0xe0
> > [<c01ecf7c>] serial8250_interrupt+0x12c/0x130
> > [<c010c9f9>] handle_IRQ_event+0x49/0x80
> > [<c010cdc8>] do_IRQ+0xb8/0x180
> > [<c02ca760>] common_interrupt+0x18/0x20
>
>
> ppp_asynctty_receive() is called from hard IRQ context and hence may not use
> spin_unlock_bh(). The patch converts ppp to use an IRQ-safe spinlock.

... which only pushes the problem down one level, since
ppp_async_input eventually calls ppp_input with interrupts disabled,
which is not allowed. The reason that it isn't allowed is that it
would mean that the ppp_generic code would have to disable interrupts
in its critical sections, which would be very bad for interrupt
latency, particularly if you are using compression or encryption on
the link.

Given the number of serial drivers that want to call the line
discipline receive_chars routine with interrupts hard-disabled, I
would consider a patch to ppp_async.c to make it use a tasklet so that
it calls ppp_input from softirq level. But the currently proposed
patch is buggy.

Regards,
Paul.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/