Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: cdns3: report endpoint reset timeout
@ 2026-10-03  8:11 Jiale Yao
  2026-10-09  2:17 ` Peter Chen (Qualcomm)
  0 siblings, 1 reply; 2+ messages in thread
From: Jiale Yao @ 2026-10-03  8:11 UTC (permalink / raw)
  To: Peter Chen, Pawel Laszczak, Roger Quadros, Greg Kroah-Hartman,
	Felipe Balbi, linux-usb, linux-kernel
  Cc: Jiale Yao

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@163.com>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] usb: cdns3: report endpoint reset timeout
  2026-10-03  8:11 [PATCH] usb: cdns3: report endpoint reset timeout Jiale Yao
@ 2026-10-09  2:17 ` Peter Chen (Qualcomm)
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Chen (Qualcomm) @ 2026-10-09  2:17 UTC (permalink / raw)
  To: Jiale Yao
  Cc: Pawel Laszczak, Roger Quadros, Greg Kroah-Hartman, Felipe Balbi,
	linux-usb, linux-kernel

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@163.com>

Add: Cc: stable@vger.kernel.org, otherwise:

Acked-by: Peter Chen <peter.chen@kernel.org>

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-09  2:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-03  8:11 [PATCH] usb: cdns3: report endpoint reset timeout Jiale Yao
2026-10-09  2:17 ` Peter Chen (Qualcomm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox