All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Junzhong Pan" <panjunzhong@linux.spacemit.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH 4/6] riscv: dts: spacemit: add USB2.0 controller nodes for K1
Date: Wed, 12 Aug 2026 09:51:28 +0000	[thread overview]
Message-ID: <20260812095128.BFAF81F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260812-b4-spacemit-k1-usb2-v1-4-f28cf29e522b@linux.spacemit.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] The newly added `usb2_0` and `usb2_1` controllers are instantiated under the `storage-bus` node, which has a restrictive `dma-ranges` property that excludes system RAM, preventing DMA operations for these controllers.
--

--- Patch [4]: [PATCH 4/6] riscv: dts: spacemit: add USB2.0 controller nodes for K1 ---
commit 574278a69410138bf5c5e246489a12433bf57db8
Author: Junzhong Pan <panjunzhong@linux.spacemit.com>

riscv: dts: spacemit: add USB2.0 controller nodes for K1

This commit adds two ChipIdea USB2.0 controllers to the SpacemiT K1
SoC device tree. One controller is configured for Dual-Role (OTG)
and the other is Host Only.

> diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
> index 08a0f28d011fe..aa35a34892503 100644
> --- a/arch/riscv/boot/dts/spacemit/k1.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k1.dtsi

[ ... ]

> @@ -1291,6 +1307,30 @@ storage-bus {
>  			#size-cells = <2>;
>  			dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>;
>  
> +			usb2_0: usb@c0900000 {
> +				compatible = "spacemit,k1-usb2";
> +				reg = <0x0 0xc0900000 0x0 0x4100>;
> +				interrupts = <105>;
> +				clocks = <&syscon_apmu CLK_USB_AXI>;
> +				resets = <&syscon_apmu RESET_USB_AXI>;
> +				phys = <&usbphy0>;
> +				phy-names = "usb-phy";
> +				dr_mode = "otg";
> +				status = "disabled";
> +			};
> +
> +			usb2_1: usb@c0980000 {

[Severity: High]
This isn't a bug introduced by this patch, but will these new USB controllers
fail to perform DMA operations because of the storage-bus node's dma-ranges
property?

The parent storage-bus node defines:
dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>;

This restricts DMA accesses to physical addresses between 0x0 and 0x7FFFFFFF.
Since the system RAM on this SoC starts at 0x100000000 (above the 4GB
boundary), will the kernel's DMA subsystem reject mappings for data buffers
or descriptors located in RAM?

Placing these new DMA-capable USB nodes under storage-bus seems to guarantee
they will fail to map memory.

> +				compatible = "spacemit,k1-usb2";
> +				reg = <0x0 0xc0980000 0x0 0x4100>;
> +				interrupts = <118>;
> +				clocks = <&syscon_apmu CLK_USB_P1>;
> +				resets = <&syscon_apmu RESET_USBP1_AXI>;
> +				phys = <&usbphy1>;
> +				phy-names = "usb-phy";
> +				dr_mode = "host";
> +				status = "disabled";
> +			};
> +
>  			usb_dwc3: usb@c0a00000 {
>  				compatible = "spacemit,k1-dwc3";
>  				reg = <0x0 0xc0a00000 0x0 0x10000>;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260812-b4-spacemit-k1-usb2-v1-0-f28cf29e522b@linux.spacemit.com?part=4

  reply	other threads:[~2026-08-12  9:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-12  9:26 [PATCH 0/6] Add SpacemiT K1 USB2.0 controllers support Junzhong Pan
2026-08-12  9:26 ` Junzhong Pan
2026-08-12  9:26 ` [PATCH 1/6] dt-bindings: usb: ci-hdrc-usb2: add spacemit,k1-usb2 compatible Junzhong Pan
2026-08-12  9:26   ` Junzhong Pan
2026-08-12 16:00   ` Conor Dooley
2026-08-12 16:00     ` Conor Dooley
2026-08-12  9:26 ` [PATCH 2/6] usb: chipidea: usb2: add optional reset support Junzhong Pan
2026-08-12  9:26   ` Junzhong Pan
2026-08-12  9:41   ` sashiko-bot
2026-08-12 10:04     ` Junzhong Pan
2026-08-12  9:26 ` [PATCH 3/6] usb: chipidea: usb2: add SpacemiT K1 support Junzhong Pan
2026-08-12  9:26   ` Junzhong Pan
2026-08-12  9:26 ` [PATCH 4/6] riscv: dts: spacemit: add USB2.0 controller nodes for K1 Junzhong Pan
2026-08-12  9:26   ` Junzhong Pan
2026-08-12  9:51   ` sashiko-bot [this message]
2026-08-12 10:12     ` Junzhong Pan
2026-08-12  9:26 ` [PATCH 5/6] riscv: dts: spacemit: enable USB2.0 controllers on BananaPi F3 Junzhong Pan
2026-08-12  9:26   ` Junzhong Pan
2026-08-12  9:26 ` [PATCH 6/6] riscv: defconfig: enable ChipIdea USB controller support Junzhong Pan
2026-08-12  9:26   ` Junzhong Pan

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=20260812095128.BFAF81F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=panjunzhong@linux.spacemit.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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.