From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4] irqchip: gic: Allow gic_arch_extn hooks to call into scheduler
Date: Wed, 13 Aug 2014 16:05:40 +0100 [thread overview]
Message-ID: <20140813150540.GL30401@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20140813145526.GF32301@codeaurora.org>
On Wed, Aug 13, 2014 at 07:55:26AM -0700, Stephen Boyd wrote:
> On 08/13, Russell King - ARM Linux wrote:
> > On Wed, Aug 13, 2014 at 06:57:18AM -0700, Stephen Boyd wrote:
> > > Commit 1a6b69b6548c (ARM: gic: add CPU migration support,
> > > 2012-04-12) introduced an acquisition of the irq_controller_lock
> > > in gic_raise_softirq() which can lead to a spinlock recursion if
> > > the gic_arch_extn hooks call into the scheduler (via complete()
> > > or wake_up(), etc.). This happens because gic_arch_extn hooks are
> > > normally called with the irq_controller_lock held and calling
> > > into the scheduler may cause us to call smp_send_reschedule()
> > > which will grab the irq_controller_lock again. Here's an example
> > > from a vendor kernel (note that the gic_arch_extn hook code here
> > > isn't actually in mainline):
> >
> > Here's a question: why would you want to call into the scheduler from
> > the gic_arch_extn code?
>
> In this case we want to send a message to another processor when
> an interrupt is enabled that's only a wakeup interrupt in certain
> low power states. It's done sort of indirectly, but basically we
> block that low power state from being entered so we can ensure
> that the interrupt wakes us up from a lighter version of suspend.
No, that's not the correct answer for the question I asked. I did not
ask "why would you want to call into the IRQ code from the scheduler".
I asked "why would you want to call into the scheduler from the
gic_arch_extn code?"
That's a completely different question. Let me rephrase to try and get
an answer to my question: Why are you calling complete() or wake_up()
from the gic_arch_extn code?
> > static int __disable_irq_nosync(unsigned int irq)
> > {
> > unsigned long flags;
> > struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
>
> We got the lock here.
Yes, Daniel pointed that out, which makes this fine of course.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
next prev parent reply other threads:[~2014-08-13 15:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-13 13:57 [PATCH v4] irqchip: gic: Allow gic_arch_extn hooks to call into scheduler Stephen Boyd
2014-08-13 14:22 ` Russell King - ARM Linux
2014-08-13 14:53 ` Daniel Thompson
2014-08-13 14:55 ` Stephen Boyd
2014-08-13 15:05 ` Russell King - ARM Linux [this message]
2014-08-13 15:31 ` Stephen Boyd
2014-08-13 15:44 ` Nicolas Pitre
2014-08-17 17:32 ` Jason Cooper
2014-08-17 18:55 ` Russell King - ARM Linux
2014-08-17 19:04 ` Jason Cooper
2014-08-17 21:41 ` Russell King - ARM Linux
2014-08-18 0:17 ` Nicolas Pitre
2014-08-20 19:11 ` Stephen Boyd
2014-08-18 1:32 ` Jason Cooper
2014-08-18 0:04 ` Nicolas Pitre
2014-08-18 1:25 ` Jason Cooper
2014-08-18 1:35 ` Nicolas Pitre
2014-08-18 1:54 ` Jason Cooper
2014-08-18 2:18 ` Nicolas Pitre
2014-08-20 19:16 ` Stephen Boyd
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=20140813150540.GL30401@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).