linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: linux-arm-kernel@lists.infradead.org
Cc: catalin.marinas@arm.com, lorenzo.pieralisi@arm.com,
	will@kernel.org, robin.murphy@arm.com,
	Ard Biesheuvel <ardb@kernel.org>
Subject: [PATCH] arm64: iort: take _DMA methods into account for named components
Date: Sat,  4 Apr 2020 09:30:47 +0200	[thread overview]
Message-ID: <20200404073047.17898-1-ardb@kernel.org> (raw)

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

             reply	other threads:[~2020-04-04  7:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-04  7:30 Ard Biesheuvel [this message]
2020-04-06 11:04 ` [PATCH] arm64: iort: take _DMA methods into account for named components 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200404073047.17898-1-ardb@kernel.org \
    --to=ardb@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).