From: Stefan Assmann <sassmann@suse.de>
To: Shaohua Li <shaohua.li@intel.com>
Cc: Len Brown <lenb@kernel.org>, Ingo Molnar <mingo@elte.hu>,
Bjorn Helgaas <bjorn.helgaas@hp.com>,
Jesse Barnes <jbarnes@virtuousgeek.org>,
Olaf Dabrunz <od@suse.de>, Thomas Gleixner <tglx@linutronix.de>,
Steven Rostedt <rostedt@goodmis.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
Sven Dietrich <sdietrich@novell.com>
Subject: Re: PCI, ACPI, IRQ, IOAPIC: reroute PCI interrupt to legacy boot interrupt equivalent
Date: Wed, 14 Jan 2009 10:57:22 +0100 [thread overview]
Message-ID: <496DB702.40302@suse.de> (raw)
In-Reply-To: <20090113082513.GA18449@sli10-desk.sh.intel.com>
Shaohua Li wrote:
> On Mon, Jan 12, 2009 at 07:09:25PM +0800, Stefan Assmann wrote:
>> Hi Len,
>>
>> Len Brown wrote:
>>> Stefan,
>>> I had to exclude your changes to drivers/acpi/pci_irq.c from
>>> e1d3a90846b40ad3160bf4b648d36c6badad39ac
>>> in order to get some other changes to that file upstream in the
>>> 2.6.29 merge window.
>>>
>>> I left the other parts of the quirk intact - so at the moment
>>> on one of the quirked machines, you'll see
>>>
>>> PCI quirk: reroute interrupts for...
>>>
>>> but will not see
>>>
>>> pci irq %d -> rerouted to legacy
>>>
>>> as the quirk is effectively disabled.
>>>
>>> I had difficulty trying to port this patch to the new pci_irq.c
>>> because fundamentally I don't understand what it is trying
>>> to do, and why.
>> Let me try to give you a short overview of what's happening there.
>>
>> If an IRQ arrives at line X of a non-primary IO-APIC and that line is
>> masked a new IRQ will be generated on the primary IO-APIC/PIC. This is
>> called a "Boot Interrupt" by Intel. It's purpose is, as the name
>> suggests, to ensure that the IRQ is handled at boot time (when the
>> non-primary) IO-APIC is still disabled.
>>
>> Condition to be met for "Boot Interrupts":
>> - line X on non-primary IO-APIC interrupt line is masked
>> - line X is asserted
>>
>> This behavior is not necessary during normal operation as the IRQ is
>> handled by the non-primary IO-APIC itself. Now imagine what happens if
>> these Boot Interrupts would occur during normal operation. You'd see
>> spurious IRQs on your primary IO-APIC which, in the worst case, will
>> bring down the interrupt line they occur on! Every device that shares this
>> interrupt line will fail when this happens.
>>
>> Why can these IRQ lines be brought down by Boot Interrupts? Because
>> there's no handler installed on the primary IO-APIC IRQ line that can
>> take care of them and after too many unhandled IRQs the line will be shut
>> down by the kernel.
>>
>> What this quirk does:
>> It installs the interrupt handler on the primary IO-APICs interrupt line
>> instead of the (original) non-primary IO-APICs interrupt line, keeping
>> the original interrupt line masked. This guarantees that for every IRQ
>> arriving at the non-primary IO-APIC a Boot Interrupt is generated _and_
>> handled properly.
>>
>> Note: You need this quirk if you mask your interrupts during handling.
> So a device can generate interrupt from two irqs. And we can get the irq
> number for the routing table. Can we extend the irq mechanism and
> automatically register the interrupt handler for the two irqs?
This would not solve the problem of asserting 2 different interrupt
lines, in the masked interrupt handling case, for 1 interrupt request.
The result would be that the ISR is called twice and at the second call
you can't be sure that the device hasn't already been serviced.
>
> Thanks,
> Shaohua
Stefan
--
Stefan Assmann | SUSE LINUX Products GmbH
Software Engineer | Maxfeldstr. 5, D-90409 Nuernberg
Mail: sassmann@suse.de | GF: Markus Rex, HRB 16746 (AG Nuernberg)
next prev parent reply other threads:[~2009-01-14 9:57 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-09 23:03 PCI, ACPI, IRQ, IOAPIC: reroute PCI interrupt to legacy boot interrupt equivalent Len Brown
2009-01-12 11:09 ` Stefan Assmann
2009-01-12 11:37 ` Ingo Molnar
2009-01-12 18:51 ` Bjorn Helgaas
2009-01-12 19:25 ` Jon Masters
2009-01-12 19:45 ` Bjorn Helgaas
2009-01-13 13:32 ` Stefan Assmann
2009-01-13 18:22 ` Olaf Dabrunz
2009-01-15 15:34 ` Olaf Dabrunz
2009-01-12 23:36 ` Eric W. Biederman
2009-01-13 0:29 ` Jon Masters
2009-01-13 1:47 ` Ingo Molnar
2009-01-13 3:47 ` Eric W. Biederman
2009-01-13 4:26 ` Jon Masters
2009-01-14 11:40 ` Ingo Molnar
2009-01-14 19:18 ` Jon Masters
2009-01-14 22:42 ` Eric W. Biederman
2009-01-14 22:53 ` Steven Rostedt
2009-01-14 22:56 ` Jon Masters
2009-01-15 12:36 ` Olaf Dabrunz
2009-01-15 10:16 ` Stefan Assmann
2009-01-13 11:18 ` Stefan Assmann
2009-01-13 15:57 ` Olaf Dabrunz
2009-01-15 0:10 ` Bjorn Helgaas
2009-01-15 14:08 ` Stefan Assmann
2009-01-13 8:25 ` Shaohua Li
2009-01-14 9:57 ` Stefan Assmann [this message]
2009-01-14 15:48 ` Bjorn Helgaas
2009-01-14 15:55 ` Olaf Dabrunz
2009-01-14 16:52 ` Bjorn Helgaas
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=496DB702.40302@suse.de \
--to=sassmann@suse.de \
--cc=bjorn.helgaas@hp.com \
--cc=jbarnes@virtuousgeek.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=od@suse.de \
--cc=rostedt@goodmis.org \
--cc=sdietrich@novell.com \
--cc=shaohua.li@intel.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).