From nobody Sun Jul 3 22:17:21 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 DC1D18A9BCF; Sun, 3 Jul 2022 22:17:21 +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 4Lbjwd5grFz4VH9; Sun, 3 Jul 2022 22:17:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656886641; 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=EOimJa9HXbwQmRM+UZqQBFQV3cRzFQz4FShNy0axKMc=; b=gfyyFFLs7tD3Yde8SSlI+PZq6wXu3Fme8ghimpkM0ogTP3RjYtGrTmUQVzDdK6xWOIN9Ah asPV9Mwolm/g7teyJG40JXBLM9Lym39oU+uvcBtJBo7MC3JeMU6ExHVh4LyXc8U5pG08UJ 04gvMOpjR+eHjuKudDWTuwSqvzTxM0oE806yaoiX4Il2iJkvCn1kEs0nS/xWsAFSlS/WSP FKPjnuxjAoIelnc4w8eyw4x0VtgO3BtEHyZ0fealsrynhW/H84zqftw01T+IGP/NDPKwGo cBMPyTdi/coCykBVGIfqZplm2oJoPI7ZJzIJ4K0ISe58xL4Rg+tAeM0vFJ3Ybw== 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 A2DB62CC15; Sun, 3 Jul 2022 22:17:21 +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 263MHLwj050780; Sun, 3 Jul 2022 22:17:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 263MHLoN050779; Sun, 3 Jul 2022 22:17:21 GMT (envelope-from git) Date: Sun, 3 Jul 2022 22:17:21 GMT Message-Id: <202207032217.263MHLoN050779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: cec0a5ec6b10 - main - 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/main X-Git-Reftype: branch X-Git-Commit: cec0a5ec6b1074d253a7ba30226d1f99e0c18d4e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1656886641; 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=EOimJa9HXbwQmRM+UZqQBFQV3cRzFQz4FShNy0axKMc=; b=R8iB01Wrm6v/CMLLgG82VXj640kslenAdCgpoBQWw82859s8mZ56Pux6EjqYBvxoV0x5+M 7/1DP4Fn65wYK7MFq1IVLkHkyrZaXhKqPzjVgl3rM64VkRVZmt23gpVw3aUoHSBi4zATcV EdgoKVpbR+ZWz7eCmCbfwitEceYVuivVTU77Vu7tPWrisA7NIBGLtgGlvPtG8bCHvyX8bW 4iivCbpm4w8G4rlujJcnzJkw+02TWm7Iff1fmnwzS94xXpAIAcCI/ZROsvEZ9xlJ0Bw+j+ /Odj6YAwS7q0qd7RZTB76WdgWslwTqNuiQGbaJlzttqDA5lGTh5tiRVfa9z4PA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1656886641; a=rsa-sha256; cv=none; b=JGqVBiEi+DWph3i++6B7++aVFqtRLB3BdFppTeIiJwtIkjTtkMTbArKd86KgaubLk70xcy WWMgVWlO/z9/BqQEN6s2isb9gTLwR2HXrOgir1rhxRl3ArVpupRQQ5k1IcTnXx1xbuHTTg 30PVLrPmlAnZ5JsAc8C7g724JHY/8Int+Mp8icDAVUBPul++6JSbylyWnsNKfRvKgoPhG2 La6Q/1pJPwdfA0iMTsSn32JOKaTOwux8vZnkU01LpHkgfBW7imkcOeTCKlfPjrVwLu6E2S mapoD8fPOeIQFejHR57sQFltJPhT8HcVrWia3gcU5L4psDFTgu/t9yinZjM4Ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=cec0a5ec6b1074d253a7ba30226d1f99e0c18d4e commit cec0a5ec6b1074d253a7ba30226d1f99e0c18d4e Author: Bjoern A. Zeeb AuthorDate: 2022-07-02 19:14:39 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-07-03 22:15:12 +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 MFC after: 2 weeks Reviewed by: mw Differential Revision: https://reviews.freebsd.org/D35698 --- 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 1ab4862fb97c..ac94a1327bcf 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