public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Alan Cox <alan@linux.intel.com>
Cc: greg@kroah.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 04/12] mxser: Use the new locking rules to fix setserial properly
Date: Fri, 20 Nov 2009 14:08:55 +0200	[thread overview]
Message-ID: <20091120120855.GA28630@bicker> (raw)
In-Reply-To: <20091118141516.3346.1769.stgit@localhost.localdomain>

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

  reply	other threads:[~2009-11-20 12:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18 14:14 [PATCH 00/12] Series short description Alan Cox
2009-11-18 14:14 ` [PATCH 01/12] isicom: switch to the new tty_port_open helper Alan Cox
2009-11-18 14:14 ` [PATCH 02/12] isicom: sort out the board init logic Alan Cox
2009-11-18 14:15 ` [PATCH 03/12] mxser: use the tty_port_open method Alan Cox
2009-11-18 14:15 ` [PATCH 04/12] mxser: Use the new locking rules to fix setserial properly Alan Cox
2009-11-20 12:08   ` Dan Carpenter [this message]
2009-11-18 14:15 ` [PATCH 05/12] isicom: fix deadlock on shutdown Alan Cox
2009-11-18 14:15 ` [PATCH 06/12] moxa: Use more tty_port ops Alan Cox
2009-11-18 14:15 ` [PATCH 07/12] moxa: rework the locking a bit Alan Cox
2009-11-18 14:16 ` [PATCH 08/12] Locking clean up Alan Cox
2009-11-18 14:16 ` [PATCH 09/12] moxa: Kill off the throttle method Alan Cox
2009-11-18 14:16 ` [PATCH 10/12] moxa: Fix modem op locking Alan Cox
2009-11-18 14:16 ` [PATCH 11/12] moxa: Kill the use of lock_kernel Alan Cox
2009-11-18 14:17 ` [PATCH 12/12] moxa: split open lock Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091120120855.GA28630@bicker \
    --to=error27@gmail.com \
    --cc=alan@linux.intel.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox