mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: admin@roadbobek.com, Bin Liu <b-liu@ti.com>,
	Greg Kroah-Hartman	 <gregkh@linuxfoundation.org>,
	Chen-Yu Tsai <wens@kernel.org>,
	Jernej Skrabec	 <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Vinod Koul	 <vkoul@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Manivannan Sadhasivam <mani@kernel.org>
Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	 linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
	 linux-phy@lists.infradead.org
Subject: Re: [PATCH 2/2] phy: sun4i-usb: Assert reset before deasserting in phy init
Date: Tue, 17 Nov 2026 14:04:37 +0100	[thread overview]
Message-ID: <80d4ca224b264acd5a2496ce5920e2dffd5f50b3.camel@pengutronix.de> (raw)
In-Reply-To: <20261117-usb-sunxi-reset-fix-v1-2-c2b76e0e84e1@roadbobek.com>

On Di, 2026-11-17 at 13:00 +0000, Roadbobek via B4 Relay wrote:
> From: Roadbobek <admin@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@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

  reply	other threads:[~2026-11-17 13:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 13:00 [PATCH 0/2] usb/phy: sunxi: Assert reset before deasserting on init Roadbobek via B4 Relay
2026-11-17 13:00 ` [PATCH 1/2] usb: musb: " Roadbobek via B4 Relay
2026-11-17 13:05   ` Philipp Zabel
2026-11-17 13:00 ` [PATCH 2/2] phy: sun4i-usb: Assert reset before deasserting in phy init Roadbobek via B4 Relay
2026-11-17 13:04   ` Philipp Zabel [this message]
2026-11-17 13:04 ` [PATCH 0/2] usb/phy: sunxi: Assert reset before deasserting on init Philipp Zabel

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=80d4ca224b264acd5a2496ce5920e2dffd5f50b3.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=admin@roadbobek.com \
    --cc=b-liu@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-phy@lists.infradead.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=linux-usb@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=samuel@sholland.org \
    --cc=vkoul@kernel.org \
    --cc=wens@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

all inboxes | Powered by JetHome®