From: Shawn Guo <shawnguo@kernel.org>
To: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Cc: leoyang.li@nxp.com, robh+dt@kernel.org,
krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] arm64: dts: ls208xa: use a pseudo-bus to constrain usb dma size
Date: Mon, 25 Sep 2023 10:50:58 +0800 [thread overview]
Message-ID: <20230925025058.GE7231@dragon> (raw)
In-Reply-To: <20230914155935.6042-1-laurentiu.tudor@nxp.com>
On Thu, Sep 14, 2023 at 06:59:35PM +0300, Laurentiu Tudor wrote:
> Wrap the usb controllers in an intermediate simple-bus and use it to
> constrain the dma address size of these usb controllers to the 40b
> that they generate toward the interconnect. This is required because
> the SoC uses 48b address sizes and this mismatch would lead to smmu
> context faults [1] because the usb generates 40b addresses while the
> smmu page tables are populated with 48b wide addresses.
>
> [1]
> xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
> xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
> xhci-hcd xhci-hcd.0.auto: hcc params 0x0220f66d hci version 0x100 quirks 0x0000000002000010
> xhci-hcd xhci-hcd.0.auto: irq 108, io mem 0x03100000
> xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
> xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
> xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
> arm-smmu 5000000.iommu: Unhandled context fault: fsr=0x402, iova=0xffffffb000, fsynr=0x0, cbfrsynra=0xc01, cb=3
>
> Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
> ---
> Changes in v2:
> - renamed pseudo-bus from 'aux_bus' to just 'bus'
>
> .../arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 46 +++++++++++--------
> 1 file changed, 27 insertions(+), 19 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
> index d2f5345d0560..6c311c61c5bc 100644
> --- a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
> +++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi
> @@ -1186,26 +1186,34 @@
> dma-coherent;
> };
>
> - usb0: usb@3100000 {
> - status = "disabled";
> - compatible = "snps,dwc3";
> - reg = <0x0 0x3100000 0x0 0x10000>;
> - interrupts = <0 80 0x4>; /* Level high type */
> - dr_mode = "host";
> - snps,quirk-frame-length-adjustment = <0x20>;
> - snps,dis_rxdet_inp3_quirk;
> - snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
> - };
> + bus: bus {
> + #address-cells = <2>;
> + #size-cells = <2>;
> + compatible = "simple-bus";
> + ranges;
> + dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x00000000>;
> +
> + usb0: usb@3100000 {
> + status = "disabled";
While you are at it, could you move 'status' to end of the property
list?
Shawn
> + compatible = "snps,dwc3";
> + reg = <0x0 0x3100000 0x0 0x10000>;
> + interrupts = <0 80 0x4>; /* Level high type */
> + dr_mode = "host";
> + snps,quirk-frame-length-adjustment = <0x20>;
> + snps,dis_rxdet_inp3_quirk;
> + snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
> + };
>
> - usb1: usb@3110000 {
> - status = "disabled";
> - compatible = "snps,dwc3";
> - reg = <0x0 0x3110000 0x0 0x10000>;
> - interrupts = <0 81 0x4>; /* Level high type */
> - dr_mode = "host";
> - snps,quirk-frame-length-adjustment = <0x20>;
> - snps,dis_rxdet_inp3_quirk;
> - snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
> + usb1: usb@3110000 {
> + status = "disabled";
> + compatible = "snps,dwc3";
> + reg = <0x0 0x3110000 0x0 0x10000>;
> + interrupts = <0 81 0x4>; /* Level high type */
> + dr_mode = "host";
> + snps,quirk-frame-length-adjustment = <0x20>;
> + snps,dis_rxdet_inp3_quirk;
> + snps,incr-burst-type-adjustment = <1>, <4>, <8>, <16>;
> + };
> };
>
> ccn@4000000 {
> --
> 2.17.1
>
prev parent reply other threads:[~2023-09-25 2:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-14 15:59 [PATCH v2] arm64: dts: ls208xa: use a pseudo-bus to constrain usb dma size Laurentiu Tudor
2023-09-25 2:50 ` Shawn Guo [this message]
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=20230925025058.GE7231@dragon \
--to=shawnguo@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=laurentiu.tudor@nxp.com \
--cc=leoyang.li@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@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).