Linux-PHY Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: linux-phy@lists.infradead.org, vkoul@kernel.org,
	neil.armstrong@linaro.org, olteanv@gmail.com
Subject: Re: [PATCH v18 5/7] phy: rockchip: usbdp: Re-init PHY on mux change
Date: Thu, 19 Nov 2026 19:54:54 +0000	[thread overview]
Message-ID: <sashiko-outbox-223985@kernel.org> (raw)
In-Reply-To: <20261119-b4-rockchip-usbdp-cleanup-part3-v18-5-fb325e336494@collabora.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] phy: rockchip: usbdp: missing PHY re-init in
  rk_udphy_orien_sw_set()
--

commit d39ec87ebe55de6d04fd645f2dc5add42612f593
Author: Sebastian Reichel <sebastian.reichel@collabora.com>

phy: rockchip: usbdp: Re-init PHY on mux change

This commit calls rk_udphy_update_power_state() in rk_udphy_typec_mux_set()
to re-initialize the PHY when the Type-C mux state changes.

> diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c
> index 140bec887a5ef..e4bbcb4edeae6 100644
> --- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
> +++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
> @@ -1438,7 +1438,7 @@ static int rk_udphy_typec_mux_set(struct typec_mux_dev *mux,
>  
>  	rk_udphy_set_typec_state(udphy, state->mode);
>  
> -	return 0;
> +	return rk_udphy_update_power_state(udphy);
>  }
>  
>  static void rk_udphy_typec_mux_unregister(void *data)

[Severity: Medium]
Should rk_udphy_orien_sw_set() also call rk_udphy_update_power_state()?

When cable orientation changes, rk_udphy_orien_sw_set() sets
udphy->phy_needs_reinit = true and updates udphy->lane_mux_sel and
udphy->hw_mode via rk_udphy_set_typec_default_mapping(), but returns 0
without re-initializing the PHY:

drivers/phy/rockchip/phy-rockchip-usbdp.c:rk_udphy_orien_sw_set() {
    ...
	if (udphy->flip != flipped) {
		dev_dbg(udphy->dev, "cable orientation changed, PHY re-init required.\n");
		udphy->phy_needs_reinit = true;
	}

	udphy->flip = flipped;
	rk_udphy_set_typec_default_mapping(udphy);
	rk_udphy_usb_bvalid_enable(udphy, true);

	return 0;
}

On boards that specify orientation-switch without mode-switch (such as
rk3588-jaguar.dts), or with Type-C controller drivers that do not call
typec_set_mode() after typec_set_orientation(), rk_udphy_typec_mux_set()
is not invoked after the orientation change and the PHY is never
re-initialized for the new lane mapping.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-b4-rockchip-usbdp-cleanup-part3-v18-0-fb325e336494@collabora.com?part=5

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2026-11-19 19:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 19:40 [PATCH v18 0/7] phy: rockchip: usbdp: Fix runtime muxing between USB3 and DP Sebastian Reichel
2026-11-19 19:40 ` [PATCH v18 1/7] phy: rockchip: usbdp: Disable USB3 port during normal power-on Sebastian Reichel
2026-11-19 19:40 ` [PATCH v18 2/7] phy: rockchip: usbdp: Drop -EPROBE_DEFER hack Sebastian Reichel
2026-11-19 19:40 ` [PATCH v18 3/7] phy: rockchip: usbdp: Rename mode to hw_mode Sebastian Reichel
2026-11-19 19:40 ` [PATCH v18 4/7] phy: rockchip: usbdp: Fix power state handling Sebastian Reichel
2026-11-19 20:02   ` sashiko-bot
2026-11-19 19:40 ` [PATCH v18 5/7] phy: rockchip: usbdp: Re-init PHY on mux change Sebastian Reichel
2026-11-19 19:54   ` sashiko-bot [this message]
2026-11-19 19:40 ` [PATCH v18 6/7] phy: rockchip: usbdp: Add USB-C state without DP enabled Sebastian Reichel
2026-11-19 20:02   ` sashiko-bot
2026-11-19 19:40 ` [PATCH v18 7/7] phy: rockchip: usbdp: Add DP lane setup to power state update Sebastian Reichel

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-223985@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=neil.armstrong@linaro.org \
    --cc=olteanv@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sebastian.reichel@collabora.com \
    --cc=vkoul@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