Skip to contentSkip to conversation

serial: mpsc: release port lock on call to tty_flip_buffer_push

PATCH Mark A. Greer 1 participant 1 message Jul 22, 2008 1 message not in the archive TTY layer and serial drivers

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Mark A. Greer

author Acked-by
#1 lore raw
Quoted 17 lines · Dale Farnsworth

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.

---
 drivers/serial/mpsc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/serial/mpsc.c +0 -0
index c9f53e7..158d748 100644

drivers/serial/mpsc.c next_frame: · line 1072

Quoted 8 lines
drivers/serial/mpsc.c +2 -0
@@ -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;
 }