From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Ingo Molnar <mingo@elte.hu>,
linux-ide@vger.kernel.org,
Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>,
Steven Rostedt <rostedt@goodmis.org>,
Daniel Walker <dwalker@mvista.com>
Subject: Re: [PATCH -rt] ide: fix interrupts processing issue with preempt-able hardirqs
Date: Wed, 25 Jun 2008 18:22:49 +0400 [thread overview]
Message-ID: <20080625142249.GA21630@polina.dev.rtsoft.ru> (raw)
In-Reply-To: <486244FF.8060805@ru.mvista.com>
On Wed, Jun 25, 2008 at 05:15:43PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> Anton Vorontsov wrote:
>
>>>>> IDE interrupt handler relies on the fact that, if necessary,
>>>>> hardirqs will re-trigger on ISR exit. With fully preemtable IRQs
>>>>> this seems to be not true, since if hardirq thread is currently
>>>>> running, and the same IRQ raised again, then this IRQ will be
>>>>> simply lost.
>
>>>> actually no, that should not happen - if -rt loses an IRQ then
>>>> something broke in the threaded IRQ code. It's supposed to be a
>>>> drop-in, compatible IRQ flow with no driver changes needed.
>
>>> ..just as I thought, the bug somewhere deeper... heh.
>
>> Ok, a bit more investigation showed that this is indeed not RT specific
>> per see, but issue emerges only on RT-style IRQ handlers + alim15x3 IDE
>> controller (for example, PDC20269 works ok).
>
> Does it happen only with ATAPI devices also or with ATA disks too?
So far I own two ATAPI devices, IDE disks are quire rare nowadays,
should find one. ;-)
>> The difference is that that with RT: low-level (non-threaded) IRQ
>> handler masks IDE IRQ, then wakes up appropriate IRQ thread, which calls
>> IDE handler, and then, after IDE handler exits, thread routine unmasks
>> IDE IRQ.
>
>> Without RT: low-level non-threaded IRQ handler does not mask specific
>> IRQ, but disables local interrupts, and calls IDE handler directly.
>
> Hm, handle_level_irq() (and PCI IRQs are level-triggered) calls
> mask_ack_irq() which should *mask* IRQ and send EOI (at least on i8259).
> By IRQ18 I can assume it's I/O APIC
No, it's not Intel I/O APIC. IRQ18 is the virtual "Linux IRQ", no
correlations with the PIC IRQ number.
> -- this one may be using different
> methods of handling IRQ depending on whether hardirq preemption is on or
> off (at least it was so in 2.6.18-rt time).
Hardirq preemption is on, of course. The whole problem is when hardirqs
preempted.
> The default, "fasteoi" path
> doesn't mask off the IRQ indeed (it should be disabled from re-occuring
> anyway until the code issues EOI)...
What do you mean by doesn't mask off? With hardirqs preemption it does
mask off IDE interrupt, and then sends an EOI. But it doesn't mask
processors' IRQs (i.e. local_irq_disable()), true. And MPIC is using
fasteoi path indeed.
> So, which machine and PIC you have?
It is PowerPC MPC8610 + ULi "Super South Bridge" connected through
PCI Express. This south bridge contains lots of devices (and lots of
PCI quirks, see arch/powerpc/platforms/86xx/mpc8610_hpcd.c).
PIC is OpenPIC-compatible (MPIC, built-in into MPC8610 SOC).
Note: I don't have any specifications on that ULi bridge, neither I have
any schematics for that board (so far, let's hope). So I can't say
exactly how things are inter-connected or what these PCI quirks are
actually doing (despite few comments in them).
And since it is PCI-E, interrupt things are quite troublesome to
debug without serial logic analyzer. :-)
>> The bug, as I see it, in the alim15x3 (ULi M5228) hardware: for some
>> reason it does not hold IRQ line, but rises it for some short period
>> of time (while the drive itself rises and holds it correctly -- I'm
>> seeing it via oscilloscope).
>
> That's surely an invalid behavior for a level triggered interrupt that
> can also result in spurious IRQs... I'm not even sure how it can
> reliably work without masking since there should be no latching for level
> triggered interupts...
Yeah.
>> So this scheme does not work:
>> mask_irq()
>> ...do something that will trigger IDE interrupt...
>> unmask_irq()
>
>> Also, further testing showed that this issue isn't drive-specific, i.e.
>> with a delay inserted before the unmask_irq(), the bug shows with any
>> drive I have.
>
> So, "shit happens" even with the ATA drives?
Will try as soon as I'll get one.
Thanks,
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
next prev parent reply other threads:[~2008-06-25 14:22 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-23 23:40 [PATCH -rt] ide: fix interrupts processing issue with preempt-able hardirqs Anton Vorontsov
2008-06-23 23:51 ` Ingo Molnar
2008-06-24 0:00 ` Anton Vorontsov
2008-06-25 12:34 ` Anton Vorontsov
2008-06-25 12:32 ` Alan Cox
2008-06-25 14:12 ` Anton Vorontsov
2008-06-25 13:15 ` Sergei Shtylyov
2008-06-25 14:22 ` Anton Vorontsov [this message]
2008-06-25 14:32 ` Alan Cox
2008-06-25 15:26 ` Anton Vorontsov
2008-06-25 14:59 ` Anton Vorontsov
2008-06-28 0:54 ` [PATCH v2 -rt] ide: workaround buggy hardware issues with preemptable hardirqs Anton Vorontsov
2008-06-28 1:09 ` Anton Vorontsov
2008-06-28 9:15 ` Alan Cox
2008-06-28 9:14 ` Alan Cox
2008-06-28 10:43 ` Sergei Shtylyov
2008-06-29 12:49 ` Alan Cox
2008-06-29 13:17 ` Sergei Shtylyov
2008-06-29 14:23 ` Anton Vorontsov
2008-06-28 10:30 ` Sergei Shtylyov
2008-06-28 11:31 ` Anton Vorontsov
2008-06-28 11:52 ` Sergei Shtylyov
2008-06-29 23:26 ` Benjamin Herrenschmidt
2008-06-23 23:52 ` [PATCH -rt] ide: fix interrupts processing issue with preempt-able hardirqs Anton Vorontsov
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=20080625142249.GA21630@polina.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=bzolnier@gmail.com \
--cc=dwalker@mvista.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=sshtylyov@ru.mvista.com \
--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;
as well as URLs for NNTP newsgroup(s).