FreeBSD Bugzilla – Attachment 233705 Details for
Bug 262882
USB disconnects repeatedly, losing all attached devices on that USB hub
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix U1/U2 IOERROR issue
xhci_port_speed.diff (text/plain), 2.23 KB, created by
Hans Petter Selasky
on 2022-05-03 20:25:51 UTC
(
hide
)
Description:
Patch to fix U1/U2 IOERROR issue
Filename:
MIME Type:
Creator:
Hans Petter Selasky
Created:
2022-05-03 20:25:51 UTC
Size:
2.23 KB
patch
obsolete
>diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c >index 933a459170d..15835d0a641 100644 >--- a/sys/dev/usb/controller/xhci.c >+++ b/sys/dev/usb/controller/xhci.c >@@ -3479,13 +3479,13 @@ xhci_roothub_exec(struct usb_device *udev, > i = UPS_PORT_LINK_STATE_SET(XHCI_PS_PLS_GET(v)); > > switch (XHCI_PS_SPEED_GET(v)) { >- case 3: >+ case XHCI_PS_SPEED_HIGH: > i |= UPS_HIGH_SPEED; > break; >- case 2: >+ case XHCI_PS_SPEED_LOW: > i |= UPS_LOW_SPEED; > break; >- case 1: >+ case XHCI_PS_SPEED_FULL: > /* FULL speed */ > break; > default: >@@ -3550,7 +3550,7 @@ xhci_roothub_exec(struct usb_device *udev, > > switch (value) { > case UHF_PORT_U1_TIMEOUT: >- if (XHCI_PS_SPEED_GET(v) != 4) { >+ if (XHCI_PS_SPEED_GET(v) < XHCI_PS_SPEED_SS) { > err = USB_ERR_IOERROR; > goto done; > } >@@ -3561,7 +3561,7 @@ xhci_roothub_exec(struct usb_device *udev, > XWRITE4(sc, oper, port, v); > break; > case UHF_PORT_U2_TIMEOUT: >- if (XHCI_PS_SPEED_GET(v) != 4) { >+ if (XHCI_PS_SPEED_GET(v) < XHCI_PS_SPEED_SS) { > err = USB_ERR_IOERROR; > goto done; > } >@@ -3586,7 +3586,7 @@ xhci_roothub_exec(struct usb_device *udev, > case UHF_PORT_SUSPEND: > DPRINTFN(6, "suspend port %u (LPM=%u)\n", index, i); > j = XHCI_PS_SPEED_GET(v); >- if ((j < 1) || (j > 3)) { >+ if (j == 0 || j >= XHCI_PS_SPEED_SS) { > /* non-supported speed */ > err = USB_ERR_IOERROR; > goto done; >diff --git a/sys/dev/usb/controller/xhcireg.h b/sys/dev/usb/controller/xhcireg.h >index b49bc09a8e7..38acffaca05 100644 >--- a/sys/dev/usb/controller/xhcireg.h >+++ b/sys/dev/usb/controller/xhcireg.h >@@ -124,6 +124,10 @@ > #define XHCI_PS_PLS_SET(x) (((x) & 0xF) << 5) /* RW - port link state */ > #define XHCI_PS_PP 0x00000200 /* RW - port power */ > #define XHCI_PS_SPEED_GET(x) (((x) >> 10) & 0xF) /* RO - port speed */ >+#define XHCI_PS_SPEED_FULL 0x1 /* Full Speed USB */ >+#define XHCI_PS_SPEED_LOW 0x2 /* Low Speed USB */ >+#define XHCI_PS_SPEED_HIGH 0x3 /* High Speed USB */ >+#define XHCI_PS_SPEED_SS 0x4 /* Super Speed USB */ > #define XHCI_PS_PIC_GET(x) (((x) >> 14) & 0x3) /* RW - port indicator */ > #define XHCI_PS_PIC_SET(x) (((x) & 0x3) << 14) /* RW - port indicator */ > #define XHCI_PS_LWS 0x00010000 /* RW - port link state write strobe */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 262882
:
232775
|
232776
|
232856
|
232857
|
232880
|
232881
|
232882
|
233314
|
233622
|
233623
|
233625
|
233647
|
233659
|
233669
|
233691
|
233692
| 233705