On 04.11.2015 15:47, Sinan Kaya wrote:
On 11/4/2015 6:33 AM, Tomasz Nowicki wrote:
On 04.11.2015 03:23, Sinan Kaya wrote:
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.
Can you point me to spec 256 interrupts limitation and explain whether you see it per link object or per whole system? Also, can you use more than 256 different ACPI link objects ?
Tomasz
The limitation is not the number of interrupts. The limitation is the interrupt Id. You can reproduce this easily by specifying a SPI interrupt number bigger than 256.
Something like this
Device(LN0A){ Name(_HID, EISAID("PNP0C0F")) // PCI interrupt link Name(_UID, 1) Name(_PRS, ResourceTemplate(){ Interrupt(ResourceProducer, Level, ActiveHigh, Exclusive, , ,) {0x160} }) Method(_DIS) {} Method(_CRS) { Return (_PRS) } Method(_SRS, 1) {} }
The limitation is here in pci_link.c driver. See u8 below
struct acpi_pci_link_irq { u8 active; /* Current IRQ */ u8 triggering; /* All IRQs */ u8 polarity; /* All IRQs */
I patched this file locally for testing. See my attachment.
Then, I talked to a couple of people from the Intel world that has ACPI experience.
They questioned why I'm using ACPI_LINK object at all. "ACPI_LINK object has been designed for older intel systems with PIC interrupt controller where the interrupt numbers were limited to 256. Newer systems with IOAPIC declare their interrupts directly inside the _PRT. This also removes the 256 interrupt restriction"
The point is that both interrupt declarations are correct. ARM64 only works with ACPI LINK object. The default implementation in _PRT assumes ACTIVE_LOW which is incompatible with GICv3 driver.
I think we should have Rafael's opinion on this.
OK, now I see your point and 256 limitation, your patch won't help to solve that issue because spec defines: struct acpi_resource_irq { u8 descriptor_length; u8 triggering; u8 polarity; u8 sharable; u8 wake_capable; u8 interrupt_count; u8 interrupts[1]; <---- 1byte size };
I think we should use _PRT and adjust default ACTIVE_LOW to be more flexible. But it is always good to ask maintainer.
Regards, Tomasz