mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Thalmeier <michael.thalmeier@hale.at>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: rt <linux-rt-users@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	Michael Thalmeier <michael@thalmeier.at>
Subject: [PATCH] USB: g_serial: fix deadlock with PREEMPT_RT enabled
Date: Fri, 28 Oct 2011 14:16:25 +0200	[thread overview]
Message-ID: <1319804185-18559-1-git-send-email-michael.thalmeier@hale.at> (raw)

In commit 44a0c0190b500ee6bcfc0976fe540f65dee2cd67 unlocking of spin_locks has
been removed. This patch party restores this functionality.

Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>
---
 drivers/usb/gadget/u_serial.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
index 40f7716..a925b9e 100644
--- a/drivers/usb/gadget/u_serial.c
+++ b/drivers/usb/gadget/u_serial.c
@@ -553,7 +553,16 @@ recycle:
 	 * a workqueue, so we won't get callbacks and can hold port_lock
 	 */
 	if (tty && do_push) {
+		/*
+		 * Drop the lock here since it might end up calling
+		 * gs_flush_chars, which takes the lock.
+		 */
+		spin_unlock_irq(&port->port_lock);
 		tty_flip_buffer_push(tty);
+		spin_lock_irq(&port->port_lock);
+
+		/* tty may have been closed */
+		tty = port->port_tty;
 	}
 
 
-- 
1.7.6.4



--
Scanned by MailScanner.


             reply	other threads:[~2011-10-28 12:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 12:16 Michael Thalmeier [this message]
2011-10-28 12:28 ` Michael Thalmeier

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=1319804185-18559-1-git-send-email-michael.thalmeier@hale.at \
    --to=michael.thalmeier@hale.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=michael@thalmeier.at \
    --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

all inboxes | Powered by JetHome®