Skip to contentSkip to conversation

usb: cdns3: report endpoint reset timeout

PATCH In review Jiale Yao 2 participants 2 messages Oct 3 – Oct 9

Subsystems (2)
lore
Share & tools
lore

Jiale Yao

author
#0 lore raw

PATCH 1/1 usb: cdns3: report endpoint reset timeout

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")
---
 drivers/usb/cdns3/cdns3-gadget.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/cdns3/cdns3-gadget.c +3 -3
index 42311c1bfada..53cc535309c5 100644
@@ -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);
Signature · 1 line
2.34.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · 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")

Add: Cc: [email protected], otherwise:

Peter

Quoted 24 lines
---
 drivers/usb/cdns3/cdns3-gadget.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/cdns3/cdns3-gadget.c +3 -3
index 42311c1bfada..53cc535309c5 100644
@@ -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);
Signature · 1 line
2.34.1
Signature · 2 lines
Thanks,
Peter Chen