]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
dmaengine: acpi: Check for errors from acpi_register_gsi() separately
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 2 Aug 2021 17:55:32 +0000 (20:55 +0300)
committerVinod Koul <vkoul@kernel.org>
Fri, 6 Aug 2021 16:18:11 +0000 (21:48 +0530)
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 <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210802175532.54311-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/acpi-dma.c

index 52768dc8ce1248f1296a5a228060c9dd2a178629..5906eae26e2aeeddf95b05d9cf5e00c5a89c64be 100644 (file)
@@ -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;