From: tglx@linutronix.de (Thomas Gleixner)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/6] ARM: gic: use handle_fasteoi_irq for SPIs
Date: Sat, 30 Apr 2011 11:54:52 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.02.1104301135190.3005@ionos> (raw)
In-Reply-To: <BANLkTi=rM=r5UdUHPG5XceX=ppnQ44K+oA@mail.gmail.com>
On Fri, 29 Apr 2011, Colin Cross wrote:
> > Cc: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
> > Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
> > Acked-by: Catalin Marinas <catalin.marinas@arm.com>
> > Signed-off-by: Will Deacon <will.deacon@arm.com>
>
> After further testing, I'm having a problem with this patch, although
> I think its more of a core issue than the fault of this patch. One of
> my interrupts is getting stuck with the PENDING flag set, and
> preventing suspend. The flow that triggers this is:
>
> level triggered irq
> handle_fasteoi_irq
> handle_irq_event
> isr
> disable_irq_nosync
> schedule_work (because it takes a sleeping i2c transaction to
> deassert the irq pin)
If you'd use a threaded irq handler the IRQ_ONESHOT mechanism would
handle that problem for you. It masks the irq line before calling the
handler and unmask happens after the threaded handler has run.
disable_irq_nosync from an interrupt handler plus scheduling work is
the historic "threaded" interrupt handler mechanism. It's kinda murky
nowadays due to the lazy irq disable mechanism.
> irq_eoi
> same irq
> handle_fasteoi_irq
> mark irq pending
> mask_irq
> work function
> causes level triggered irq to go low
> enable_irq
> unmask_irq
> check_irq_resend (returns immediately)
>
> At this point, the irq is unmasked, but not being asserted, and marked
> as pending. check_irq_resend doesn't clear the pending flag for level
> triggered interrupts, so the pending flag will stay set until the next
> time the interrupt occurs.
Yes, that should be cleared unconditionally in check_irq_resend.
> Should handle_fasteoi_irq mask the interrupt before eoi if it was
> disabled by the interrupt handler? Otherwise, every level triggered
> interrupt that is not deasserted by the interrupt handler will
> interrupt the cpu twice. There is still the case where a driver
No, we should stop doing the disable_irq_nosync from handlers and use
threaded interrupts instead.
> disables the irq, the interrupt goes high, then goes low again before
> enable_irq is called.
So what you're saying is:
irq ____ _______
|________________| |_____________________
| |
ISR/mask/eoi enable_irq/unmask
So after the unmask the asserted new interrupt is not delivered?
That's not a software problem :)
Thanks,
tglx
next prev parent reply other threads:[~2011-04-30 9:54 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 18:35 [PATCH v2 0/6] Use chained handler entry/exit functions in platform code Will Deacon
2011-04-12 18:35 ` [PATCH 1/6] ARM: omap: update GPIO chained IRQ handler to use entry/exit functions Will Deacon
2011-04-12 18:35 ` [PATCH 2/6] ARM: tegra: " Will Deacon
2011-05-01 7:26 ` Colin Cross
2011-05-01 12:42 ` Will Deacon
2011-04-12 18:35 ` [PATCH 3/6] ARM: s5pv310: update IRQ combiner to use chained " Will Deacon
2011-04-12 18:35 ` [PATCH 4/6] ARM: msm: update GPIO chained IRQ handler to use " Will Deacon
2011-04-15 18:27 ` David Brown
2011-04-18 17:57 ` Will Deacon
2011-04-16 1:51 ` Abhijeet Dharmapurikar
2011-04-18 17:56 ` Will Deacon
2011-04-12 18:35 ` [PATCH 5/6] ARM: nmk: update GPIO chained IRQ handler to " Will Deacon
2011-04-18 18:26 ` Linus Walleij
2011-04-18 19:04 ` Will Deacon
2011-04-18 23:46 ` Linus Walleij
2011-04-19 19:52 ` Grant Likely
2011-04-12 18:35 ` [PATCH 6/6] ARM: gic: use handle_fasteoi_irq for SPIs Will Deacon
2011-04-16 1:52 ` Abhijeet Dharmapurikar
2011-04-19 11:20 ` Santosh Shilimkar
2011-04-19 15:16 ` Will Deacon
2011-04-20 4:20 ` Santosh Shilimkar
2011-04-30 2:38 ` Colin Cross
2011-04-30 9:54 ` Thomas Gleixner [this message]
2011-04-30 16:42 ` Colin Cross
-- strict thread matches above, loose matches on Subject: below --
2011-04-01 14:50 [PATCH 0/6] Use chained handler entry/exit functions in platform code Will Deacon
2011-04-01 14:50 ` [PATCH 6/6] ARM: gic: use handle_fasteoi_irq for SPIs Will Deacon
2011-04-01 20:31 ` Colin Cross
2011-04-03 3:27 ` Colin Cross
2011-04-03 6:06 ` Santosh Shilimkar
2011-04-03 12:18 ` Will Deacon
2011-04-03 12:20 ` Santosh Shilimkar
2011-04-03 12:17 ` Will Deacon
2011-04-03 22:38 ` Colin Cross
2011-04-05 12:48 ` Will Deacon
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.LFD.2.02.1104301135190.3005@ionos \
--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