Re: [PATCH] usb: cdns3: report endpoint reset timeout
From: Peter Chen (Qualcomm)
Date: Thu Oct 08 2026 - 22:17:17 EST
On 26-10-03 16:11:52, Jiale Yao wrote:
> cdns3_gadget_ep_disable() discards the endpoint reset poll result and
> then tests ret, which is still zero. A reset timeout is therefore
> neither reported nor returned to the caller.
>
> Store the poll result in ret so the existing diagnostic and return path
> expose the timeout.
>
> Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
> Signed-off-by: Jiale Yao <yaojiale02@xxxxxxx>
Add: Cc: stable@xxxxxxxxxxxxxxx, otherwise:
Acked-by: Peter Chen <peter.chen@xxxxxxxxxx>
Peter
> ---
> drivers/usb/cdns3/cdns3-gadget.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
> index 42311c1bfada..53cc535309c5 100644
> --- a/drivers/usb/cdns3/cdns3-gadget.c
> +++ b/drivers/usb/cdns3/cdns3-gadget.c
> @@ -2530,9 +2530,9 @@ static int cdns3_gadget_ep_disable(struct usb_ep *ep)
> !(val & EP_STS_DBUSY), 1, 10);
> writel(EP_CMD_EPRST, &priv_dev->regs->ep_cmd);
>
> - readl_poll_timeout_atomic(&priv_dev->regs->ep_cmd, val,
> - !(val & (EP_CMD_CSTALL | EP_CMD_EPRST)),
> - 1, 1000);
> + ret = readl_poll_timeout_atomic(&priv_dev->regs->ep_cmd, val,
> + !(val & (EP_CMD_CSTALL | EP_CMD_EPRST)),
> + 1, 1000);
> if (unlikely(ret))
> dev_err(priv_dev->dev, "Timeout: %s resetting failed.\n",
> priv_ep->name);
> --
> 2.34.1
>
--
Thanks,
Peter Chen