Skip to content

Commit 7fb89e1

Browse files
ardbiesheuvelwilldeacon
authored andcommitted
ACPI/IORT: take _DMA methods into account for named components
Where IORT nodes for named components can describe simple DMA limits expressed as the number of address bits a device can drive, _DMA methods in AML can express more complex topologies, involving DMA translation in particular. Currently, we only take this _DMA method into account if it appears on a ACPI device node describing a PCIe root complex, but it is perfectly acceptable to use them for named components as well, so let's ensure we take them into account in those cases too. Note that such named components are expected to reside under a pseudo-bus node such as the ACPI0004 container device, which should be providing the _DMA method as well as a _CRS (as mandated by the ACPI spec). This is not enforced by the code however. Reported-by: Andrei Warkentin <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Acked-by: Lorenzo Pieralisi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 6a8b55e commit 7fb89e1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/acpi/arm64/iort.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,13 +1148,10 @@ void iort_dma_setup(struct device *dev, u64 *dma_addr, u64 *dma_size)
11481148
else
11491149
size = 1ULL << 32;
11501150

1151-
if (dev_is_pci(dev)) {
1152-
ret = acpi_dma_get_range(dev, &dmaaddr, &offset, &size);
1153-
if (ret == -ENODEV)
1154-
ret = rc_dma_get_range(dev, &size);
1155-
} else {
1156-
ret = nc_dma_get_range(dev, &size);
1157-
}
1151+
ret = acpi_dma_get_range(dev, &dmaaddr, &offset, &size);
1152+
if (ret == -ENODEV)
1153+
ret = dev_is_pci(dev) ? rc_dma_get_range(dev, &size)
1154+
: nc_dma_get_range(dev, &size);
11581155

11591156
if (!ret) {
11601157
/*

0 commit comments

Comments
 (0)