All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Laurentiu Mihalcea" <laurentiumihalcea111@gmail.com>
Cc: devicetree@vger.kernel.org, imx@lists.linux.dev, robh@kernel.org,
	conor+dt@kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH] arm64: dts: imx95-navq: add USB1/USB2 nodes
Date: Mon, 26 Oct 2026 18:44:28 +0000	[thread overview]
Message-ID: <sashiko-outbox-185636@kernel.org> (raw)
In-Reply-To: <20261026182150.11330-1-laurentiumihalcea111@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] arm64: dts: imx95-navq: usb2 dr_mode = host breaks usb-role-switch
--

commit 7aa413a1299c4bee8b5a2613c0acf6256cd30c16
Author: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

arm64: dts: imx95-navq: add USB1/USB2 nodes

This commit adds and enables the device tree nodes for the USB1 and USB2
controllers and their Type-C port controllers on the imx95-navq board.

> diff --git a/arch/arm64/boot/dts/freescale/imx95-navq.dts b/arch/arm64/boot/dts/freescale/imx95-navq.dts
> index 7860c113e9e02..5fe245b623068 100644
> --- a/arch/arm64/boot/dts/freescale/imx95-navq.dts
> +++ b/arch/arm64/boot/dts/freescale/imx95-navq.dts

[ ... ]

> @@ -80,6 +82,72 @@ i2c3_gpio_expander_21: gpio-expander@21 {

[ ... ]

> +	ptn5110_usb2: tcpc@51 {
> +		compatible = "nxp,ptn5110", "tcpci";
> +		reg = <0x51>;
> +		interrupt-parent = <&gpio4>;
> +		interrupts = <25 IRQ_TYPE_LEVEL_LOW>;
> +		pinctrl-0 = <&pinctrl_typec>;
> +		pinctrl-names = "default";
> +
> +		/* no SINK circuit (EN_SINK1 tied to TP30) */
> +		connector {
> +			compatible = "usb-c-connector";
> +			label = "USB2 2.0 Type C";
> +			data-role = "dual";
> +			power-role = "source";
> +			self-powered;
> +			source-pdos = <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>;
> +
> +			port {
> +				typec2_con_hs: endpoint {
> +					remote-endpoint = <&usb2_data_hs>;
> +				};
> +			};
> +		};
> +	};
>  };

[ ... ]

> @@ -198,6 +270,55 @@ pinctrl_usdhc2: usdhc2grp {
>  	};
>  };
>  
> +&usb2 {
> +	disable-over-current;
> +	dr_mode = "host";
> +	usb-role-switch;
> +
> +	status = "okay";
> +
> +	port {
> +		usb2_data_hs: endpoint {
> +			remote-endpoint = <&typec2_con_hs>;
> +		};
> +	};
> +};

[Severity: Medium]
Should usb2 use dr_mode = "otg" here instead of "host" to match the
usb-role-switch property and the connector's data-role = "dual" in
ptn5110_usb2, or should ptn5110_usb2 use data-role = "host" without
usb-role-switch on usb2?

When dr_mode is set to "host", ci_hdrc_probe() in drivers/usb/chipidea/core.c
skips initializing the gadget role and OTG handling:

	if (dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_PERIPHERAL) {
		ret = ci_hdrc_gadget_init(ci);
		...
	}
	...
	if (ci->is_otg && ci->roles[CI_ROLE_GADGET]) {
		ret = ci_hdrc_otg_init(ci);
		...
	}

Because ci->roles[CI_ROLE_GADGET] remains NULL, ci_get_role() never enables
OTGSC_IDIE:

	if (ci->roles[CI_ROLE_HOST] && ci->roles[CI_ROLE_GADGET]) {
		if (ci->is_otg) {
			role = ci_otg_role(ci);
			hw_write_otgsc(ci, OTGSC_IDIE, OTGSC_IDIE);
		} else {

As a result, id_extcon.enabled and vbus_extcon.enabled remain false. Although
the Type-C port manager configures ptn5110_usb2 for dual-role data and accepts
USB PD data role swaps, calls along usb_role_switch_set_role() ->
ci_usb_role_switch_set() -> ci_irq() -> ci_irq_handler() will have OTGSC_IDIE
and OTGSC_BSVIE masked out by hw_read_otgsc(), leaving role switching
non-functional and the controller permanently in host mode.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261026182150.11330-1-laurentiumihalcea111@gmail.com?part=1

  reply	other threads:[~2026-10-26 18:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 18:21 [PATCH] arm64: dts: imx95-navq: add USB1/USB2 nodes Laurentiu Mihalcea
2026-10-26 18:44 ` sashiko-bot [this message]
2026-10-26 20:09   ` Frank Li

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=sashiko-outbox-185636@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=laurentiumihalcea111@gmail.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.