Skip to content

Commit 15cb032

Browse files
andy-shevvinodkoul
authored andcommitted
dmaengine: acpi: Check for errors from acpi_register_gsi() separately
While IRQ test agaist the returned variable in practice is a good enough there is still a room for theoretical mistake in case the vIRQ of the device contains the same error code that acpi_register_gsi() may return. Due to this, check for error code separately from matching the vIRQs. Besides that, append documentation to tell why acpi_gsi_to_irq() can't be used and we call acpi_register_gsi() instead. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 67db87d commit 15cb032

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/dma/acpi-dma.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,16 @@ static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp,
7575
si->mmio_base_high != upper_32_bits(mem))
7676
return 0;
7777

78-
/* Match device by Linux vIRQ */
78+
/*
79+
* acpi_gsi_to_irq() can't be used because some platforms do not save
80+
* registered IRQs in the MP table. Instead we just try to register
81+
* the GSI, which is the core part of the above mentioned function.
82+
*/
7983
ret = acpi_register_gsi(NULL, si->gsi_interrupt, si->interrupt_mode, si->interrupt_polarity);
84+
if (ret < 0)
85+
return 0;
86+
87+
/* Match device by Linux vIRQ */
8088
if (ret != irq)
8189
return 0;
8290

0 commit comments

Comments
 (0)