From nobody Wed Mar 16 14:56:00 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 33D071A20283; Wed, 16 Mar 2022 14:56:01 +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 4KJYHj0yVFz3R60; Wed, 16 Mar 2022 14:56:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647442561; 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=0k0lRztHVbJSuQjAMocMbpJWubH9mcGunysNF6sx1zY=; b=yvYH+QqGjqkL2K0qeORqxzwGLnHsyO1283L8oDS2aiZyKzt1I5/eKx79fdn1l/ed694eYT qNFXMWU9XAQXkHKP2Z2GYDNsM7SsCKTNekn0dUJHXfqkMhxrceRGkGev87hH1bR2v0/uJx /lQfKjDZPKS5nvMMLd78YKeCycDs0Xo0HEao2MT83T/y0jFh2fwoprZaggzEShU2QM9hLk sNFVIujU4ODOJnWu3ndlvV/U6ecmmo+jFJdI8Pf5HWlNKZcFXq4DqEIvQuJPwa8uY8uvfD fv2OHiIQ5iQDamrg3rUnhBilXYJfHWEd8oOck50xC/6f9xutGQJnREvxR9NOvA== 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 00E70182EA; Wed, 16 Mar 2022 14:56:01 +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 22GEu0oZ043581; Wed, 16 Mar 2022 14:56:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22GEu0Z9043580; Wed, 16 Mar 2022 14:56:00 GMT (envelope-from git) Date: Wed, 16 Mar 2022 14:56:00 GMT Message-Id: <202203161456.22GEu0Z9043580@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: ea318f1ad17e - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: ea318f1ad17ee599f0eeda8a3fb07f7b81699c6f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647442561; 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=0k0lRztHVbJSuQjAMocMbpJWubH9mcGunysNF6sx1zY=; b=LhrlNkEj3xYAc+1O0lqY0vnZSFCEuz/hG0nxgmC8ST1NABEfBLPo169dsyjeoAT3OafF1w HeicJc9rySKP2QtIgxxfNcZsGdh57kEDEB9dmfpa4Le7EeYDWDvC5uRaXc8UxuEGPdmUA9 Sw4FKhXVM2PnieDJsUMHT3Itkr1WuxBZ30y20WuQB7eE6MyYXTECVHty0mMbG9Fwf7uM4/ bNxpNpJwGWOhsMQNh4kvGGOdYGIdbhImIVkrPaISYJ/XSHIBCJHQv/wSQCEmMNjMhl32YK OpOWf/PE7+KNTflPjfwjFE9H1Fr9S2le5MuQ76NZXn6IRJu4rUiK7PDxc9r2Hw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647442561; a=rsa-sha256; cv=none; b=rNAlR9f5AxVxEXWekVHJd2COKm2jow68IkCCc6cWxDUmjiNEhl3oV806KRXGM29F5zCfgO TFSg4CQzuHx2J+QdaUEcBa1qfC4cIIdj/BMIXe9dlDS8DazjK6pG+9pLlgiJ64WG4BupUn 7OUr5VbHQbw0/tN8JolLp+Cj71KmDnDcTFkd+46nus56Q73ygPmKNyMUIm+dWeCyCzGGjF cS1NP/t9Ry4LZOslocj0Dxp8Ox4q41tCxfAjUvqa5cr2pE9kiIBzqGWoOhAvlQgJRQuN2j 8EoWFSB36i5Vi12mv6qv//wPAtw6mATCQZHKGdvTrt2Nt5kD/XM41hvL6J/NWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=ea318f1ad17ee599f0eeda8a3fb07f7b81699c6f commit ea318f1ad17ee599f0eeda8a3fb07f7b81699c6f Author: Hans Petter Selasky AuthorDate: 2022-03-03 16:32:20 +0000 Commit: Hans Petter Selasky CommitDate: 2022-03-16 14:55:22 +0000 xhci(4): Add quirk for "TUSB73x0 USB3.0 xHCI Controller". Tested by: br@ Sponsored by: NVIDIA Networking (cherry picked from commit 33cbbf268f7d0f3daff0c2aa06836d932faf56a9) --- 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)) {