From nobody Sat Jun 11 13:02:02 2022 X-Original-To: dev-commits-src-main@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 29E5A8340D8; Sat, 11 Jun 2022 13:02:03 +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 4LKyf30kdPz4hHn; Sat, 11 Jun 2022 13:02:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654952523; 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=dGFSVWAd76U40DPdTavkReC70s0xIit53I9TcSIadZg=; b=dkCYxnjAjUBGY/w9wlUiowOL6wXTFcghdDU+VVxNB2oiTe0droktW/iQXmj2TNMODbiAG5 wd4w2TKEhfesNCXbZN6dBM20HjhgXl5hscISVzz7XHWrJ++qq5AUrIBxeZ7E16pkUU6Xur 2ITAAdy9I48nBrD5C36FczmUA9YFI6/bPAPLJKN+BnfBU5oBjtBQsILOcP3Pe3A/HA3dIn HZfrE6EISF68Iw8/NB3/7DPbQ26hy4NIXyrKfmZxaP38iIPm3ppqvB3Z8zFiNO2uY17lQb Y7l47qJAHt0ijVyxTMi1Cvkn2FBVv8wzb9eoTa2eOcGZDQu6le2+c0PcefwaAQ== 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 ED5315815; Sat, 11 Jun 2022 13:02:02 +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 25BD22XG012213; Sat, 11 Jun 2022 13:02:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25BD225p012212; Sat, 11 Jun 2022 13:02:02 GMT (envelope-from git) Date: Sat, 11 Jun 2022 13:02:02 GMT Message-Id: <202206111302.25BD225p012212@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: 013e516dc9b1 - main - LinuxKPI: 802.11: fix iwlwifi fw assert with older chipsets List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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: 013e516dc9b1b32e9422ab02a875a05fc2d32f39 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1654952523; 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=dGFSVWAd76U40DPdTavkReC70s0xIit53I9TcSIadZg=; b=oC9Vj9YlQXU2byISiGqHkMsITdYIfGJHybcCybTqWw0WK+h1+W+RIjC4fB1Dbb+K4RaQ8y yAt/H/90hFFowpSSwhV1VZTKx190/8lE/x0G2mQqGuBav7XTZ8uMxL6obUd5XYljiiifQ8 /5l8di1vL1oP1dvt/hKUKFaBBNLZGGnPogIWCe08lDBDu/7NGy27jB9MqKtBEN8i/+Y6el EkAa0mPiVrma96uMWix8ovrJFRFKlpwK4QD27IlXtwHuntsG/RgDCYGx2a2d0+9NxeS6VB umCzEnYErIOlSkZQojsweFmQKQuOCVUAHGSZCs81CxGb/zLN9I5xqN9tw1Istg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1654952523; a=rsa-sha256; cv=none; b=JdG1CuSDjlWKJiJEziW7OSYORV8kQ9R27lWrWGS2aZdi0sa4kaCQG8/gOWRprffyhAU+Ed uc5K41YRD9Tari1JgNBgiobRKt0vmolhUgE7GrhNUEp4rPnPM5nYaAjNqYMKr/h62TA3kC c394c8AI4Fp3baG5ijvTWBMP5to2D5UCE5uxG9SQ79B9as6qLnQH7mIBfCrATH0kRiqsMd DyIUyHKcYEApOdFKidM3832sS1Xn19q+ILQ5vFRAgnJf8BXZLRNJ2Uoi+A6jHO161uBdUi 3+xJqGyKrp/4/c0Xhh5sLZ+eyvrJV1YB/5ciSlw65BNNSKrZndGiH8VXaBRZcg== 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=013e516dc9b1b32e9422ab02a875a05fc2d32f39 commit 013e516dc9b1b32e9422ab02a875a05fc2d32f39 Author: Bjoern A. Zeeb AuthorDate: 2022-06-11 12:49:40 +0000 Commit: Bjoern A. Zeeb CommitDate: 2022-06-11 12:49:40 +0000 LinuxKPI: 802.11: fix iwlwifi fw assert with older chipsets A problem which showed up on 13.1 between BETA3 and RC1 was that on older chipsets the fw would crash. While some 0x18 ADD_STA problems were seen before, d9f59799fc3e was the actual trigger for this problem (in 0x28 MAC_CONTEXT command) in a squashed merge to the releng branch. Strangely there were no changes to assoc_to_run in that revision so other circumstances may be the actual cause but swapping the bss_info update and the sta_state in that function seem to make my 8265 happy while AX200 and AX210 stay good. Thanks to everyone who helped debug this. Sponsored by: The FreeBSD Foundation (partially) MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index a0cb20cf9032..4b473bfe2314 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -1509,23 +1509,14 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int vif = LVIF_TO_VIF(lvif); IEEE80211_UNLOCK(vap->iv_ic); - ni = NULL; IMPROVE("ponder some of this moved to ic_newassoc, scan_assoc_success, " "and to lesser extend ieee80211_notify_node_join"); - /* Finish assoc. */ - /* Update sta_state (AUTH to ASSOC) and set aid. */ ni = ieee80211_ref_node(vap->iv_bss); lsta = ni->ni_drv_data; KASSERT(lsta != NULL, ("%s: ni %p lsta is NULL\n", __func__, ni)); - KASSERT(lsta->state == IEEE80211_STA_AUTH, ("%s: lsta %p state not " - "AUTH: %#x\n", __func__, lsta, lsta->state)); sta = LSTA_TO_STA(lsta); - sta->aid = IEEE80211_NODE_AID(ni); - error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_ASSOC); - if (error != 0) - goto out; IMPROVE("wme / conf_tx [all]"); @@ -1559,6 +1550,16 @@ lkpi_sta_assoc_to_run(struct ieee80211vap *vap, enum ieee80211_state nstate, int lkpi_80211_mo_bss_info_changed(hw, vif, &vif->bss_conf, bss_changed); + /* This MUST come after the bss_info_changed. */ + /* Finish assoc. */ + /* Update sta_state (AUTH to ASSOC) and set aid. */ + KASSERT(lsta->state == IEEE80211_STA_AUTH, ("%s: lsta %p state not " + "AUTH: %#x\n", __func__, lsta, lsta->state)); + sta->aid = IEEE80211_NODE_AID(ni); + error = lkpi_80211_mo_sta_state(hw, vif, sta, IEEE80211_STA_ASSOC); + if (error != 0) + goto out; + /* - change_chanctx (if needed) * - event_callback */