Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/5] ARM: at91: fix irq_pm_install_action WARNING
Date: Tue, 16 Dec 2014 21:37:22 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.11.1412162125000.17382@nanos> (raw)
In-Reply-To: <20141216192609.778f5f8d@bbrezillon>

On Tue, 16 Dec 2014, Boris Brezillon wrote:
> On Tue, 16 Dec 2014 11:03:55 +0100 (CET)
> Thomas Gleixner <tglx@linutronix.de> wrote:
> > That avoids the whole flag, action, whatever business for the price of
> > a really trivial demux mechanism. Everything just works. Even the irq
> > storm detector will just disable the parent interrupt once all
> > handlers return NONE often enough.
> 
> Still have one question regarding the spurious interrupt detection code.
> AFAIU, it disables a specific IRQ handler if it triggers to often with
> an IRQ_NONE return, right ?
> 
> In this dumb demuxer I can't tell which child interrupt should be
> handled (there is no interrupt cause register), thus I call
> generic_handle_irq on all unmasked IRQs.
> Isn't there a risk to get some of my child interrupts disabled because
> they always return IRQ_NONE (which is a normal use case for
> IRQF_SHARED: we're only expecting at least one handler to return
> IRQ_HANDLED or IRQ_WAKE_THREAD, not all of them) ?

Good point. I missed that aspect.

Another good reason to make that core infrastructure.

So what you need is the following:

void dumb_demux_handler(....)
{
	irq_return ret = IRQ_NONE:
	int i;

	for_each_demux_irq(i)
		ret |= handle_dumb_demux_irq(base + i);

	note_interrupt(demuxirq, ret);
}   

So that disables the demux irq if all sub handlers return NONE 100k
times in a row. Otherwise if one of them handles it, you're fine.

That more or less resembles the shared action magic.

So yes, that wants to be core functionality which can be instantiated
from an affected irq chip for this particular case of HW insanity.

Thanks,

	tglx

  reply	other threads:[~2014-12-16 20:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-15 16:15 [PATCH 0/5] ARM: at91: fix irq_pm_install_action WARNING Boris Brezillon
2014-12-15 16:15 ` [PATCH 1/5] genirq: Support mixing IRQF_NO_SUSPEND/IRQF_SUSPEND on shared irqs Boris Brezillon
2014-12-15 21:45   ` Rafael J. Wysocki
2014-12-15 16:15 ` [PATCH 2/5] clk: at91: implement suspend/resume for the PMC irqchip Boris Brezillon
2014-12-15 16:15 ` [PATCH 3/5] watchdog: at91sam9: request the irq with IRQF_NO_SUSPEND Boris Brezillon
2014-12-15 16:15 ` [PATCH 4/5] rtc: at91: request IRQs with IRQF_SUSPEND_NOACTION Boris Brezillon
2014-12-15 16:15 ` [PATCH 5/5] tty: serial: atmel: request IRQ " Boris Brezillon
2014-12-15 22:20 ` [PATCH 0/5] ARM: at91: fix irq_pm_install_action WARNING Rafael J. Wysocki
2014-12-15 22:48   ` Rafael J. Wysocki
2014-12-16  9:07     ` Boris Brezillon
2014-12-16 10:03       ` Thomas Gleixner
2014-12-16 11:25         ` Boris Brezillon
2014-12-16 12:56           ` Thomas Gleixner
2014-12-16 14:20             ` Boris Brezillon
2014-12-16 14:52               ` Thomas Gleixner
2014-12-16 18:26         ` Boris Brezillon
2014-12-16 20:37           ` Thomas Gleixner [this message]
2015-01-08 13:52             ` [RFC PATCH] irqchip: add dumb demultiplexer implementation Boris Brezillon
2015-01-13 10:38               ` Thomas Gleixner
2015-01-13 10:58                 ` Boris Brezillon
2015-01-13 12:41                   ` Thomas Gleixner
2015-01-13 17:00                 ` Boris Brezillon
2015-01-13 17:31                   ` 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=alpine.DEB.2.11.1412162125000.17382@nanos \
    --to=tglx@linutronix.de \
    --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