[PATCH] serial: mpsc: release port lock on call to tty_flip_buffer_push

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
Cc: <mgreer@xxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux