All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Andy Gross <andy.gross@linaro.org>,
	David Brown <david.brown@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Stephen Boyd <swboyd@chromium.org>,
	Doug Anderson <dianders@chromium.org>
Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 2/2] arm64: dts: qcom: sdm845: Extend ranges and describe DMA space
Date: Wed, 16 Jan 2019 20:29:40 -0800	[thread overview]
Message-ID: <20190117042940.25487-3-bjorn.andersson@linaro.org> (raw)
In-Reply-To: <20190117042940.25487-1-bjorn.andersson@linaro.org>

For devices attached to an IOMMU, translation between IOVA and physical
addresses is no longer 1:1 and dma-ranges should be specified to
describe the available IOVA address space.

On SDM845 the busses are implemented with 36 address bits, so dma-ranges
must be defined to reduce the size of the IOVA address space from the 48
bits supported by the SMMU. Without this DMA allocations may end up with
IOVAs outside the valid range, that gets truncated by the bus between
the device and its translation unit.

Also extend ranges to describe the available address space.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---

Changes since v3:
- Split this out from patch 1.
- Rewrote commit message from scratch

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 9867d42dc836..143c5af32e7b 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -353,7 +353,8 @@
 	soc: soc {
 		#address-cells = <2>;
 		#size-cells = <2>;
-		ranges = <0 0 0 0 0 0xffffffff>;
+		ranges = <0 0 0 0 0x10 0>;
+		dma-ranges = <0 0 0 0 0x10 0>;
 		compatible = "simple-bus";
 
 		gcc: clock-controller@100000 {
-- 
2.18.0

  parent reply	other threads:[~2019-01-17  4:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17  4:29 [PATCH v4 0/2] arm64: dts: qcom: sdm845: Fix DMA allocations for devices with IOMMU Bjorn Andersson
2019-01-17  4:29 ` [PATCH v4 1/2] arm64: dts: qcom: sdm845: Increase address and size cells for soc Bjorn Andersson
2019-01-17 17:47   ` Doug Anderson
2019-01-17 18:05   ` Stephen Boyd
2019-01-17  4:29 ` Bjorn Andersson [this message]
2019-01-17 17:47   ` [PATCH v4 2/2] arm64: dts: qcom: sdm845: Extend ranges and describe DMA space Doug Anderson
2019-01-17 18:22   ` Stephen Boyd
2019-01-18 13:05 ` [PATCH v4 0/2] arm64: dts: qcom: sdm845: Fix DMA allocations for devices with IOMMU Srinivas Kandagatla

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=20190117042940.25487-3-bjorn.andersson@linaro.org \
    --to=bjorn.andersson@linaro.org \
    --cc=andy.gross@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=swboyd@chromium.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 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.