usb: xhci: Increase timeout for HC halt
Subsystems (2)
PATCH 1/1 usb: xhci: Increase timeout for HC halt
On some devices (specifically the SC8180x based Surface Pro X with QCOM04A6) HC halt / xhci_halt() times out during boot. Manually binding the xhci-hcd driver at some point later does not exhibit this behavior. To work around this, double XHCI_MAX_HALT_USEC, which also resolves this issue.
--- drivers/usb/host/xhci-ext-caps.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/host/xhci-ext-caps.h +2 -2
@@ -7,8 +7,8 @@* Author: Sarah Sharp * Some code borrowed from the Linux EHCI driver. */ -/* Up to 16 ms to halt an HC */ -#define XHCI_MAX_HALT_USEC (16*1000) +/* Up to 32 ms to halt an HC */ +#define XHCI_MAX_HALT_USEC (32 * 1000)/* HC not running - set to 1 when run/stop bit is cleared. */ #define XHCI_STS_HALT (1<<0)
Signature · 1 line
2.31.1
Greg Kroah-Hartman
maintainerQuoted 10 lines · Maximilian Luz
On some devices (specifically the SC8180x based Surface Pro X with QCOM04A6) HC halt /
xhci_halt()times out during boot. Manually binding the xhci-hcd driver at some point later does not exhibit this behavior. To work around this, doubleXHCI_MAX_HALT_USEC, which also resolves this issue.Signed-off-by Maximilian Luz <[email protected]>--- drivers/usb/host/xhci-ext-caps.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Should this go to stable kernels as well?
thanks,
greg k-h
Quoted 7 lines · Greg Kroah-Hartman
Quoted 6 lines · Maximilian Luz
On some devices (specifically the SC8180x based Surface Pro X with QCOM04A6) HC halt /
xhci_halt()times out during boot. Manually binding the xhci-hcd driver at some point later does not exhibit this behavior. To work around this, doubleXHCI_MAX_HALT_USEC, which also resolves this issue.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Maximilian Luz <[email protected]>--- drivers/usb/host/xhci-ext-caps.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Should this go to stable kernels as well?
Ah sorry, didn't think about that since the device in question currently requires a couple of other fixes to be usable. But I guess it would be good to have this in stable.
Regards,
Max
Quoted 16 lines · Maximilian Luz
On some devices (specifically the SC8180x based Surface Pro X with QCOM04A6) HC halt /
xhci_halt()times out during boot. Manually binding the xhci-hcd driver at some point later does not exhibit this behavior. To work around this, doubleXHCI_MAX_HALT_USEC, which also resolves this issue.Signed-off-by Maximilian Luz <[email protected]>--- drivers/usb/host/xhci-ext-caps.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/usb/host/xhci-ext-caps.h +0
-0
drivers/usb/host/xhci-ext-caps.h line 11
Quoted 7 lines
drivers/usb/host/xhci-ext-caps.h +2
-2@@ -7,8 +7,8 @@* Author: Sarah Sharp * Some code borrowed from the Linux EHCI driver. */ -/* Up to 16 ms to halt an HC */ -#define XHCI_MAX_HALT_USEC (16*1000) +/* Up to 32 ms to halt an HC */ +#define XHCI_MAX_HALT_USEC (32 * 1000)
xHCI spec has a 16ms limit stated in several places, for example section 5.4.1 "xHC is forced to halt within 16 ms. of software clearing the R/S bit to ‘0’, irrespective of any queued Transfer or Command Ring activity"
To make sure hosts work we could increase it to 32, but comment could be changed to make sure it doean't get optimized back to 16 ms later.
How about:
/* HC should halt within 16 ms, but use 32 ms as some in reality take longer */
If that's ok I can take this and modify the comment
-Mathias
Quoted 12 lines · Mathias Nyman
Quoted 11 lines · Maximilian Luz
On some devices (specifically the SC8180x based Surface Pro X with QCOM04A6) HC halt /
xhci_halt()times out during boot. Manually binding the xhci-hcd driver at some point later does not exhibit this behavior. To work around this, doubleXHCI_MAX_HALT_USEC, which also resolves this issue.Signed-off-by Maximilian Luz <[email protected]>--- drivers/usb/host/xhci-ext-caps.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 16 lines
drivers/usb/host/xhci-ext-caps.h line 11
Quoted 12 lines
drivers/usb/host/xhci-ext-caps.h +2
-2@@ -7,8 +7,8 @@* Author: Sarah Sharp * Some code borrowed from the Linux EHCI driver. */ -/* Up to 16 ms to halt an HC */ -#define XHCI_MAX_HALT_USEC (16*1000) +/* Up to 32 ms to halt an HC */ +#define XHCI_MAX_HALT_USEC (32 * 1000)xHCI spec has a 16ms limit stated in several places, for example section 5.4.1 "xHC is forced to halt within 16 ms. of software clearing the R/S bit to ‘0’, irrespective of any queued Transfer or Command Ring activity"
Right, thanks, I wasn't aware of this.
Quoted 7 lines
To make sure hosts work we could increase it to 32, but comment could be changed to make sure it doean't get optimized back to 16 ms later.
How about:
/* HC should halt within 16 ms, but use 32 ms as some in reality take longer */If that's ok I can take this and modify the comment
That makes sense, yes. Please feel free to change that comment as you wish.
Regards,
Max