From: Peter Zijlstra <peterz@infradead.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
Russell King <linux@arm.linux.org.uk>,
Chris Ball <chris@printf.net>,
linux-mmc@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [patch 1/2] genirq: Provide synchronize_hardirq()
Date: Sat, 15 Feb 2014 10:50:08 +0100 [thread overview]
Message-ID: <20140215095008.GG14089@laptop.programming.kicks-ass.net> (raw)
In-Reply-To: <20140215003823.653236081@linutronix.de>
On Sat, Feb 15, 2014 at 12:55:18AM -0000, Thomas Gleixner wrote:
> synchronize_irq() waits for hard irq and threaded handlers to complete
> before returning. For some special cases we only need to make sure
> that the hard interrupt part of the irq line is not in progress when
> we disabled the - possibly shared - interrupt at the device level.
>
> A proper use case for this was provided by Russell. The sdhci driver
> requires some irq triggered functions to be run in thread context. The
> current implementation of the thread context is a sdio private kthread
> construct, which has quite some shortcomings. These can be avoided
> when the thread is directly associated to the device interrupt via the
> generic threaded irq infrastructure.
>
> Though there is a corner case related to run time power management
> where one side disables the device interrupts at the device level and
> needs to make sure, that an already running hard interrupt handler has
> completed before proceeding further. Though that hard interrupt
> handler might wake the associated thread, which in turn can request
> the runtime PM to reenable the device. Using synchronize_irq() leads
> to an immediate deadlock of the irq thread waiting for the PM lock and
> the synchronize_irq() waiting for the irq thread to complete.
>
> Due to the fact that it is sufficient for this case to ensure that no
> hard irq handler is executing a new function which avoids the check
> for the thread is required.
>
> Add a function, which just monitors the hard irq parts and ignores the
> threaded handlers.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <peterz@infradead.org>
next prev parent reply other threads:[~2014-02-15 9:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-15 0:55 [patch 0/2] genirq: Add functions to avoid driver hackery Thomas Gleixner
2014-02-15 0:55 ` [patch 1/2] genirq: Provide synchronize_hardirq() Thomas Gleixner
2014-02-15 9:50 ` Peter Zijlstra [this message]
2014-02-19 16:27 ` [tip:irq/core] " tip-bot for Thomas Gleixner
2014-02-15 0:55 ` [patch 2/2] genirq: Provide irq_wake_thread() Thomas Gleixner
2014-02-15 9:50 ` Peter Zijlstra
2014-02-19 16:27 ` [tip:irq/core] " tip-bot for Thomas Gleixner
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=20140215095008.GG14089@laptop.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=chris@printf.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mingo@elte.hu \
--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
Powered by JetHome