From owner-svn-src-all@freebsd.org Sun Mar 8 13:24:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E799F26966D; Sun, 8 Mar 2020 13:24:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48b2Bq33c3z495b; Sun, 8 Mar 2020 13:24:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3070C227D0; Sun, 8 Mar 2020 13:24:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 028DOZaO025076; Sun, 8 Mar 2020 13:24:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 028DOY7k025075; Sun, 8 Mar 2020 13:24:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202003081324.028DOY7k025075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 8 Mar 2020 13:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358738 - in head/sys/dev/usb: . controller X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys/dev/usb: . controller X-SVN-Commit-Revision: 358738 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2020 13:24:36 -0000 Author: hselasky Date: Sun Mar 8 13:24:34 2020 New Revision: 358738 URL: https://svnweb.freebsd.org/changeset/base/358738 Log: 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 MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Sun Mar 8 06:09:46 2020 (r358737) +++ head/sys/dev/usb/controller/xhci.c Sun Mar 8 13:24:34 2020 (r358738) @@ -3591,13 +3591,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; Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Sun Mar 8 06:09:46 2020 (r358737) +++ head/sys/dev/usb/usb_hub.c Sun Mar 8 13:24:34 2020 (r358738) @@ -660,7 +660,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; @@ -668,7 +668,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); }