All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: admin@roadbobek.com
Cc: Bin Liu <b-liu@ti.com>, Chen-Yu Tsai <wens@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Vinod Koul <vkoul@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Hans de Goede <hansg@kernel.org>, Felipe Balbi <balbi@ti.com>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	Maxime Ripard <mripard@kernel.org>,
	Andre Przywara <andre.przywara@arm.com>,
	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 v2 1/3] usb: musb: sunxi: Assert reset before deasserting on init
Date: Thu, 3 Dec 2026 18:49:19 +0100	[thread overview]
Message-ID: <2026120358-doorbell-isolation-91c8@gregkh> (raw)
In-Reply-To: <20261123-usb-sunxi-reset-fix-v2-1-4e51d3a64964@roadbobek.com>

On Mon, Nov 23, 2026 at 06:54:07AM +0000, Bobek Brzeczyszczykiewicz via B4 Relay wrote:
> From: Bobek Brzeczyszczykiewicz <admin@roadbobek.com>
> 
> When a bootloader such as U-Boot (for example with
> CONFIG_USB_MUSB_HOST=y) initializes MUSB and boots Linux without
> stopping USB first, the controller reset line is already deasserted at
> probe time.
> 
> In that case reset_control_deassert() in sunxi_musb_init() is a no-op
> and stale MUSB register state persists across boot. On Allwinner A33,
> MUSB stays wedged in a_wait_bcon with DevCtl=0x99, Power=0xf0, and a
> frozen Frame counter even across hot-unplug and replug.
> 
> Request exclusive reset control via devm_reset_control_get_exclusive()
> and assert glue->rst briefly before deasserting it when
> SUNXI_MUSB_FL_HAS_RESET is set so MUSB starts cleanly.
> 
> Tested on an Allwinner A33 Q8 tablet (Laser MID-786).
> 
> Fixes: 132e23775779 ("usb: musb: sunxi: Add support for musb controller in A31 SoC")
> Signed-off-by: Bobek Brzeczyszczykiewicz <admin@roadbobek.com>
> ---
>  drivers/usb/musb/sunxi.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
> index a17b1c150626..5f63d519237b 100644
> --- a/drivers/usb/musb/sunxi.c
> +++ b/drivers/usb/musb/sunxi.c
> @@ -9,6 +9,7 @@
>   */
>  
>  #include <linux/clk.h>
> +#include <linux/delay.h>
>  #include <linux/err.h>
>  #include <linux/extcon.h>
>  #include <linux/io.h>
> @@ -239,6 +240,8 @@ static int sunxi_musb_init(struct musb *musb)
>  		goto error_sram_release;
>  
>  	if (test_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags)) {
> +		reset_control_assert(glue->rst);
> +		usleep_range(10, 20);

fsleep()?

And check the result of reset_control_assert()?

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: admin@roadbobek.com
Cc: Bin Liu <b-liu@ti.com>, Chen-Yu Tsai <wens@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Vinod Koul <vkoul@kernel.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Hans de Goede <hansg@kernel.org>, Felipe Balbi <balbi@ti.com>,
	Kishon Vijay Abraham I <kishon@kernel.org>,
	Maxime Ripard <mripard@kernel.org>,
	Andre Przywara <andre.przywara@arm.com>,
	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 v2 1/3] usb: musb: sunxi: Assert reset before deasserting on init
Date: Thu, 3 Dec 2026 18:49:19 +0100	[thread overview]
Message-ID: <2026120358-doorbell-isolation-91c8@gregkh> (raw)
In-Reply-To: <20261123-usb-sunxi-reset-fix-v2-1-4e51d3a64964@roadbobek.com>

On Mon, Nov 23, 2026 at 06:54:07AM +0000, Bobek Brzeczyszczykiewicz via B4 Relay wrote:
> From: Bobek Brzeczyszczykiewicz <admin@roadbobek.com>
> 
> When a bootloader such as U-Boot (for example with
> CONFIG_USB_MUSB_HOST=y) initializes MUSB and boots Linux without
> stopping USB first, the controller reset line is already deasserted at
> probe time.
> 
> In that case reset_control_deassert() in sunxi_musb_init() is a no-op
> and stale MUSB register state persists across boot. On Allwinner A33,
> MUSB stays wedged in a_wait_bcon with DevCtl=0x99, Power=0xf0, and a
> frozen Frame counter even across hot-unplug and replug.
> 
> Request exclusive reset control via devm_reset_control_get_exclusive()
> and assert glue->rst briefly before deasserting it when
> SUNXI_MUSB_FL_HAS_RESET is set so MUSB starts cleanly.
> 
> Tested on an Allwinner A33 Q8 tablet (Laser MID-786).
> 
> Fixes: 132e23775779 ("usb: musb: sunxi: Add support for musb controller in A31 SoC")
> Signed-off-by: Bobek Brzeczyszczykiewicz <admin@roadbobek.com>
> ---
>  drivers/usb/musb/sunxi.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/musb/sunxi.c b/drivers/usb/musb/sunxi.c
> index a17b1c150626..5f63d519237b 100644
> --- a/drivers/usb/musb/sunxi.c
> +++ b/drivers/usb/musb/sunxi.c
> @@ -9,6 +9,7 @@
>   */
>  
>  #include <linux/clk.h>
> +#include <linux/delay.h>
>  #include <linux/err.h>
>  #include <linux/extcon.h>
>  #include <linux/io.h>
> @@ -239,6 +240,8 @@ static int sunxi_musb_init(struct musb *musb)
>  		goto error_sram_release;
>  
>  	if (test_bit(SUNXI_MUSB_FL_HAS_RESET, &glue->flags)) {
> +		reset_control_assert(glue->rst);
> +		usleep_range(10, 20);

fsleep()?

And check the result of reset_control_assert()?

thanks,

greg k-h

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

  parent reply	other threads:[~2026-12-04  3:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  6:54 [PATCH v2 0/3] usb/phy: sunxi: Assert reset before deasserting on init Bobek Brzeczyszczykiewicz
2026-11-23  6:54 ` Bobek Brzeczyszczykiewicz via B4 Relay
2026-11-23  6:54 ` Bobek Brzeczyszczykiewicz via B4 Relay
2026-11-23  6:54 ` [PATCH v2 1/3] usb: musb: " Bobek Brzeczyszczykiewicz
2026-11-23  6:54   ` Bobek Brzeczyszczykiewicz via B4 Relay
2026-11-23  6:54   ` Bobek Brzeczyszczykiewicz via B4 Relay
2026-11-23  7:00   ` sashiko-bot
2026-11-23  7:00     ` sashiko-bot
2026-12-03 17:49   ` Greg Kroah-Hartman [this message]
2026-12-03 17:49     ` Greg Kroah-Hartman
2026-11-23  6:54 ` [PATCH v2 2/3] phy: sun4i-usb: Assert PHY resets in sun4i_usb_phy_probe() Bobek Brzeczyszczykiewicz
2026-11-23  6:54   ` Bobek Brzeczyszczykiewicz via B4 Relay
2026-11-23  6:54   ` Bobek Brzeczyszczykiewicz via B4 Relay
2026-11-23  6:54 ` [PATCH v2 3/3] phy: sun4i-usb: Fix phy2->clk2 reference imbalance in sun4i_usb_phy_init() Bobek Brzeczyszczykiewicz
2026-11-23  6:54   ` Bobek Brzeczyszczykiewicz via B4 Relay
2026-11-23  6:54   ` Bobek Brzeczyszczykiewicz via B4 Relay
2026-11-23  7:00 ` [PATCH v2 0/3] usb/phy: sunxi: Assert reset before deasserting on init sashiko-bot

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=2026120358-doorbell-isolation-91c8@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=admin@roadbobek.com \
    --cc=andre.przywara@arm.com \
    --cc=b-liu@ti.com \
    --cc=balbi@ti.com \
    --cc=hansg@kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=kishon@kernel.org \
    --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=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.