lkml.org 
[lkml]   [2009]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 04/12] mxser: Use the new locking rules to fix setserial properly
On Wed, Nov 18, 2009 at 02:15:23PM +0000, Alan Cox wrote:
> Propogate the init/shutdown mutex through the setserial logic. Use the proper
> locks for the various bits still using the BKL. Kill the BKL in this driver.

> drivers/char/mxser.c | 145 +++++++++++++++++++++++++++-----------------------

> @@ -1951,6 +1959,7 @@ static void mxser_wait_until_sent(struct tty_struct *tty, int timeout)

> + spin_lock_irqsave(&info->slock, flags);
> while (!((lsr = inb(info->ioaddr + UART_LSR)) & UART_LSR_TEMT)) {
> #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT
> printk("lsr = %d (jiff=%lu)...", lsr, jiffies);
> #endif
> + spin_unlock_irqrestore(&info->slock, flags);
> schedule_timeout_interruptible(char_time);
> if (signal_pending(current))
> break;
> if (timeout && time_after(jiffies, orig_jiffies + timeout))
> break;

If we break out of this while loop we get a double unlock.

> + spin_lock_irqsave(&info->slock, flags);
> }
> + spin_unlock_irqrestore(&info->slock, flags);
> set_current_state(TASK_RUNNING);
> - unlock_kernel();

regards,
dan carpenter


\
 
 \ /
  Last update: 2009-11-20 13:19    [from the cache]
©2003-2011 Jasper Spaans