Merge tag 'pm-5.15-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
[linux-2.6-microblaze.git] / drivers / dma / acpi-dma.c
index 235f139..5906eae 100644 (file)
@@ -70,10 +70,22 @@ static int acpi_dma_parse_resource_group(const struct acpi_csrt_group *grp,
 
        si = (const struct acpi_csrt_shared_info *)&grp[1];
 
-       /* Match device by MMIO and IRQ */
+       /* Match device by MMIO */
        if (si->mmio_base_low != lower_32_bits(mem) ||
-           si->mmio_base_high != upper_32_bits(mem) ||
-           si->gsi_interrupt != irq)
+           si->mmio_base_high != upper_32_bits(mem))
+               return 0;
+
+       /*
+        * 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;
 
        dev_dbg(&adev->dev, "matches with %.4s%04X (rev %u)\n",