Convert serial_core oopses to BUG_ON
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 5 lines
With reference to these two bugs:
http://bugzilla.kernel.org/show_bug.cgi?id=5958 http://bugzilla.kernel.org/show_bug.cgi?id=6131
Quoted 8 lines
it seems that folk are under the impression that
serial_coreis responsible for these bugs. It isn't.Calling serial functions to flush buffers, or try to send more data after the port has been closed or hung up is a bug in the code doing the calling, not in the
serial_coredriver.Make this explicitly obvious by adding BUG_ON()'s.
They did not trigger for me, altrough my own traps do.
Quoted 7 lines
drivers/serial/serial_core.c +0
-0@@ -521,6 +532,12 @@ static void uart_flush_buffer(struct ttystruct uart_port *port = state->port;unsigned long flags;
drivers/serial/serial_core.c static void uart_flush_buffer(struct tty · line 543
Quoted 10 lines
drivers/serial/serial_core.c +6
-0+/* +* This means you called this function _after_ the port was +* closed. No cookie for you. +*/ +BUG_ON (!state); +DPRINTK ("uart_flush_buffer(%d) called\n" , tty->index);spin_lock_irqsave (&port->lock, flags);
This is one I'm hitting. Actually I'm hitting my own check few lines down:
if (!state->info)
printk(KERN_CRIT "no state->info\n");
else uart_circ_clear(&state->info->xmit);
spin_unlock_irqrestore(&port->lock, flags);
tty_wakeup(tty);... simply not doing uart_circ_clear() at all makes system survive... so this could be made into WARN()...
Pavel
Signature · 1 line
Web maintainer for suspend.sf.net (www.sf.net/projects/suspend) wanted...