|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 27/31] Find an unbound irq number in reverse order (h
From: root <root@xxxxxxxxxxxxxxxxxxxxx>
In earlier Xen Linux kernels, the IRQ mapping was a straight 1:1 and the
find_unbound_irq started looking around 256 for open IRQs and up. IRQs
from 0 to 255 were reserved for PCI devices. Previous to this patch,
the 'find_unbound_irq' started looking at get_nr_hw_irqs() number.
For privileged domain where the ACPI information is available that
returns the upper-bound of what the GSIs. For non-privileged PV domains,
where ACPI is no-existent the get_nr_hw_irqs() reports the IRQ_LEGACY (16).
With PCI passthrough enabled, and with PCI cards that have IRQs pinned
to a higher number than 16 we collide with previously allocated IRQs.
Specifically the PCI IRQs collide with the IPI's for Xen functions
(as they are allocated earlier).
For example:
00:00.11 USB Controller: ATI Technologies Inc SB700 USB OHCI1 Controller
(prog-if 10 [OHCI])
...
Interrupt: pin A routed to IRQ 18
[root@localhost ~]# cat /proc/interrupts | head
CPU0 CPU1 CPU2
16: 38186 0 0 xen-dyn-virq timer0
17: 149 0 0 xen-dyn-ipi spinlock0
18: 962 0 0 xen-dyn-ipi resched0
and when the USB controller is loaded, the kernel reports:
IRQ handler type mismatch for IRQ 18
current handler: resched0
One way to fix this is to reverse the logic when looking for un-used
IRQ numbers and start with the highest available number. With that,
we would get:
CPU0 CPU1 CPU2
... snip ..
292: 35 0 0 xen-dyn-ipi callfunc0
293: 3992 0 0 xen-dyn-ipi resched0
294: 224 0 0 xen-dyn-ipi spinlock0
295: 57183 0 0 xen-dyn-virq timer0
NMI: 0 0 0 Non-maskable interrupts
.. snip ..
And interrupts for PCI cards are now accessible.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
drivers/xen/events.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index e9f7551..b2c1b09 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -371,11 +371,12 @@ static int find_unbound_irq(void)
struct irq_desc *desc;
int start = get_nr_hw_irqs();
- for (irq = start; irq < nr_irqs; irq++)
+ /* nr_irqs is a magic value. Must not use it.*/
+ for (irq = nr_irqs-1; irq > start; irq--)
if (irq_info[irq].type == IRQT_UNBOUND)
break;
- if (irq == nr_irqs)
+ if (irq == start || irq == nr_irqs)
panic("No available IRQ to bind to: increase nr_irqs!\n");
desc = irq_to_desc_alloc_node(irq, 0);
--
1.6.2.5
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH 17/31] Coalesce pci.c functions in xenbus.c., (continued)
- [Xen-devel] [PATCH 17/31] Coalesce pci.c functions in xenbus.c., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 18/31] Coalesce xen/pcifront.h in drivers/xen/pcifront/pcifront.h, Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 19/31] Remove ia64 from pcifront.c support., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 20/31] Remove unused pci_bus_sem extern, as we don't use it., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 21/31] Coalesce pcifront.h in xenbus.c., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 22/31] Coalesce pci_op.c in xenbus.c., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 23/31] Remove unnecessary function declerations., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 24/31] Rename the drivers/xen/pcifront/* driver to drivers/pci/xen-pcifront.c., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 25/31] Change the boot-order of initialising the PCI frontend., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 26/31] Fix warnings/errors reported by checkpatch.pl on xen-pcifront.c, Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 27/31] Find an unbound irq number in reverse order (high to low).,
Konrad Rzeszutek Wilk <=
- [Xen-devel] [PATCH 28/31] For non-privileged domains, implement a pcibios_enable_irq (xen_pcifront_enable_irq) function., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 29/31] xen_destroy_irq + xen_allocate_pirq in PV non-priv mode should not make certain Xen-HYPERCALLs., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 30/31] Add pci_frontend_[enable|disable]_[msi|msix] function decleration and EXPORT_SYMBOL_GPL., Konrad Rzeszutek Wilk
- [Xen-devel] [PATCH 31/31] To enable MSI devices in a non-privileged PV domain use pci_frontend_enable_msi., Konrad Rzeszutek Wilk
- [Xen-devel] Re: [PATCH 29/31] xen_destroy_irq + xen_allocate_pirq in PV non-priv mode should not make certain Xen-HYPERCALLs., Jeremy Fitzhardinge
Re: [Xen-devel] [PATCH PV_OPS PCIFRONT], Konrad Rzeszutek Wilk
|
|
|
|
|