From nobody Thu Mar 17 12:28:09 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 492301A25900; Thu, 17 Mar 2022 12:28:11 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KK5yf2gb6z4r8F; Thu, 17 Mar 2022 12:28:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647520091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X/z2Nh8dQXUS9SdMizJ7A/+giqej2c9A3xHuPtX4sjc=; b=Pn3gRpz1Aaeujflsj9wscuB3+0dz/aPixSF3ZdaHS/NqYC/4alvYXEkE6eHvEdc6rixP0W 4oQpH0cEaKUlISx/vHcT8VveBMXjjoRC/cPPEi4ZoQLV0Egw3rPJB8KoOtG1GZyJpKfon6 RjAid6b7KqKgXQzqxKBU62LwbOK3e1GAtXZ4mmA96U/dUxooY5peyYBj41HGtVsDWDDNK5 3VD3E15xpTeGe528uo8t2JEAhr2e065BYMPnMAwxaF0jl5JVIFdcx8hfis9KgAttEpTGFF MV44RSC694vcXAsv7ojrcBOuiVXJ9P7JTg8AUeea0dxSfwdfL0gAmZzekTImDQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 01B7623AB; Thu, 17 Mar 2022 12:28:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 22HCS9DB083837; Thu, 17 Mar 2022 12:28:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22HCS94L083836; Thu, 17 Mar 2022 12:28:09 GMT (envelope-from git) Date: Thu, 17 Mar 2022 12:28:09 GMT Message-Id: <202203171228.22HCS94L083836@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 96ba69963a62 - releng/13.1 - xhci(4): Add quirk for "TUSB73x0 USB3.0 xHCI Controller". List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.1 X-Git-Reftype: branch X-Git-Commit: 96ba69963a62055a768b59953b9fcc42b5ae2f66 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647520091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X/z2Nh8dQXUS9SdMizJ7A/+giqej2c9A3xHuPtX4sjc=; b=AyToHbURYlKqok6ANTkrSAZGpUqXDnpNvEnf6YUrfsWb6ihyg/Kk4VzDvYY9M9YDiAbs+K Iw2kG/K4i8qTcs+aofrPUoRrh6qDXW7P8R8nZpz61eiJZZoQvJz0LY/nAGCI3IHyMdXqO6 DMazNj/Q9aFIvl+Rno8vDROo1Ht/+HmdYlXIJ5PRxfrWdSjwJmsYfcO4W2lVCUs1V5kXXq oS+1H0gAjUEHlPjnken9Q9joAqZx9UlmycbVVOfa/ttch9vqFkpVRXF4op2S4VwJQlvKOr FpS84Y3CODo0IX7ptvlLdq+6d4BpM7fVBs0nLmFJGUqE94ihm999dlWfzah0Xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647520091; a=rsa-sha256; cv=none; b=s++yk50X+TwW5POaA7B0+pCYvX2zC2S0cCjd44V/Ht0hrH8UDzlQdklz9zIaOqd77gY8h2 QKOKAP4yXgJiakJwugAYK0dK/gKFjLTo17orwcN11Gef6DPZWlmbmkz66baR+IQomh5+dD CYrfOAp1CUEV4SdF7D0aaNc+wpaSsmBlb4nOMwsE1nRLhrp6QVt5S9gE0egqQ4NiSwz8/7 Ohbir8btkY3Mnvhb3Qrn+FWLXGtJCTd5I9PdodOdlScFktSrYPAGysZG36GCgrB2X77QOx Q0g4vnES97kf0PMKUFUQoRcmU5fZIPd7QHTaiO/7CT3VGeAjOEnJNhooy4F4dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=96ba69963a62055a768b59953b9fcc42b5ae2f66 commit 96ba69963a62055a768b59953b9fcc42b5ae2f66 Author: Hans Petter Selasky AuthorDate: 2022-03-03 16:32:20 +0000 Commit: Hans Petter Selasky CommitDate: 2022-03-17 12:26:03 +0000 xhci(4): Add quirk for "TUSB73x0 USB3.0 xHCI Controller". Tested by: br@ Sponsored by: NVIDIA Networking Approved by: re (gjb) (cherry picked from commit 33cbbf268f7d0f3daff0c2aa06836d932faf56a9) (cherry picked from commit ea318f1ad17ee599f0eeda8a3fb07f7b81699c6f) --- sys/dev/usb/controller/xhci.c | 11 +++++++++-- sys/dev/usb/controller/xhci.h | 5 ++++- sys/dev/usb/controller/xhci_pci.c | 7 ++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 9c0f53de4924..450f8dbbd9a3 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -2,7 +2,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2010-2022 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -99,6 +99,10 @@ static int xhcictlquirk = 1; SYSCTL_INT(_hw_usb_xhci, OID_AUTO, ctlquirk, CTLFLAG_RWTUN, &xhcictlquirk, 0, "Set to enable control endpoint quirk"); +static int xhcidcepquirk; +SYSCTL_INT(_hw_usb_xhci, OID_AUTO, dcepquirk, CTLFLAG_RWTUN, + &xhcidcepquirk, 0, "Set to disable endpoint deconfigure command"); + #ifdef USB_DEBUG static int xhcidebug; static int xhciroute; @@ -1531,8 +1535,11 @@ xhci_cmd_configure_ep(struct xhci_softc *sc, uint64_t input_ctx, temp = XHCI_TRB_3_TYPE_SET(XHCI_TRB_TYPE_CONFIGURE_EP) | XHCI_TRB_3_SLOT_SET(slot_id); - if (deconfigure) + if (deconfigure) { + if (sc->sc_no_deconfigure != 0 || xhcidcepquirk != 0) + return (0); /* Success */ temp |= XHCI_TRB_3_DCEP_BIT; + } trb.dwTrb3 = htole32(temp); diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h index 802207208569..08f4e42b5fcd 100644 --- a/sys/dev/usb/controller/xhci.h +++ b/sys/dev/usb/controller/xhci.h @@ -3,7 +3,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2010-2022 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -529,6 +529,9 @@ struct xhci_softc { /* size of context */ uint8_t sc_ctx_is_64_byte; + /* deconfiguring USB device is not fully supported */ + uint8_t sc_no_deconfigure; + /* Isochronous Scheduling Threshold */ uint8_t sc_ist; diff --git a/sys/dev/usb/controller/xhci_pci.c b/sys/dev/usb/controller/xhci_pci.c index bb9baee6800d..be12d8c33382 100644 --- a/sys/dev/usb/controller/xhci_pci.c +++ b/sys/dev/usb/controller/xhci_pci.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. + * Copyright (c) 2010-2022 Hans Petter Selasky * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -287,6 +287,9 @@ xhci_pci_attach(device_t self) sc->sc_io_size = rman_get_size(sc->sc_io_res); switch (pci_get_devid(self)) { + case 0x8241104c: /* TUSB73x0 USB3.0 xHCI Controller */ + sc->sc_no_deconfigure = 1; + break; case 0x01941033: /* NEC uPD720200 USB 3.0 controller */ case 0x00141912: /* NEC uPD720201 USB 3.0 controller */ /* Don't use 64-bit DMA on these controllers. */ @@ -310,6 +313,8 @@ xhci_pci_attach(device_t self) sc->sc_imod_default = XHCI_IMOD_DEFAULT_LP; sc->sc_ctlstep = 1; break; + default: + break; } if (xhci_init(sc, self, usedma32)) {