All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dale Farnsworth <dale@farnsworth.org>
To: linux-serial@vger.kernel.org
Subject: [PATCH] serial: mpsc: release port lock on call to tty_flip_buffer_push
Date: Mon, 21 Jul 2008 17:03:31 -0700	[thread overview]
Message-ID: <20080722000331.GA9886@farnsworth.org> (raw)

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


             reply	other threads:[~2008-07-22  0:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-22  0:03 Dale Farnsworth [this message]
     [not found] <20080722162119.GA4376@farnsworth.org>
2008-07-22 17:31 ` [PATCH] serial: mpsc: release port lock on call to tty_flip_buffer_push Mark A. Greer

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=20080722000331.GA9886@farnsworth.org \
    --to=dale@farnsworth.org \
    --cc=linux-serial@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 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.