Skip to content

Commit fa20b17

Browse files
Agustin Vega-FriasMarc Zyngier
authored andcommitted
ACPI: Generic GSI: Do not attempt to map non-GSI IRQs during bus scan
ACPI extended IRQ resources may contain a Resource Source field to specify an alternate interrupt controller, attempting to map them as GSIs is incorrect, so just disable the platform resource. Since this field is currently ignored, we make this change conditional on CONFIG_ACPI_GENERIC_GSI to keep the current behavior on x86 platforms, in case some existing ACPI tables are using this incorrectly. Acked-by: Rafael J. Wysocki <[email protected]> Acked-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Hanjun Guo <[email protected]> Tested-by: Hanjun Guo <[email protected]> Signed-off-by: Agustin Vega-Frias <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent 566cf87 commit fa20b17

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

drivers/acpi/resource.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,19 @@ static inline bool
4343
acpi_iospace_resource_valid(struct resource *res) { return true; }
4444
#endif
4545

46+
#if IS_ENABLED(CONFIG_ACPI_GENERIC_GSI)
47+
static inline bool is_gsi(struct acpi_resource_extended_irq *ext_irq)
48+
{
49+
return ext_irq->resource_source.string_length == 0 &&
50+
ext_irq->producer_consumer == ACPI_CONSUMER;
51+
}
52+
#else
53+
static inline bool is_gsi(struct acpi_resource_extended_irq *ext_irq)
54+
{
55+
return true;
56+
}
57+
#endif
58+
4659
static bool acpi_dev_resource_len_valid(u64 start, u64 end, u64 len, bool io)
4760
{
4861
u64 reslen = end - start + 1;
@@ -470,9 +483,12 @@ bool acpi_dev_resource_interrupt(struct acpi_resource *ares, int index,
470483
acpi_dev_irqresource_disabled(res, 0);
471484
return false;
472485
}
473-
acpi_dev_get_irqresource(res, ext_irq->interrupts[index],
486+
if (is_gsi(ext_irq))
487+
acpi_dev_get_irqresource(res, ext_irq->interrupts[index],
474488
ext_irq->triggering, ext_irq->polarity,
475489
ext_irq->sharable, false);
490+
else
491+
acpi_dev_irqresource_disabled(res, 0);
476492
break;
477493
default:
478494
res->flags = 0;

0 commit comments

Comments
 (0)