OSDN Git Service

usb: dwc3: Increase timeout for CmdAct cleared by device controller
authorYu Chen <chenyu56@huawei.com>
Thu, 21 May 2020 08:46:43 +0000 (16:46 +0800)
committerFelipe Balbi <balbi@kernel.org>
Mon, 25 May 2020 08:09:43 +0000 (11:09 +0300)
commit1c0e69ae1b9f9004fd72978612ae3463791edc56
tree0caa077b404d0deb8f07f7d9f55dd67e589be1f3
parenteccba1edeebf0cf4525a680e1585ccf97dfc4c87
usb: dwc3: Increase timeout for CmdAct cleared by device controller

If the SS PHY is in P3, there is no pipe_clk, HW may use suspend_clk
for function, as suspend_clk is slow so EP command need more time to
complete, e.g, imx8M suspend_clk is 32K, set ep configuration will
take about 380us per below trace time stamp(44.286278 - 44.285897
= 0.000381):

configfs_acm.sh-822   [000] d..1    44.285896: dwc3_writel: addr
000000006d59aae1 value 00000401
configfs_acm.sh-822   [000] d..1    44.285897: dwc3_readl: addr
000000006d59aae1 value 00000401
... ...
configfs_acm.sh-822   [000] d..1    44.286278: dwc3_readl: addr
000000006d59aae1 value 00000001
configfs_acm.sh-822   [000] d..1    44.286279: dwc3_gadget_ep_cmd:
ep0out: cmd 'Set Endpoint Configuration' [401] params 00001000
00000500 00000000 --> status: Successful

This was originally found on Hisilicon Kirin Soc that need more time
for the device controller to clear the CmdAct of DEPCMD.

Signed-off-by: Yu Chen <chenyu56@huawei.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/dwc3/gadget.c