diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 7e2f05b44e9..2d1ec92be49 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -3194,8 +3194,13 @@ xhci_roothub_exec(struct usb_device *udev, i |= UPS_OVERCURRENT_INDICATOR; if (v & XHCI_PS_PR) i |= UPS_RESET; - if (v & XHCI_PS_PP) - i |= UPS_PORT_POWER_SS; + if (v & XHCI_PS_PP) { + /* + * The USB 3.0 RH is using the + * USB 2.0's power bit + */ + i |= UPS_PORT_POWER; + } 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 0cc055e1755..b82fd766aa9 100644 --- a/sys/dev/usb/usb_hub.c +++ b/sys/dev/usb/usb_hub.c @@ -327,6 +327,7 @@ uhub_reattach_port(struct uhub_softc *sc, uint8_t portno) enum usb_dev_speed speed; enum usb_hc_mode mode; usb_error_t err; + uint16_t power_mask; uint8_t timeout; DPRINTF("reattaching port %d\n", portno); @@ -373,20 +374,22 @@ repeat: case USB_SPEED_HIGH: case USB_SPEED_FULL: case USB_SPEED_LOW: - if (!(sc->sc_st.port_status & UPS_PORT_POWER)) { - DPRINTF("WARNING: strange, connected port %d " - "has no power\n", portno); - } + power_mask = UPS_PORT_POWER; break; case USB_SPEED_SUPER: - if (!(sc->sc_st.port_status & UPS_PORT_POWER_SS)) { - DPRINTF("WARNING: strange, connected port %d " - "has no power\n", portno); - } + if (udev->parent_hub == NULL) + power_mask = UPS_PORT_POWER; + else + power_mask = UPS_PORT_POWER_SS; break; default: + power_mask = 0; break; } + if (!(sc->sc_st.port_status & power_mask)) { + DPRINTF("WARNING: strange, connected port %d " + "has no power\n", portno); + } /* check if the device is in Host Mode */