From nobody Wed Jan 22 21:47:15 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 4Ydd2r33ssz5l6L7; Wed, 22 Jan 2025 21:47:16 +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 4Ydd2r12wpz3Rs9; Wed, 22 Jan 2025 21:47:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737582436; 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=Y+eyoehiscLNblr88X601EZ95lLrWbaQXQx07ljs3Zo=; b=f71Bjtmj2T5Yjf8+MUq1/6E4WXNXYGygY7jXjTlHRUS5ACsvgWz21R4wpCiz6bJKDIUD6M 6gT7O/vEGPQ5BKvV7T6i4JWwdyJ8sbpfOnAnNvw56DhM+Bcm3KFFHY56yaKLTqq/tEMQAF NQMtSVr23iAQwgGpCRcxuDIxz+tot3OLFBVrdAaQCH1UMktdf90zCLa6zKNG7CTrtQsu8o 0ZMQL6KbDo+zh0vcpgiPm8YHAKy/9bIohspi5gl7inKKupI5QXcS1zmGjDB4aN8INcp/Ul yarIF6XcxabT5AWt4jyBlK3rFnZEG6+wh+e9j5x+BAZiF5ITDoxOHHVuoAy8+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1737582436; 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=Y+eyoehiscLNblr88X601EZ95lLrWbaQXQx07ljs3Zo=; b=QWoBp5PI9p9mCFZGi+mhDTuSDqkajiN0SsdrZYKX3fQaWxx9wW0UPGPPc1YbAzmYZlqC5w HibAEznAmcBiiKslObipjd4j05Sjn+Lat3STPQ+U5sm63VP9jdv/XnvnFjeO8s2mnefsfc iJlTGESw73ie8tX35+YIeNFus7nnpcD10VAEjbDMhy85bwmCQCvHiI2JBGxfsfGORm0SBi U1Tp8kIYBueRa3Q0Vdq1aMfr6mW6r4iDRHt0mtvkQp64NNcYoVcShIzP/tBh6Ie0zaeUR3 iJFnBg5bs2Rm8CCR4otfuczY632HSXgjobA/dFKuUj7yvDaVQKwibHbaQyo/EA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1737582436; a=rsa-sha256; cv=none; b=LUwbVjXobuAOe367etSn117hjQvDbyxWSX8JJrh90xhrMdaaWVJC19E66RuwUhAHvIKpY3 FAzF7U8yV67vWaoQB8gqmomSC36LbBFfh8CC3/WEYecpPspWtg7SFtPG2zB5/0CnL30aGy vw1AqZqBT+nM/56/FxWwLCu/GFBy7SS2y5l6jGxDJiG4A2/jw1jwxQaUpxp+iqH9gm+MUH P4b+Gi9POQ9nmA0ZcpmBR4vlAR58ce/wg3liEbAkfGl1LetwPhkOh98o9x0m82GVQZBT+d 1wiiID0FFnKpMGiOIITwyklbfGOCf5Dq4TU1bK/lRQv2JcxcFHWBC0a+WV9X7Q== 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 4Ydd2r0NnTz18lV; Wed, 22 Jan 2025 21:47:16 +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 50MLlFIM009108; Wed, 22 Jan 2025 21:47:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 50MLlFNa009105; Wed, 22 Jan 2025 21:47:15 GMT (envelope-from git) Date: Wed, 22 Jan 2025 21:47:15 GMT Message-Id: <202501222147.50MLlFNa009105@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: 043d6a24b290 - main - rtwn: add workaround sleep in r92e_set_chan() 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: 043d6a24b29030989fdf2b79c5ff90391f859225 Auto-Submitted: auto-generated The branch main has been updated by adrian: URL: https://cgit.FreeBSD.org/src/commit/?id=043d6a24b29030989fdf2b79c5ff90391f859225 commit 043d6a24b29030989fdf2b79c5ff90391f859225 Author: Adrian Chadd AuthorDate: 2025-01-19 20:16:55 +0000 Commit: Adrian Chadd CommitDate: 2025-01-22 21:46:57 +0000 rtwn: add workaround sleep in r92e_set_chan() It /looks/ like there's some weirdness in initial frame send after the chip programming / channel change. Linux rtl8xxxu has no sleeps here, instead it just retries the auth frame a few times. My guess is there's some sequencing going on here between finishing the programming, doing a calibration run and then sending the initial frame. Instead of doing sleeps on every write during the RF channel change, this 10ms sleep at the end is enough to reliably associate in my test environment (12-core intel laptop, USB-3 port.) It's not required for an earlier 2-core haswell laptop w/ USB-3. See the PR for more information. PR: kern/247528 Differential Revision: https://reviews.freebsd.org/D48517 --- sys/dev/rtwn/rtl8192e/r92e_chan.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sys/dev/rtwn/rtl8192e/r92e_chan.c b/sys/dev/rtwn/rtl8192e/r92e_chan.c index 4c7121a80c89..4cf17433d257 100644 --- a/sys/dev/rtwn/rtl8192e/r92e_chan.c +++ b/sys/dev/rtwn/rtl8192e/r92e_chan.c @@ -252,4 +252,28 @@ r92e_set_chan(struct rtwn_softc *sc, struct ieee80211_channel *c) /* Set Tx power for this new channel. */ r92e_set_txpower(sc, c); + + /* + * Work around some timing issues with RTL8192EU on faster + * CPUs / USB-3 ports by sleeping for 10ms. + * + * Without this delay the initial frame send during authentication + * doesn't occur. + * + * My (adrian) guess is that there's a race condition between + * everything being programmed into the hardware and the first + * send. Notably, TXPAUSE isn't 0x0 after rf init, + * which the rtl8xxxu driver has a commit to address (c6015bf3ff1ff) + * - wifi: rtl8xxxu: fixing transmission failure for rtl8192eu + * + * Although it's hard to do due to locking constraints, reading + * TXPAUSE during scan / association shows it's non-zero, which + * needs to be looked at in more depth. + * + * Linux doesn't have a delay here, however it does try multiple + * times to send an authentication frame. + * + * See PR/247528 for more info. + */ + rtwn_delay(sc, 10000); }