From: sashiko-bot@kernel.org
To: "Sebastian Reichel" <sebastian.reichel@collabora.com>
Cc: olteanv@gmail.com, linux-phy@lists.infradead.org,
vkoul@kernel.org, neil.armstrong@linaro.org
Subject: Re: [PATCH v2 3/4] phy: rockchip: inno-usb2: move suspend handling into new function
Date: Thu, 01 Oct 2026 13:21:26 +0000 [thread overview]
Message-ID: <20261001132127.2B3441F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20261001-phy-rockchip-inno-usb2-clock-fix-v2-3-e01bf509359e@collabora.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] phy: rockchip: inverted logic in rockchip_usb2phy_set_suspend()
--
commit 559f37e7fcbd18c0d269eb9a711cca723c264b19
Author: Sebastian Reichel <sebastian.reichel@collabora.com>
phy: rockchip: inno-usb2: move suspend handling into new function
This commit refactors the PHY suspend handling into its own dedicated helper
function. It is intended to produce no functional changes to the driver.
> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> index e4d8abf935c1b..925a03fee6bc5 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> @@ -332,6 +332,35 @@ rockchip_usb2phy_clk480m_clkout_ctl(struct clk_hw *hw, struct regmap **base,
> }
> }
>
> +static int rockchip_usb2phy_set_suspend(struct rockchip_usb2phy *rphy,
> + struct rockchip_usb2phy_port *rport,
> + bool do_suspend)
> +{
> + int ret;
> +
> + ret = property_enable(rphy->grf, &rport->port_cfg->phy_sus, !do_suspend);
[Severity: High]
Does this helper invert the intended logic?
In the original code, rockchip_usb2phy_power_on() called property_enable()
with false to clear the suspend property, and rockchip_usb2phy_power_off()
called it with true to set the property.
By passing !do_suspend here, when callers want to exit suspend and pass
false, we end up passing true to property_enable(). This seems to reverse
the hardware state for suspend and resume operations.
[ ... ]
> @@ -603,27 +632,12 @@ static int rockchip_usb2phy_power_on(struct phy *phy)
> if (ret)
> return ret;
>
> - ret = property_enable(rphy->grf, &rport->port_cfg->phy_sus, false);
> + ret = rockchip_usb2phy_set_suspend(rphy, rport, false);
[Severity: High]
Could this cause the PHY to incorrectly suspend when we're trying to power
it on?
When rockchip_usb2phy_power_on() calls rockchip_usb2phy_set_suspend() with
false, the new helper will execute property_enable(..., true).
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261001-phy-rockchip-inno-usb2-clock-fix-v2-0-e01bf509359e@collabora.com?part=3
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2026-10-01 13:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-01 13:12 [PATCH v2 0/4] phy: rockchip: inno-usb2: ensure PHY is running when clock is requested Sebastian Reichel
2026-10-01 13:12 ` [PATCH v2 1/4] phy: rockchip: inno-usb2: simplify and unify PHY op debug messages Sebastian Reichel
2026-10-01 13:12 ` [PATCH v2 2/4] phy: rockchip: inno-usb2: drop duplicated update of rport->suspended Sebastian Reichel
2026-10-01 13:23 ` sashiko-bot
2026-10-01 13:12 ` [PATCH v2 3/4] phy: rockchip: inno-usb2: move suspend handling into new function Sebastian Reichel
2026-10-01 13:21 ` sashiko-bot [this message]
2026-10-01 13:12 ` [PATCH v2 4/4] phy: rockchip: inno-usb2: move suspend handling into clock prepare/unprepare for RK3588/RK3576 Sebastian Reichel
2026-10-01 13:23 ` sashiko-bot
2026-10-01 21:34 ` [PATCH v2 0/4] phy: rockchip: inno-usb2: ensure PHY is running when clock is requested Sebastian Reichel
2026-10-03 14:33 ` Vinod Koul
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=20261001132127.2B3441F000FF@smtp.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