From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Stuck MSI in normal Linux driver
Date: Fri, 04 Mar 2011 09:09:57 +0100 [thread overview]
Message-ID: <4D709E55.8010904@domain.hid> (raw)
In-Reply-To: <1299225060.2107.20.camel@domain.hid>
[-- Attachment #1: Type: text/plain, Size: 4873 bytes --]
On 2011-03-04 08:51, Philippe Gerum wrote:
> On Fri, 2011-03-04 at 00:45 +0100, Jan Kiszka wrote:
>> On 2011-03-03 13:54, Philippe Gerum wrote:
>>> On Thu, 2011-03-03 at 13:30 +0100, Jan Kiszka wrote:
>>>> On 2011-03-03 13:25, Wolfgang Grandegger wrote:
>>>>> Hi Philippe,
>>>>>
>>>>> On 03/03/2011 08:32 AM, Philippe Gerum wrote:
>>>>>> On Thu, 2011-03-03 at 08:21 +0100, Richard Cochran wrote:
>>>>>>> On Wed, Mar 02, 2011 at 07:18:46PM +0100, Jan Kiszka wrote:
>>>>>>>> On 2011-03-02 16:26, Gilles Chanteperdrix wrote:
>>>>>>>>> Richard Cochran wrote:
>>>>>>>>>> The wiki pages
>>>>>>>>>>
>>>>>>>>>> http://www.xenomai.org/index.php/FAQs
>>>>>>>>>> http://www.xenomai.org/index.php/Configuring_x86_kernels
>>>>>>>>>>
>>>>>>>>>> say not to enable MSI on x86, with a link to a very old (2008)
>>>>>>>>>> discussion.
>>>>>>>
>>>>>>> ...
>>>>>>>
>>>>>>>> The current situation looks like this:
>>>>>>>> - MSI[-X] usage for plain Linux drivers is fine, we are using it on
>>>>>>>> machines where you can hardly avoid MSI today
>>>>>>>> - MSI[-X] usage for RTDM (ie. RT) drivers is basically fine as long as
>>>>>>>> you avoid enabling/disabling from RT context (also used for quite
>>>>>>>> a while here, no known issues under this restriction)
>>>>>>>
>>>>>>> Okay, so I understand from this:
>>>>>>>
>>>>>>> 1. The wiki warning is out of date.
>>>>>>>
>>>>>>> 2. My own PCIe MSI driver/card *should* work.
>>>>>>> (It is not a current known limitation of adeos/xenomai.)
>>>>>>
>>>>>> The situation is not that clear. Enabling CONFIG_PCI_MSI on some 83xx
>>>>>> board did cause a lock up at boot for me, so this may point the finger
>>>>>> at the pipeline core for ppc, and not to Xenomai which was barely active
>>>>>> at that stage.
>>>>>
>>>>> Now I remember vaguely that we have seen a similar issue on the mpc8308
>>>>> in autumn last year. Here is what you wrote that time:
>>>>>
>>>>> On 09/29/2010 04:12 PM, Philippe Gerum wrote:
>>>>>> Ok, I have a good news: the issue is spotted; and a bad one: this is no
>>>>>> trivial stuff to fix. In short, CONFIG_PCI_MSI causes the PIC code to
>>>>>> read PCI config memory on the fly during operations (which is intensely
>>>>>> insane but that is how it goes). Of course, it does that via the regular
>>>>>> PCI helpers, which are stuffed with normal locking constructs we may
>>>>>> _not_ call from any real-time/non-regular context.
>>>>>>
>>>>>> To sum up, we need to call those helpers to ack/mask interrupts within
>>>>>> the I-pipe, but we are not allowed to do this because this is inherently
>>>>>> unsafe.
>>>>>>
>>>>>> Work-around: disable CONFIG_PCI_MSI in your configuration.
>>>>>> The real fix would require much more thought, to make the PCI helpers
>>>>>> Adeos-aware without inducing high latency.
>>>>
>>>> As MSIs are edge-triggered, only requiring ack at the interrupt
>>>> controller level, could it be that PPC is using the wrong flow handler here?
>>>
>>> The pipeline forces mask/ack to prevent adverse effect of deferred
>>> delivery to downstream handlers. Some chips require this.
>>
>> You mean PPC irqchips? I'm a bit confused as MSIs are immediately acked
>> by the hardware on the bus, independently of the processor delivering or
>> deferring the event. What prevents immediate termination (up to EOI if
>> required) of this IRQ type on PPC?
>
> It is not about msi chips in particular, it is about masking all
> interrupt sources during their propagation in the pipeline being
> generally used for all irqs, to prevent interrupt storm from
> edge-triggered sources because of the incurred delay.
At least for MSI, such storms would be very abnormal. The spec states
that devices can't assume anything about multiple IRQ messages sent
before the driver communicated with the device after the first one. So
they /should/ refrain from sending those. Of course, there can always be
exceptions (guess we've all seen buggy firmware...).
>
> To sum up: as far as I'm concerned, I still have to address the issue of
> dealing with MSI, because I never did so for any of the pipeline
> releases, for any arch, I've rolled out in the past. My perception is
> that MSIs are at odds with some assumptions/decisions of the ppc
> pipeline, and this went unnoticed until people start using MSI-enabled
> hardware there too. This was confirmed by experimenting on 83xx that
> something was going wrong with CONFIG_PCI_MSI enabled.
>
> I'm not saying this would be impossible to enable MSIs there, I'm just
> saying that so far: nobody cared. Terrae incognitae.
I'm not disagreeing. I'm just betting that MSI will quickly gain
relevance there as well - up to the point where first devices no longer
include with INTx support (perfectly legal, but I haven't seen one yet).
Jan
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]
next prev parent reply other threads:[~2011-03-04 8:09 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-02 15:16 [Xenomai-help] Stuck MSI in normal Linux driver Richard Cochran
2011-03-02 15:26 ` Gilles Chanteperdrix
2011-03-02 15:34 ` Richard Cochran
2011-03-02 15:38 ` Gilles Chanteperdrix
2011-03-02 18:18 ` Jan Kiszka
2011-03-03 7:21 ` Richard Cochran
2011-03-03 7:32 ` Philippe Gerum
2011-03-03 12:25 ` Wolfgang Grandegger
2011-03-03 12:30 ` Jan Kiszka
2011-03-03 12:54 ` Philippe Gerum
2011-03-03 23:45 ` Jan Kiszka
2011-03-04 7:51 ` Philippe Gerum
2011-03-04 8:09 ` Jan Kiszka [this message]
2011-03-04 8:30 ` Richard Cochran
2011-03-04 8:36 ` Jan Kiszka
2011-03-04 8:11 ` Richard Cochran
2011-03-04 8:16 ` Jan Kiszka
2011-03-07 9:26 ` Richard Cochran
2011-03-07 16:37 ` Philippe Gerum
2011-03-07 18:33 ` Richard Cochran
2011-03-08 7:55 ` Richard Cochran
2011-03-07 18:39 ` Gilles Chanteperdrix
2011-03-07 21:47 ` Philippe Gerum
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=4D709E55.8010904@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=rpm@xenomai.org \
--cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.