From: "Grant Likely" <grant.likely@secretlab.ca>
To: "Thomas Gleixner" <tglx@linutronix.de>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: [PATCH] mpx5200_uart: drop port lock across tty_flip_buffer() call
Date: Wed, 25 Jul 2007 13:42:36 -0600 [thread overview]
Message-ID: <fa686aa40707251242i6be0e30pd3b4019686308b0@mail.gmail.com> (raw)
In-Reply-To: <1185390656.3227.12.camel@chaos>
On 7/25/07, Thomas Gleixner <tglx@linutronix.de> wrote:
> The port lock needs to be dropped across the tty_flip_buffer call, as it
> would lead to a deadlock with the spin_lock(&port->lock) in uart_start()
>
> Uncovered by lockdep / preempt-rt
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Instead of dropping the lock and reclaiming it, would it be better for
me to rework the driver to only grab the lock in the 'meat' of
mpc52xx_uart_int_rx_chars() and mpc52xx_uart_int_tx_chars()? (As
opposed to holding the lock for the entirety of mpc52xx_uart_int())
What convention is used in other drivers?
Cheers,
g.
>
>
> Index: linux-2.6.22/drivers/serial/mpc52xx_uart.c
> ===================================================================
> --- linux-2.6.22.orig/drivers/serial/mpc52xx_uart.c 2007-07-09 01:32:17.000000000 +0200
> +++ linux-2.6.22/drivers/serial/mpc52xx_uart.c 2007-07-25 21:06:11.000000000 +0200
> @@ -501,7 +501,9 @@ mpc52xx_uart_int_rx_chars(struct uart_po
> }
> }
>
> + spin_unlock(&port->lock);
> tty_flip_buffer_push(tty);
> + spin_lock(&port->lock);
>
> return in_be16(&PSC(port)->mpc52xx_psc_status) & MPC52xx_PSC_SR_RXRDY;
> }
>
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
next prev parent reply other threads:[~2007-07-25 19:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-25 19:10 [PATCH] mpx5200_uart: drop port lock across tty_flip_buffer() call Thomas Gleixner
2007-07-25 19:42 ` Grant Likely [this message]
2007-07-25 19:47 ` Thomas Gleixner
2007-07-25 19:54 ` Grant Likely
2007-07-26 9:25 ` Daniel Schnell
2007-07-26 9:41 ` Thomas Gleixner
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=fa686aa40707251242i6be0e30pd3b4019686308b0@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=linuxppc-embedded@ozlabs.org \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).