Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1269758
| From | Andy Shevchenko <andy.shevchenko@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V3] acpi: add support for extended IRQ to PCI link |
| Date | 2015-11-15 21:20 +0100 |
| Message-ID | <qvbWi-64q-3@gated-at.bofh.it> (permalink) |
| References | <qvbMB-60R-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sun, Nov 15, 2015 at 10:00 PM, Sinan Kaya <okaya@codeaurora.org> wrote:
> The ACPI compiler uses the extended format when used
> interrupt numbers are greater than 256. The PCI link code
> currently only supports simple interrupt format. The IRQ
> numbers are represented using 32 bits when extended IRQ
> syntax. This patch changes the interrupt number type to
> 32 bits and places an upper limit of 1020 as possible
> interrupt id.
>
> 1020 is the maximum interrupt ID that can be assigned to
> an ARM SPI interrupt according to ARM architecture.
>
> Additional checks have been placed to prevent out of bounds
> writes.
One comment below.
> @@ -541,14 +547,16 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link)
> else
> irq = link->irq.possible[link->irq.possible_count - 1];
>
> - if (acpi_irq_balance || !link->irq.active) {
> + if ((acpi_irq_balance || !link->irq.active) && (irq < ACPI_MAX_IRQS)) {
> /*
> * Select the best IRQ. This is done in reverse to promote
> * the use of IRQs 9, 10, 11, and >15.
> */
> - for (i = (link->irq.possible_count - 1); i >= 0; i--) {
> - if (acpi_irq_penalty[irq] >
> - acpi_irq_penalty[link->irq.possible[i]])
> + i = link->irq.possible_count;
> + while (--i) {
Actually it should be (--i >= 0). Sorry if I misled you.
> + if ((link->irq.possible[i] < ACPI_MAX_IRQS) &&
> + (acpi_irq_penalty[irq] >
> + acpi_irq_penalty[link->irq.possible[i]]))
> irq = link->irq.possible[i];
> }
> }
--
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH V3] acpi: add support for extended IRQ to PCI link Sinan Kaya <okaya@codeaurora.org> - 2015-11-15 21:10 +0100 Re: [PATCH V3] acpi: add support for extended IRQ to PCI link Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-11-15 21:20 +0100
csiph-web