Re: [PATCH] drivers/char/riscom8.c: cli/sti removal

From: Francois Romieu (romieu@fr.zoreil.com)
Date: Wed Jul 30 2003 - 14:05:50 EST


Felipe W Damasio <felipewd@terra.com.br> :
[cli+restore/spinlock conversioni for riscom8]
> --- linux-2.6.0-test2/drivers/char/riscom8.c.orig Wed Jul 30 14:39:11 2003
> +++ linux-2.6.0-test2/drivers/char/riscom8.c Wed Jul 30 14:42:44 2003
[...]
> @@ -1084,7 +1090,7 @@
> if (!port || rc_paranoia_check(port, tty->name, "close"))
> return;
>
> - save_flags(flags); cli();
> + spin_lock_irqsave(&rc_lock, flags);
> if (tty_hung_up_p(filp))
> goto out;
>

   1111 tty->closing = 1;
   1112 if (port->closing_wait != ASYNC_CLOSING_WAIT_NONE)
   1113 tty_wait_until_sent(tty, port->closing_wait);
                        ^^^^^^^^^^^^^^^^^^^ -> may sleep
[...]
   1132 while(port->IER & IER_TXEMPTY) {
   1133 current->state = TASK_INTERRUPTIBLE;
   1134 schedule_timeout(port->timeout);
                                ^^^^^^^^^^^^^^^^ -> <blink>BOOM</blink>

If you haven't read Documentation/DocBook/kernel-locking.tmpl, please give
it a try. If you have, well, double-check your code.

Regards

--
Ueimor
-
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/



This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:46 EST