From nobody Wed Jan 22 21:47:13 2025 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 4Ydd2p03Bcz5l6h9; Wed, 22 Jan 2025 21:47:14 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ydd2n6NsPz3Rs5; Wed, 22 Jan 2025 21:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737582433; 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=I7ECSpQEF5zpNdvTCnW9hFsVTELux5whSC+jdxjsacs=; b=NfkiSEhmjHjTdw1kJP4piaLOIC5JfBT51sZj/RDsSBuHodww+fc8uNH+s7A8t3NnTwm0t3 r7rYgWu2GXTWiPCgPneTzqV9lU3a4E4CJZKKGOEz4ZETe1g2h1oUrEU1wZh27aoWPOmT/q SGoI4T716i04h1Xx++Nexv+yXjgwdVNJkeAcQzBJb5znUaS9OPEiEgdzwmGTdbsGX0LP5t UhoHp3uEAuYm8B7jvjBBNj+sBaKluhACi6jOy75sOW3uAPiwkAzFv7uXPVVTnQd8a1I8xB T/2RsQZ06A/c/jkQ9T70xOOaWlF/7woDx7KaznXejtXStTIBqiqJk7/716CHAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737582433; 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=I7ECSpQEF5zpNdvTCnW9hFsVTELux5whSC+jdxjsacs=; b=cN1z0DbklP+FWysb5gEF8wC0ZTsCL4BoF6HqaWMR4bxs+Vp8V39T9lmrWHNJiOu2pcgoEa zWoALKPcKrCXJ00C5//0dKs1Y+HePlvl2td2ooUKUK98523JFhbdIkcj/X6HJLqnLnIWGR ER0Dzc3TLVpOfhbDKq7ldkUr/ccgTz0dFksDkRM58BtCchjH2PDu0qOm41qp1qnfqLY4+j mM8Y6UA1iPqb1JB67+VCjyjd9PNVCPVCztGr+4bIwV+HFPfZ91mTFDu8RrI9ohK2ixB3Wy vizaFE3mFK9DD8YQNIuzJSMHGruMSCetheodTtmyIpfp0yLcDGlI3F5gzrI2jQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737582433; a=rsa-sha256; cv=none; b=A2ReGi7LFcrQ4svbldoDejlV6Icc+fF5r4rj5t67a2O77GmSB1kqbp9Be/WyL9c2EWxK3U xJ3zoohq06aGylZ7NMxVVhcZDgxT1r57MaVLbqLt1iAxTsLyWI/f8zZg+4MunRJUOzMjUg XqMB/rvU7fcVjgBNYeO0AmZzSbPRLyo5O6KhBXgnCL94coACK7PE2zxrVQgPwWcIZrj30R D7HAPjfc5fGZwewLPo6xScKfCbYRATtYRAd8AlUI+iCQkRpUdpn60bLjyEB5AuPJCUzoAt GgRvJPArFQ69i7TL4tMk/KP+bSjY1JEJ1S/RlEDmhDNUke/aDgR0Dt1V1ZdTPQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4Ydd2n5xS3z17yy; Wed, 22 Jan 2025 21:47:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 50MLlDfe009044; Wed, 22 Jan 2025 21:47:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MLlDkL009041; Wed, 22 Jan 2025 21:47:13 GMT (envelope-from git) Date: Wed, 22 Jan 2025 21:47:13 GMT Message-Id: <202501222147.50MLlDkL009041@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Adrian Chadd Subject: git: 40fc36ff2c1d - main - rtwn: fix RTL8192EU power-down / power-up hanging 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: adrian X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40fc36ff2c1d14f8ea7237e8f9487ab2f25de86b Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=40fc36ff2c1d14f8ea7237e8f9487ab2f25de86b commit 40fc36ff2c1d14f8ea7237e8f9487ab2f25de86b Author: Adrian Chadd AuthorDate: 2025-01-11 14:55:28 +0000 Commit: Adrian Chadd CommitDate: 2025-01-22 21:46:57 +0000 rtwn: fix RTL8192EU power-down / power-up hanging The RTL8192EU NIC (on older USB 2/USB 3 ports, not on newer USB 3 ports, that still needs to be fixed!) will attach, scan, associate fine. However, restarting wpa_supplicant results in the NIC hanging until you disconnect it. It turns out early in the power_on sequence - BUT only after a power_off - the NIC would suddenly stop responding to any USB transfers. It doesn't require the MCU to be available for USB transfers - the hardware itself does that - so something had to be going very sideways. I traced it down to these steps during the power_off sequence. They don't exist in the Linux rtl8xxxu driver, and there are commits earlier in their RTL8192EU bring-up that suggest the author was facing similar power sequencing / re-sequencing issues. This likely won't fix the actual channel programming / power sequencing / deafness issues on later USB-3 ports. There are other commits / fixes in the rtl8xxxu driver related to RTL8192EU bring-up that we don't have. Differential Revision: https://reviews.freebsd.org/D48428 Obtained from: Linux rtl8xxxu driver --- sys/dev/rtwn/rtl8192e/r92e_init.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/rtwn/rtl8192e/r92e_init.c b/sys/dev/rtwn/rtl8192e/r92e_init.c index 925221bdabb1..077c64626f8c 100644 --- a/sys/dev/rtwn/rtl8192e/r92e_init.c +++ b/sys/dev/rtwn/rtl8192e/r92e_init.c @@ -368,6 +368,7 @@ r92e_power_off(struct rtwn_softc *sc) return; } +#if 0 /* SOP option to disable BG/MB. */ rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, 0xff, R92C_APS_FSMCO_SOP_RCK, 3); @@ -377,12 +378,15 @@ r92e_power_off(struct rtwn_softc *sc) /* Disable small LDO. */ rtwn_setbits_1(sc, R92C_SPS0_CTRL, 0x1, 0); +#endif /* Enable WL suspend. */ rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, R92C_APS_FSMCO_AFSM_PCIE, R92C_APS_FSMCO_AFSM_HSUS, 1); +#if 0 /* Enable SW LPS. */ rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, 0, R92C_APS_FSMCO_APFM_RSM, 1); +#endif }