dmaengine: acpi: Check for errors from acpi_register_gsi() separately
PATCH 1/1 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.
--- drivers/dma/acpi-dma.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/dma/acpi-dma.c +9 -1
@@ -75,8 +75,16 @@ static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp, si->mmio_base_high != upper_32_bits(mem))return 0 ; -/* Match device by Linux vIRQ */ +/* +* acpi_gsi_to_irq() can't be used because some platforms do not save +* registered IRQs in the MP table. Instead we just try to register +* the GSI, which is the core part of the above mentioned function. +*/ ret =acpi_register_gsi (NULL , si->gsi_interrupt, si->interrupt_mode, si->interrupt_polarity); +if (ret <0 ) +return 0 ; + +/* Match device by Linux vIRQ */ if (ret != irq)return 0 ;
Signature · 1 line
2.30.2
Vinod Koul
maintainerQuoted 7 lines · Andy Shevchenko
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 callacpi_register_gsi()instead.
patch fails to apply, pls rebase
Quoted 30 lines
Signed-off-by Andy Shevchenko <[email protected]>--- drivers/dma/acpi-dma.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)drivers/dma/acpi-dma.c +9
-1@@ -75,8 +75,16 @@ static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp, si->mmio_base_high != upper_32_bits(mem))return 0 ; -/* Match device by Linux vIRQ */ +/* +* acpi_gsi_to_irq() can't be used because some platforms do not save +* registered IRQs in the MP table. Instead we just try to register +* the GSI, which is the core part of the above mentioned function. +*/ ret =acpi_register_gsi (NULL , si->gsi_interrupt, si->interrupt_mode, si->interrupt_polarity); +if (ret <0 ) +return 0 ; + +/* Match device by Linux vIRQ */ if (ret != irq)return 0 ;Signature · 1 line
2.30.2
Signature · 1 line
~Vinod
Quoted 10 lines · Vinod Koul
Quoted 7 lines · Andy Shevchenko
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 callacpi_register_gsi()instead.patch fails to apply, pls rebase
I don't see that you applied the previous patch [1]. Care to apply it, please?
[1]: https://lore.kernel.org/dmaengine/[email protected]/T/#u
Signature · 2 lines
With Best Regards, Andy Shevchenko
Vinod Koul
maintainerQuoted 7 lines · Andy Shevchenko
Quoted 6 lines · Vinod Koul
Quoted 5 lines · Andy Shevchenko
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.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Besides that, append documentation to tell why
acpi_gsi_to_irq()can't be used and we callacpi_register_gsi()instead.patch fails to apply, pls rebase
I don't see that you applied the previous patch [1]. Care to apply it, please?
Sorry, somehow that one was pushed to queue but never got applied!
Have applied both now
Quoted 7 lines
[1]: https://lore.kernel.org/dmaengine/[email protected]/T/#u
Signature · 2 lines
With Best Regards, Andy Shevchenko
Signature · 1 line
~Vinod