From f4cf8bc6aa337d4e2419d2ae5dfd6365ae9750ef Mon Sep 17 00:00:00 2001 From: hselasky Date: Wed, 11 Mar 2020 08:23:14 +0000 Subject: [PATCH] MFC r358738: Remove the power bit from the super speed root hub port status register because it clobbers the super speed link status when a device is in super speed mode. Currently the power bit is not needed for anything in the USB hub driver. This fixes USB warm reset for super speed devices. Tested by: Shichun.Ma@dell.com Sponsored by: Mellanox Technologies git-svn-id: svn://svn.freebsd.org/base/stable/9@358876 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/usb/controller/xhci.c | 11 ++++------- sys/dev/usb/usb_hub.c | 4 ++-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 36bf0ad51..d5c90f760 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -3514,13 +3514,10 @@ xhci_roothub_exec(struct usb_device *udev, i |= UPS_OVERCURRENT_INDICATOR; if (v & XHCI_PS_PR) i |= UPS_RESET; - if (v & XHCI_PS_PP) { - /* - * The USB 3.0 RH is using the - * USB 2.0's power bit - */ - i |= UPS_PORT_POWER; - } +#if 0 + if (v & XHCI_PS_PP) + /* XXX undefined */ +#endif USETW(sc->sc_hub_desc.ps.wPortStatus, i); i = 0; diff --git a/sys/dev/usb/usb_hub.c b/sys/dev/usb/usb_hub.c index a24cc527b..509d8665e 100644 --- a/sys/dev/usb/usb_hub.c +++ b/sys/dev/usb/usb_hub.c @@ -646,7 +646,7 @@ repeat: break; case USB_SPEED_SUPER: if (udev->parent_hub == NULL) - power_mask = UPS_PORT_POWER; + power_mask = 0; /* XXX undefined */ else power_mask = UPS_PORT_POWER_SS; break; @@ -654,7 +654,7 @@ repeat: power_mask = 0; break; } - if (!(sc->sc_st.port_status & power_mask)) { + if ((sc->sc_st.port_status & power_mask) != power_mask) { DPRINTF("WARNING: strange, connected port %d " "has no power\n", portno); } -- 2.42.0