From patchwork Fri Aug 16 14:24:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Issam Hamdi X-Patchwork-Id: 820061 Received: from mail.simonwunderlich.de (mail.simonwunderlich.de [23.88.38.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 089C285270 for ; Fri, 16 Aug 2024 14:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=23.88.38.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723818271; cv=none; b=uNXX33JV3DsF6pksvwj0iCDPO+jY03RAmo/I1+U+PXveuqrT4uxx/pbaP3/84ySw2Xp04P4XLgGlAiX0EVKy9xVK3muulh5w0/DRSoaWNfC2Y2q9FZK+qxgaxeuX48pEWvQRV+Qui3uFfxMRSXqvT15HAWytTRYv9zRk+ivxLBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723818271; c=relaxed/simple; bh=aoY2IcLLuPhJSY+lwOSnO2cpaPaskquNCjLWNK8ruxc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sVju23BjMoecCj9c3+7g6lHY5ZMnegZALV1WHzIJ3HbKNgrnoCoAoUtCXNUSw+aMbx2ZMvWsegPnJFS18eYyrLO6YgixQ9VATAo05NHIwJzglpEL4jjtdxdspWEyDrdb8MLTF1HO2doNmKzaHTSjE+bYwAHr5FhQDwQGTIK4Y4o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=simonwunderlich.de; spf=pass smtp.mailfrom=simonwunderlich.de; arc=none smtp.client-ip=23.88.38.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=simonwunderlich.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=simonwunderlich.de Received: from localhost (p200300c59701d290000000000000032b.dip0.t-ipconnect.de [IPv6:2003:c5:9701:d290::32b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.simonwunderlich.de (Postfix) with ESMTPSA id BC7C2FA131; Fri, 16 Aug 2024 16:24:20 +0200 (CEST) From: Issam Hamdi To: quic_jjohnson@quicinc.com Cc: ih@simonwunderlich.de, johannes@sipsolutions.net, kvalo@kernel.org, linux-wireless@vger.kernel.org, lkp@intel.com, llvm@lists.linux.dev, mathias.kretschmer@fit.fraunhofer.de, oe-kbuild-all@lists.linux.dev Subject: [PATCH v3] wifi: cfg80211: Set the channel definition for the different Wi-Fi modes when starting CAC Date: Fri, 16 Aug 2024 16:24:18 +0200 Message-Id: <20240816142418.3381951-1-ih@simonwunderlich.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <9809b165-8d25-4984-a1dd-6fca28f1dda9@quicinc.com> References: <9809b165-8d25-4984-a1dd-6fca28f1dda9@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When starting CAC in a mode other than AP mode, it return a "WARNING: CPU: 0 PID: 63 at cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211]" caused by the chandef.chan being null at the end of CAC. Solution: Ensure the channel definition is set for the different modes when starting CAC to avoid getting a NULL 'chan' at the end of CAC. Call Trace: ? show_regs.part.0+0x14/0x16 ? __warn+0x67/0xc0 ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] ? report_bug+0xa7/0x130 ? exc_overflow+0x30/0x30 ? handle_bug+0x27/0x50 ? exc_invalid_op+0x18/0x60 ? handle_exception+0xf6/0xf6 ? exc_overflow+0x30/0x30 ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] ? exc_overflow+0x30/0x30 ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] ? regulatory_propagate_dfs_state.cold+0x1b/0x4c [cfg80211] ? cfg80211_propagate_cac_done_wk+0x1a/0x30 [cfg80211] ? process_one_work+0x165/0x280 ? worker_thread+0x120/0x3f0 ? kthread+0xc2/0xf0 ? process_one_work+0x280/0x280 ? kthread_complete_and_exit+0x20/0x20 ? ret_from_fork+0x19/0x24 Reported-by: Kretschmer Mathias Signed-off-by: Issam Hamdi --- v2: update the subject v3: update the second Signed-off-by to Reported-by --- net/wireless/nl80211.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) base-commit: cc32e9fb380d8afdbf3486d7063d5520bfb0f071 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 7397a372c78e..36ae2594753e 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -10143,7 +10143,23 @@ static int nl80211_start_radar_detection(struct sk_buff *skb, err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms); if (!err) { - wdev->links[0].ap.chandef = chandef; + switch (wdev->iftype) { + case NL80211_IFTYPE_MESH_POINT: + wdev->u.mesh.chandef = chandef; + break; + case NL80211_IFTYPE_ADHOC: + wdev->u.ibss.chandef = chandef; + break; + case NL80211_IFTYPE_OCB: + wdev->u.ocb.chandef = chandef; + break; + case NL80211_IFTYPE_AP: + case NL80211_IFTYPE_P2P_GO: + wdev->links[0].ap.chandef = chandef; + break; + default: + break; + } wdev->cac_started = true; wdev->cac_start_time = jiffies; wdev->cac_time_ms = cac_time_ms;