Hi, Li Jun <jun.li@xxxxxxx> writes: > Introduce dwc3_read_poll_timeout_atomic for register polling to > simplify code, this way we use time(us) instead of register read > iteration counter to wait register value change, this is also to > resolve one ep command timeout issue found on imx8M, Chen Yu also > encoutered this problem on his Hisilicon Kirin Soc[1], on imx8M, > some ep command need more time to complete when SS PHY is at P3 > because suspend_clk(32K) is used, trace shows it takes about 400us > to complete, see below trace(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 > > So set timeout to be 500us for dwc3_send_gadget_ep_cmd(). > > [1] https://lkml.org/lkml/2019/9/25/754 > > Signed-off-by: Li Jun <jun.li@xxxxxxx> Let's fix the original bug first. This patch is likely to need changes after that ;-) -- balbi
Attachment:
signature.asc
Description: PGP signature