All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: iort: take _DMA methods into account for named components
@ 2020-04-04  7:30 Ard Biesheuvel
  2020-04-06 11:04 ` Lorenzo Pieralisi
  2020-04-20  8:40 ` Lorenzo Pieralisi
  0 siblings, 2 replies; 13+ messages in thread
From: Ard Biesheuvel @ 2020-04-04  7:30 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: catalin.marinas, lorenzo.pieralisi, will, robin.murphy, Ard Biesheuvel

Where IORT nodes for named components can describe simple DMA limits
expressed as the number of address bits a device can driver, _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 attach them to named components as well, so let's ensure
we take them into account in those cases too.

Reported-by: Andrei Warkentin <awarkentin@vmware.com>
Fixes: 7ad4263980826e8b ("ACPI: Make acpi_dma_configure() DMA regions aware")
Cc: <stable@vger.kernel.org> # v4.14+
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
 drivers/acpi/arm64/iort.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index ed3d2d1a7ae9..07eb78baf198 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -1146,13 +1146,10 @@ void iort_dma_setup(struct device *dev, u64 *dma_addr, u64 *dma_size)
 	else
 		size = 1ULL << 32;
 
-	if (dev_is_pci(dev)) {
-		ret = acpi_dma_get_range(dev, &dmaaddr, &offset, &size);
-		if (ret == -ENODEV)
-			ret = rc_dma_get_range(dev, &size);
-	} else {
-		ret = nc_dma_get_range(dev, &size);
-	}
+	ret = acpi_dma_get_range(dev, &dmaaddr, &offset, &size);
+	if (ret == -ENODEV)
+		ret = dev_is_pci(dev) ? rc_dma_get_range(dev, &size)
+				      : nc_dma_get_range(dev, &size);
 
 	if (!ret) {
 		/*
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-04-28 17:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-04  7:30 [PATCH] arm64: iort: take _DMA methods into account for named components Ard Biesheuvel
2020-04-06 11:04 ` Lorenzo Pieralisi
2020-04-06 11:16   ` Ard Biesheuvel
2020-04-06 11:32     ` Lorenzo Pieralisi
2020-04-06 11:59       ` Ard Biesheuvel
2020-04-06 13:14         ` Lorenzo Pieralisi
2020-04-06 13:19           ` Ard Biesheuvel
2020-04-19 12:21             ` Ard Biesheuvel
2020-04-20  8:40 ` Lorenzo Pieralisi
2020-04-20  8:58   ` Ard Biesheuvel
2020-04-20  9:13     ` Lorenzo Pieralisi
2020-04-20  9:14       ` Ard Biesheuvel
2020-04-28 17:01         ` Will Deacon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.