[PATCH 2/2] phy: sun4i-usb: Assert reset before deasserting in phy init

Philipp Zabel p.zabel at pengutronix.de
Tue Nov 17 05:04:37 PST 2026


On Di, 2026-11-17 at 13:00 +0000, Roadbobek via B4 Relay wrote:
> From: Roadbobek <admin at roadbobek.com>
> 
> When a bootloader initializes USB before booting Linux without
> first tearing down the controller, phy->reset may already be
> deasserted when sun4i_usb_phy_init() runs.
> 
> Because reset_control_deassert() alone is a no-op on an
> already deasserted reset line, stale USB PHY state can
> persist across the bootloader-to-kernel handoff.
> 
> Assert phy->reset briefly before deasserting it in
> sun4i_usb_phy_init() so the PHY starts cleanly regardless of
> prior bootloader USB usage. Tested on an Allwinner A33 Q8
> tablet (Laser MID-786).
> 
> Signed-off-by: Roadbobek <admin at roadbobek.com>
> ---
>  drivers/phy/allwinner/phy-sun4i-usb.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/phy/allwinner/phy-sun4i-usb.c b/drivers/phy/allwinner/phy-sun4i-usb.c
> index f26eed0db17e..05e6dcf035a1 100644
> --- a/drivers/phy/allwinner/phy-sun4i-usb.c
> +++ b/drivers/phy/allwinner/phy-sun4i-usb.c
> @@ -270,6 +270,8 @@ static int sun4i_usb_phy_init(struct phy *_phy)
>  		return ret;
>  	}
>  
> +	reset_control_assert(phy->reset);

No error handling?

> +	usleep_range(10, 20);
>  	ret = reset_control_deassert(phy->reset);
>  	if (ret) {
>  		clk_disable_unprepare(phy->clk2);

regards
Philipp



More information about the linux-phy mailing list