usb: cdns3: report endpoint reset timeout
Subsystems (2)
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")
Signed-off-by Jiale Yao <[email protected]>
--- drivers/usb/cdns3/cdns3-gadget.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/cdns3/cdns3-gadget.c +3 -3
@@ -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
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")Signed-off-by Jiale Yao <[email protected]>
Add: Cc: [email protected], otherwise:
Acked-by Peter Chen <[email protected]>
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@@ -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