* [PATCH] serial: mpsc: release port lock on call to tty_flip_buffer_push
@ 2008-07-22 0:03 Dale Farnsworth
0 siblings, 0 replies; 2+ messages in thread
From: Dale Farnsworth @ 2008-07-22 0:03 UTC (permalink / raw)
To: linux-serial
We need to release the port lock when we call tty_flip_buffer_push()
to avoid a deadlock when the serial-core routines try to acquire
the same lock. This deadlock has been observed on CONFIG_PREEMPT_RT
configurations.
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
Cc: <mgreer@mvista.com>
---
drivers/serial/mpsc.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c
index c9f53e7..158d748 100644
--- a/drivers/serial/mpsc.c
+++ b/drivers/serial/mpsc.c
@@ -1065,7 +1065,9 @@ next_frame:
if ((readl(pi->sdma_base + SDMA_SDCM) & SDMA_SDCM_ERD) == 0)
mpsc_start_rx(pi);
+ spin_unlock(&pi->port.lock);
tty_flip_buffer_push(tty);
+ spin_lock(&pi->port.lock);
return rc;
}
--
1.5.6
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] serial: mpsc: release port lock on call to tty_flip_buffer_push
[not found] <20080722162119.GA4376@farnsworth.org>
@ 2008-07-22 17:31 ` Mark A. Greer
0 siblings, 0 replies; 2+ messages in thread
From: Mark A. Greer @ 2008-07-22 17:31 UTC (permalink / raw)
To: linux-serial; +Cc: Dale Farnsworth, mgreer
Dale Farnsworth wrote:
>
> We need to release the port lock when we call tty_flip_buffer_push()
> to avoid a deadlock when the serial-core routines try to acquire
> the same lock. This deadlock has been observed on CONFIG_PREEMPT_RT
> configurations.
>
> Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
> Cc: <mgreer@mvista.com>
> ---
> drivers/serial/mpsc.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/serial/mpsc.c b/drivers/serial/mpsc.c
> index c9f53e7..158d748 100644
> --- a/drivers/serial/mpsc.c
> +++ b/drivers/serial/mpsc.c
> @@ -1065,7 +1065,9 @@ next_frame:
> if ((readl(pi->sdma_base + SDMA_SDCM) & SDMA_SDCM_ERD) == 0)
> mpsc_start_rx(pi);
>
> + spin_unlock(&pi->port.lock);
> tty_flip_buffer_push(tty);
> + spin_lock(&pi->port.lock);
> return rc;
> }
Acked-by: Mark A. Greer <mgreer@mvista.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-07-22 18:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-22 0:03 [PATCH] serial: mpsc: release port lock on call to tty_flip_buffer_push Dale Farnsworth
[not found] <20080722162119.GA4376@farnsworth.org>
2008-07-22 17:31 ` Mark A. Greer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.