mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: max98090: request IRQF_ONESHOT interrupt
@ 2013-05-20  5:58 Andrew Bresticker
  2013-05-20 13:01 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Bresticker @ 2013-05-20  5:58 UTC (permalink / raw)
  To: alsa-devel
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Sachin Kamat, Ralph Birt, Kuninori Morimoto, linux-kernel,
	Andrew Bresticker

request_threaded_irq() rejects calls which both do not specify a handler
(indicating that the primary IRQ handler should be used) and do not set
IRQF_ONESHOT because the combination is unsafe with level-triggered
interrupts.  It is safe in this case, though, since max98090 IRQs are
edge-triggered and the interrupts aren't ACK'ed until the codec's IRQ
status register is read.  Because of this, an IRQF_ONESHOT interrupt
doesn't really make a difference, but request one anyway in order to make
request_threaded_irq() happy.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
---
 sound/soc/codecs/max98090.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index cbb272b..1bf96bd 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2247,7 +2247,7 @@ static int max98090_probe(struct snd_soc_codec *codec)
 	dev_dbg(codec->dev, "irq = %d\n", max98090->irq);
 
 	ret = request_threaded_irq(max98090->irq, NULL,
-		max98090_interrupt, IRQF_TRIGGER_FALLING,
+		max98090_interrupt, IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
 		"max98090_interrupt", codec);
 	if (ret < 0) {
 		dev_err(codec->dev, "request_irq failed: %d\n",
-- 
1.8.2.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: max98090: request IRQF_ONESHOT interrupt
  2013-05-20  5:58 [PATCH] ASoC: max98090: request IRQF_ONESHOT interrupt Andrew Bresticker
@ 2013-05-20 13:01 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2013-05-20 13:01 UTC (permalink / raw)
  To: Andrew Bresticker
  Cc: alsa-devel, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Sachin Kamat, Ralph Birt, Kuninori Morimoto, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 642 bytes --]

On Sun, May 19, 2013 at 10:58:07PM -0700, Andrew Bresticker wrote:
> request_threaded_irq() rejects calls which both do not specify a handler
> (indicating that the primary IRQ handler should be used) and do not set
> IRQF_ONESHOT because the combination is unsafe with level-triggered
> interrupts.  It is safe in this case, though, since max98090 IRQs are

Applied, thanks.  If request_threaded_irq() is rejecting these that's
not ideal - some threaded interrupts can only be generated from within
threaded context and therefore can't have primary handlers.  Unless it
only rejects in the case where the parent IRQ is a hard IRQ of course.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-20 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-20  5:58 [PATCH] ASoC: max98090: request IRQF_ONESHOT interrupt Andrew Bresticker
2013-05-20 13:01 ` Mark Brown

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®