[PATCH] phy: rockchip: inno-usb2: ensure PHY is running when clock is requested

sashiko-bot at kernel.org sashiko-bot at kernel.org
Tue Sep 8 09:20:12 PDT 2026


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

Pre-existing issues:
- [High] Missing .remove callback leaves delayed works pending after driver unbind.
--

commit bf4a39e5deb580ca9fd1ce23137a41fc39aa2be7
Author: Sebastian Reichel <sebastian.reichel at collabora.com>

phy: rockchip: inno-usb2: ensure PHY is running when clock is requested

This commit resumes the suspended PHY in the clock's prepare function.
By doing so, it ensures the PHY's 480MHz clock is running when requested
by the OHCI controller on RK3588, which prevents a board hang after
system suspend.

> diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> index 7d8a533f24aea..07d400967def6 100644
> --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
> +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c

[ ... ]

[Severity: High]
This isn't a bug introduced by this patch, but it is a pre-existing
issue. Does the lack of a .remove callback leave delayed works pending
after the driver unbinds?

Looking at rockchip_usb2phy_driver, it does not define a .remove callback:

drivers/phy/rockchip/phy-rockchip-inno-usb2.c:rockchip_usb2phy_driver {
	static struct platform_driver rockchip_usb2phy_driver = {
		.probe		= rockchip_usb2phy_probe,
		.driver		= {
			.name	= "rockchip-usb2phy",
			.of_match_table = rockchip_usb2phy_dt_match,
		},
	};
}

And the delayed work sm_work reschedules itself:

drivers/phy/rockchip/phy-rockchip-inno-usb2.c:rockchip_usb2phy_sm_work() {
    [ ... ]
    next_schedule:
	mutex_unlock(&rport->mutex);
	schedule_delayed_work(&rport->sm_work, SCHEDULE_DELAY);
}

If the driver is unbound while delayed works like sm_work are scheduled,
devres will immediately free the driver's memory. Because the driver lacks
a .remove callback to synchronously cancel the work, will the delayed works
access freed memory when they execute?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260908-phy-rockchip-inno-usb2-clock-fix-v1-1-f7d59c31b908@collabora.com?part=1



More information about the linux-phy mailing list