On 11/3/2015 11:55 AM, Lorenzo Pieralisi wrote:
/*
- Try to assign the IRQ number from DT when adding a new device
*/
- Try to assign the IRQ number from DT/ACPI when adding a new device
int pcibios_add_device(struct pci_dev *dev) {
- dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
- if (acpi_disabled)
dev->irq = of_irq_parse_and_map_pci(dev, 0, 0);
+#ifdef CONFIG_ACPI
- else
acpi_pci_irq_enable(dev);
+#endif
This series:
http://www.spinics.net/lists/linux-pci/msg45950.html
will allow us to initialize the irq mapping function according to the boot method, code above is getting cumbersome and it is already overriden when booting with DT, so we will remove it altogether.
Having some interrupt related issues. I wondered if the above patchset will fix this problem.
ACPI link object unfortunately is limited to 256 interrupts and I'd like to use the _PRT table without the link object for the full SPI interrupt range.
My previous ACPI table was as follows:
Device (PCI0) { // PCIe port 0 Name(_HID, EISAID("PNP0A08")) // PCI express Name(_CID, EISAID("PNP0A03")) // Compatible PCI Root Bridge { .... Name(_PRT, Package(){ Package(){0x0FFFF, 0, _SB.LN0A, 0}, // Slot 0, INTA Package(){0x0FFFF, 1, _SB.LN0B, 0}, // Slot 0, INTB Package(){0x0FFFF, 2, _SB.LN0C, 0}, // Slot 0, INTC Package(){0x0FFFF, 3, _SB.LN0D, 0} // Slot 0, INTD }) }
Here is the PNP0C0F
Device(LN0A){ Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link Name(_UID, 1) Name(_PRS, ResourceTemplate(){ Interrupt(ResourceProducer, Level, ActiveHigh, Exclusive, , ,) {0xE8} }) Method(_DIS) {} Method(_CRS) { Return (_PRS) } Method(_SRS, 1) {} }
Now, I changed to the _PRT object to move to GIC model rather than sticking with the PIC model The new _PRT table as follows:
Name(_PRT, Package(){ Package(){0x0FFFF, 0, 0, 0xE8}, // Slot 0, INTA })
This is causing problems to the GICv3 ACPI driver.
[ 8.826409] genirq: Setting trigger mode 8 for irq 105 failed (gic_set_type+0x0/0x80) [ 8.850685] genirq: Setting trigger mode 8 for irq 105 failed (gic_set_type+0x0/0x80) [ 9.330358] genirq: Setting trigger mode 8 for irq 108 failed (gic_set_type+0x0/0x80) [ 9.378252] genirq: Setting trigger mode 8 for irq 110 failed (gic_set_type+0x0/0x80) [ 11.749632] genirq: Setting trigger mode 8 for irq 108 failed (gic_set_type+0x0/0x80) [ 19.340412] genirq: Setting trigger mode 8 for irq 110 failed (gic_set_type+0x0/0x80)
GICv3 driver supports only IRQ_TYPE_EDGE_RISING and IRQ_TYPE_LEVEL_HIGH interrupt types.
The ACPI PCI code assume active low which doesn't work for GICv3.
int acpi_pci_irq_enable(struct pci_dev *dev) { struct acpi_prt_entry *entry; int gsi; u8 pin; int triggering = ACPI_LEVEL_SENSITIVE; int polarity = ACPI_ACTIVE_LOW;
Do we need ARM64 specific code here?