Re: [PATCH] usb: dwc3: st: Propagate reset deassert failures
From: Patrice CHOTARD
Date: Thu Jun 25 2026 - 11:39:46 EST
On 6/24/26 07:57, Pengpeng Hou wrote:
> The ST DWC3 glue driver treats the powerdown and softreset reset
> controls as required resources, but ignores reset_control_deassert()
> failures before populating the child DWC3 device. Resume ignores the
> same failures before returning success.
>
> Check the deassert operations and unwind the already deasserted
> powerdown reset if softreset deassertion fails.
>
> Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
> ---
> drivers/usb/dwc3/dwc3-st.c | 19 +++++++++++++++----
> 1 file changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-st.c b/drivers/usb/dwc3/dwc3-st.c
> index 5d513decaacd..bbabfd933798 100644
> --- a/drivers/usb/dwc3/dwc3-st.c
> +++ b/drivers/usb/dwc3/dwc3-st.c
> @@ -242,7 +242,9 @@ static int st_dwc3_probe(struct platform_device *pdev)
> "could not get power controller\n");
>
> /* Manage PowerDown */
> - reset_control_deassert(dwc3_data->rstc_pwrdn);
> + ret = reset_control_deassert(dwc3_data->rstc_pwrdn);
> + if (ret)
> + return ret;
>
> dwc3_data->rstc_rst =
> devm_reset_control_get_shared(dev, "softreset");
> @@ -253,7 +255,9 @@ static int st_dwc3_probe(struct platform_device *pdev)
> }
>
> /* Manage SoftReset */
> - reset_control_deassert(dwc3_data->rstc_rst);
> + ret = reset_control_deassert(dwc3_data->rstc_rst);
> + if (ret)
> + goto undo_powerdown;
>
> /* Allocate and initialize the core */
> ret = of_platform_populate(node, NULL, NULL, dev);
> @@ -328,8 +332,15 @@ static int st_dwc3_resume(struct device *dev)
>
> pinctrl_pm_select_default_state(dev);
>
> - reset_control_deassert(dwc3_data->rstc_pwrdn);
> - reset_control_deassert(dwc3_data->rstc_rst);
> + ret = reset_control_deassert(dwc3_data->rstc_pwrdn);
> + if (ret)
> + return ret;
> +
> + ret = reset_control_deassert(dwc3_data->rstc_rst);
> + if (ret) {
> + reset_control_assert(dwc3_data->rstc_pwrdn);
> + return ret;
> + }
>
> ret = st_dwc3_drd_init(dwc3_data);
> if (ret) {
Hi Pengpeng
Reviewed-by: Patrice Chotard <patrice.chotard@xxxxxxxxxxx>
Thanks
Patrice