From: Tejun Heo <tj@kernel.org>
To: Jeff Garzik <jeff@garzik.org>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
IDE/ATA development list <linux-ide@vger.kernel.org>
Subject: Re: [PATCH #upstraem-fixes] ata_piix: detect and clear spurious IRQs
Date: Wed, 26 Nov 2008 11:52:53 +0900 [thread overview]
Message-ID: <492CBA05.8000107@kernel.org> (raw)
In-Reply-To: <492C30EE.9080600@garzik.org>
Hello, Jeff.
Jeff Garzik wrote:
> Alan Cox wrote:
>> On Fri, 21 Nov 2008 13:13:06 +0900
>> Tejun Heo <tj@kernel.org> wrote:
>>
>>> The DMA_IRQ bit in the bmdma status register is always set when IDEIRQ
>>> is asserted allowing spurious IRQ detection. Detect spurious IRQs and
>>> clear them. This protects ata_piix against nobody-cared which gets
>>> reported not so rarely.
>>
>> Various controllers have the ability to report the IRQ more reliably in
>> similar fashion, should this not be part of ata_sff_interrupt with an
>> optional ops->irq_pending call ?
>
> Though I'm in general agreement with this sub-thread of opinions, I do
> note that, in the past, I have purposefully avoided an ->irq_pending.
>
> I always felt the alternative -- writing a small irq handler function
> specifically for that controller -- was a much more flexible and
> powerful method of producing the desired result.
>
> A separate interrupt function can, for example, perform an MMIO read to
> check irq-pending, outside of a spinlock. ->irq_pending callback is a
> bit more constraining.
If we call ->irq_pending() only when no qc is in flight, I don't think
there will be any noticeable performance penalty when the IRQ pending
register is per-port. If pending status of all ports can be
determined by single read, having a separate handler is a good idea.
It all depends on how controllers actually implement them.
All BMDMA controllers I know about are sata_sil (already has private
irq handler) and ata_piix (this patch). Alan, how do other
controllers do it?
> In terms of implementation, we could probably collapse all the
> non-controller-specific behavior into a single function call or macro,
> performed inside the custom interrupt handling routine.
->irq_clear() is tightly bound to ->irq_pending(). Drivers which
don't support ->irq_pending() probably wouldn't support or need
->irq_clear() either, but still, I can't think of one good location.
What's on your mind?
Thanks.
--
tejun
next prev parent reply other threads:[~2008-11-26 2:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-21 4:13 [PATCH #upstraem-fixes] ata_piix: detect and clear spurious IRQs Tejun Heo
2008-11-21 10:25 ` Alan Cox
2008-11-21 13:07 ` Tejun Heo
2008-11-25 17:07 ` Jeff Garzik
2008-11-26 2:52 ` Tejun Heo [this message]
2008-11-26 10:47 ` Alan Cox
2008-11-26 12:26 ` Sergei Shtylyov
2008-11-26 12:28 ` Sergei Shtylyov
2008-11-26 12:37 ` Sergei Shtylyov
2008-11-26 17:34 ` Jeff Garzik
2008-11-26 17:45 ` Tejun Heo
2008-11-26 18:40 ` Alan Cox
2008-11-26 18:57 ` Tejun Heo
2008-11-28 2:31 ` Tejun Heo
2008-12-04 16:33 ` Mark Lord
2008-12-04 16:35 ` Alan Cox
2008-11-21 16:59 ` Sergei Shtylyov
2008-11-21 17:05 ` Tejun Heo
2008-11-25 17:08 ` Jeff Garzik
2008-11-25 17:15 ` Alan Cox
2008-11-26 2:45 ` Tejun Heo
2008-11-26 10:33 ` Alan Cox
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=492CBA05.8000107@kernel.org \
--to=tj@kernel.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.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).