From nobody Mon Jul 18 09:50:11 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 4Lmcdb3xM1z4Wt1Y; Mon, 18 Jul 2022 09:50: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 4Lmcdb24kwz3D4C; Mon, 18 Jul 2022 09:50:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658137811; 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=0wf3CIDt66hP3kMvbvUH5sdRfh9LPctavUuX7CRRsh4=; b=b3kEfqYBRuJCeJsWvscDwKngOBqK0ioXZ7XeGsLhDEonxrGX39Pw5s9QkHKgN4ZA/xwPGV ENRqIvf8vvZACEgdFjYT/d0tRxZt9ZcXyy0yDCs9LYTivItPhGzuR7AZg/KJju5yVwi2AH ZC2rtFM/dyO3kExQ0jhssyUqGAN270KbAcyfCF3nGX2D3nxKzbNlDntn0Z5CuTfE/ZBm+U LSpSw1Sh8KNnc9Bxa8wnzr/fMn7dHVlbnZAEbs/JUCy5505EdLJLF/6k8MT0nTJ55bdYeI KhFnNIbeUnchVIiBcpgKAbPDFxfEHnB3n/LQW/zCRfLQ3ZK5i424h+r8kJWzRA== 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 4Lmcdb1BX4zb2P; Mon, 18 Jul 2022 09:50:11 +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 26I9oB6c034567; Mon, 18 Jul 2022 09:50:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26I9oBME034564; Mon, 18 Jul 2022 09:50:11 GMT (envelope-from git) Date: Mon, 18 Jul 2022 09:50:11 GMT Message-Id: <202207180950.26I9oBME034564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 486d99faa31e - stable/13 - dwc3: uncondinationally enable Host IN Auto Retry 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: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 486d99faa31e99ca03115dfb7896b8144823bde7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658137811; 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=0wf3CIDt66hP3kMvbvUH5sdRfh9LPctavUuX7CRRsh4=; b=rzbZv9aZNkTKkgDSzYmbxnHEUkUTM+fZeS5WMmDPRFlxEziOSuoZhP4M76Xo2xhRkgvHUf Ib1fSlb49sAOOwh+YpboG2LTkXdfUGRFmtZM7fnrTE1E1z+p69e5ACaylROHlo6PUMbMAK FhJjQklVTLmOHyb+Th5wYTM4bw5nz97K4Ga4WMSI4Kig5S6+iQdonw04Gx3yM0VPyd1Swm xAtIT/x1mEIs9W/n+w46czUR4W/JhqJmq7KgHS9zDYKx2QqquMmcVIfoc2jpMrXFPDddz3 T00uMw7WY+XCCe1du7tfApJsal2xyB7RnpNs+yAweagorArWtcyOyKWs1ZAcdA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658137811; a=rsa-sha256; cv=none; b=yhqkPhL7YTpD4PejULa+CPyk5Pcl5v1e4jPzeZP40IEYgFtQ5yZOKBKOVdBJJz3xdL1ile i2SaFhBblW/YE1kyLsZ15cb7xN5pA/Z7Q/ko+6FRFbB0p5/5qp3u5v9eApyVheZs0DK9ss SzMwfXS3qlE25oPo2hi1OkU+DwDnF1QAxkcPQo/4X/1L1bpMap9ict+ELvTTnOEv8URQKj UgKuZCZH/n10Mhdjrko33/GzDVswkgfCUwS1cNNVyt9F23crCVr2s2veDby9cpuccI+Zp4 sy5aYsjD0kdFM3a7mHE8dfa8l8CcTwSy8bDV4U9p+cHrGgShibheQuDV6JSTNA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=486d99faa31e99ca03115dfb7896b8144823bde7 commit 486d99faa31e99ca03115dfb7896b8144823bde7 Author: Bjoern A. Zeeb AuthorDate: 2022-07-02 19:14:39 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-07-18 01:00:21 +0000 dwc3: uncondinationally enable Host IN Auto Retry Enable dwc3's auto retry feature. For IN transfers with crc errors or internal overruns this will make the host reply with a non-terminating retry ACK. I believe the hope was to improve reliability after seeing occasional hiccups. Obtained from: an old debugging patch Reviewed by: mw Differential Revision: https://reviews.freebsd.org/D35698 (cherry picked from commit cec0a5ec6b1074d253a7ba30226d1f99e0c18d4e) --- sys/dev/usb/controller/dwc3.c | 9 +++++++++ sys/dev/usb/controller/dwc3.h | 1 + 2 files changed, 10 insertions(+) diff --git a/sys/dev/usb/controller/dwc3.c b/sys/dev/usb/controller/dwc3.c index 1e90c5791cf0..b4156903874b 100644 --- a/sys/dev/usb/controller/dwc3.c +++ b/sys/dev/usb/controller/dwc3.c @@ -209,6 +209,15 @@ snps_dwc3_configure_host(struct snps_dwc3_softc *sc) reg &= ~DWC3_GCTL_PRTCAPDIR_MASK; reg |= DWC3_GCTL_PRTCAPDIR_HOST; DWC3_WRITE(sc, DWC3_GCTL, reg); + + /* + * Enable the Host IN Auto Retry feature, making the + * host respond with a non-terminating retry ACK. + * XXX If we ever support more than host mode this needs a dr_mode check. + */ + reg = DWC3_READ(sc, DWC3_GUCTL); + reg |= DWC3_GUCTL_HOST_AUTO_RETRY; + DWC3_WRITE(sc, DWC3_GUCTL, reg); } static void diff --git a/sys/dev/usb/controller/dwc3.h b/sys/dev/usb/controller/dwc3.h index a8b127cda9a8..862e17b1bcd9 100644 --- a/sys/dev/usb/controller/dwc3.h +++ b/sys/dev/usb/controller/dwc3.h @@ -54,6 +54,7 @@ #define DWC3_GGPIO 0xc124 #define DWC3_GUID 0xc128 #define DWC3_GUCTL 0xc12C +#define DWC3_GUCTL_HOST_AUTO_RETRY (1 << 14) #define DWC3_GBUSERRADDRLO 0xc130 #define DWC3_GBUSERRADDRHI 0xc134 #define DWC3_GPRTBIMAPLO 0xc138