From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Alex Nixon <alex.nixon@citrix.com>,
Jeremy Fitzhardinge <jeremy@goop.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Spinlock recursion in hvc_poll
Date: Thu, 7 Aug 2008 09:18:34 +0200 [thread overview]
Message-ID: <200808070918.34220.borntraeger@de.ibm.com> (raw)
In-Reply-To: <48996B0E.5000009@citrix.com>
Am Mittwoch, 6. August 2008 schrieb Alex Nixon:
> The patch appears to fix things.
Rusty,
can this patch go into 2.6.27-rc* via your queue?
---snip----
[PATCH] fix spinlock recursion in hvc_console
commit 611e097d7707741a336a0677d9d69bec40f29f3d
Author: Christian Borntraeger <borntraeger@de.ibm.com>
hvc_console: rework setup to replace irq functions with callbacks
introduced a spinlock recursion problem.
request_irq tries to call the handler if the IRQ is shared.
The irq handler of hvc_console calls hvc_poll and hvc_kill
which might take the hvc_struct spinlock. Therefore, we have
to call request_irq outside the spinlock.
We can move the notifier_add safely outside the spinlock as ->data must
not be changed by the backend. Otherwise, tty_hangup would fail anyway.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
drivers/char/hvc_console.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Index: kvm/drivers/char/hvc_console.c
===================================================================
--- kvm.orig/drivers/char/hvc_console.c
+++ kvm/drivers/char/hvc_console.c
@@ -322,11 +322,10 @@ static int hvc_open(struct tty_struct *t
hp->tty = tty;
- if (hp->ops->notifier_add)
- rc = hp->ops->notifier_add(hp, hp->data);
-
spin_unlock_irqrestore(&hp->lock, flags);
+ if (hp->ops->notifier_add)
+ rc = hp->ops->notifier_add(hp, hp->data);
/*
* If the notifier fails we return an error. The tty layer
next prev parent reply other threads:[~2008-08-07 7:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <48973E59.1000904@citrix.com>
[not found] ` <489742CF.2030305@goop.org>
[not found] ` <4898096F.4030607@citrix.com>
[not found] ` <48987526.40500@goop.org>
[not found] ` <48987DD8.8080009@citrix.com>
2008-08-05 18:08 ` Spinlock recursion in hvc_poll Jeremy Fitzhardinge
2008-08-05 20:53 ` Christian Borntraeger
2008-08-06 9:12 ` Alex Nixon
2008-08-07 7:18 ` Christian Borntraeger [this message]
2008-08-08 6:50 ` Rusty Russell
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=200808070918.34220.borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=alex.nixon@citrix.com \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
/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