diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2021-07-30 23:27:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-26 14:37:28 +0300 |
commit | f95cf346c9b7b2061fb87d1fa902b3c0b94dd362 (patch) | |
tree | c52621b5bfa34c4d5f1dd4af73ae8449348e7cb4 /drivers/dma/acpi-dma.c | |
parent | 6c4a5606951cf2be8cbed4d4aefbbeaedb4cb24f (diff) | |
download | linux-f95cf346c9b7b2061fb87d1fa902b3c0b94dd362.tar.xz |
dmaengine: acpi: Avoid comparison GSI with Linux vIRQ
commit 67db87dc8284070adb15b3c02c1c31d5cf51c5d6 upstream.
Currently the CRST parsing relies on the fact that on most of x86 devices
the IRQ mapping is 1:1 with Linux vIRQ. However, it may be not true for
some. Fix this by converting GSI to Linux vIRQ before checking it.
Fixes: ee8209fd026b ("dma: acpi-dma: parse CSRT to extract additional resources")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20210730202715.24375-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/dma/acpi-dma.c')
-rw-r--r-- | drivers/dma/acpi-dma.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/dma/acpi-dma.c b/drivers/dma/acpi-dma.c index 8d99c84361cb..22ec10c71d81 100644 --- a/drivers/dma/acpi-dma.c +++ b/drivers/dma/acpi-dma.c @@ -72,10 +72,14 @@ 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; + + /* Match device by Linux vIRQ */ + ret = acpi_register_gsi(NULL, si->gsi_interrupt, si->interrupt_mode, si->interrupt_polarity); + if (ret != irq) return 0; dev_dbg(&adev->dev, "matches with %.4s%04X (rev %u)\n", |