From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1D65737883D for ; Mon, 9 Mar 2026 11:42:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773056547; cv=none; b=AlwDFj8t9IS3YsPAxYCGz48Yhnqzo0xcgqAgNKXrNglRHEYHh+dz56UA2kbeZcgY+L2RkO8PTqF06YCha4qxzlpglKsvHpIE2bHKqs853rjc7rL6xXyh90emveo0uJPvo+oJilPDKM5Quc3B77GK4WZk78T2sINIsOeQ77u8xyI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773056547; c=relaxed/simple; bh=+Q77XXYnq52imAZzTOu2w2XkoDmy+d/JkaZy/QSWJwk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sfZnKUdropSL6GTODVDovLMvWKpPHjSahCHV2Zpv2fpZJWi/DkgT06vKPIr7MWE6tReBbJewolM6ogG7g4ig/JHpBhhuk4pLoC8SVUaGchYh0sYe/FIfy12T9KjphyBlNF8rhTdLPMx7bU2rSAgDTPVGbLYQx37n60Qm5zsC7B8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=n/5PBsyG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="n/5PBsyG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F6A5C4CEF7; Mon, 9 Mar 2026 11:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773056546; bh=+Q77XXYnq52imAZzTOu2w2XkoDmy+d/JkaZy/QSWJwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n/5PBsyGxLDtmTLGN8aONLvFIDUBCyg3Ffih3aPuYuqBUASS3mJbaCWD6fDtdseDB Sj+qSVsisv0QwdmpcbIVnKUoVjjgP8mGFTYT/rAFnZep1x017SIWcya+kT9jQE+gMw LJQmsVk7wgOhamNguhhVyUb14lnmJ64xB3fkm1KO5cDEVVC/RKheBI36h+rGneqr4W nsgtZCGA4GmiMmg6dfgoOSEgc2IkJmKGrHDE7b6qaB8jO3BnPqHhUdbxWEFduvdbFI 3tjU1UCHDVLQn6jOJomePoAnOPKe0fo4Iq/no/APdIAGfUjNzM3zRH7kWiSfFjmsPV mRasg138l52kA== From: Sasha Levin To: stable@vger.kernel.org Cc: Johannes Berg , Sasha Levin Subject: [PATCH 5.15.y 1/2] wifi: cfg80211: move scan done work to wiphy work Date: Mon, 9 Mar 2026 07:42:23 -0400 Message-ID: <20260309114224.831897-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <2026030934-cocoa-wrangle-1781@gregkh> References: <2026030934-cocoa-wrangle-1781@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Johannes Berg [ Upstream commit fe0af9fe54d0ff53aa49eef390c8962355b274e2 ] Move the scan done work to the new wiphy work to simplify the code a bit. Signed-off-by: Johannes Berg Stable-dep-of: 767d23ade706 ("wifi: cfg80211: cancel rfkill_block work in wiphy_unregister()") Signed-off-by: Sasha Levin --- net/wireless/core.c | 3 +-- net/wireless/core.h | 4 ++-- net/wireless/scan.c | 14 ++++---------- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/net/wireless/core.c b/net/wireless/core.c index 22e6fd12f2016..f291af14a6459 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -525,7 +525,7 @@ struct wiphy *wiphy_new_nm(const struct cfg80211_ops *ops, int sizeof_priv, spin_lock_init(&rdev->bss_lock); INIT_LIST_HEAD(&rdev->bss_list); INIT_LIST_HEAD(&rdev->sched_scan_req_list); - INIT_WORK(&rdev->scan_done_wk, __cfg80211_scan_done); + wiphy_work_init(&rdev->scan_done_wk, __cfg80211_scan_done); INIT_DELAYED_WORK(&rdev->dfs_update_channels_wk, cfg80211_dfs_channels_update_work); #ifdef CONFIG_CFG80211_WEXT @@ -1104,7 +1104,6 @@ void wiphy_unregister(struct wiphy *wiphy) /* this has nothing to do now but make sure it's gone */ cancel_work_sync(&rdev->wiphy_work); - flush_work(&rdev->scan_done_wk); cancel_work_sync(&rdev->conn_work); flush_work(&rdev->event_work); cancel_delayed_work_sync(&rdev->dfs_update_channels_wk); diff --git a/net/wireless/core.h b/net/wireless/core.h index 18d30f6fa7ca1..2db902c89ff3e 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h @@ -75,7 +75,7 @@ struct cfg80211_registered_device { struct sk_buff *scan_msg; struct list_head sched_scan_req_list; time64_t suspend_at; - struct work_struct scan_done_wk; + struct wiphy_work scan_done_wk; struct genl_info *cur_cmd_info; @@ -445,7 +445,7 @@ bool cfg80211_valid_key_idx(struct cfg80211_registered_device *rdev, int cfg80211_validate_key_settings(struct cfg80211_registered_device *rdev, struct key_params *params, int key_idx, bool pairwise, const u8 *mac_addr); -void __cfg80211_scan_done(struct work_struct *wk); +void __cfg80211_scan_done(struct wiphy *wiphy, struct wiphy_work *wk); void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev, bool send_message); void cfg80211_add_sched_scan_req(struct cfg80211_registered_device *rdev, diff --git a/net/wireless/scan.c b/net/wireless/scan.c index e2b4149e5ff43..10eeb4921f277 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -1079,16 +1079,9 @@ void ___cfg80211_scan_done(struct cfg80211_registered_device *rdev, nl80211_send_scan_msg(rdev, msg); } -void __cfg80211_scan_done(struct work_struct *wk) +void __cfg80211_scan_done(struct wiphy *wiphy, struct wiphy_work *wk) { - struct cfg80211_registered_device *rdev; - - rdev = container_of(wk, struct cfg80211_registered_device, - scan_done_wk); - - wiphy_lock(&rdev->wiphy); - ___cfg80211_scan_done(rdev, true); - wiphy_unlock(&rdev->wiphy); + ___cfg80211_scan_done(wiphy_to_rdev(wiphy), true); } void cfg80211_scan_done(struct cfg80211_scan_request *request, @@ -1114,7 +1107,8 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request, } request->notified = true; - queue_work(cfg80211_wq, &wiphy_to_rdev(request->wiphy)->scan_done_wk); + wiphy_work_queue(request->wiphy, + &wiphy_to_rdev(request->wiphy)->scan_done_wk); } EXPORT_SYMBOL(cfg80211_scan_done); -- 2.51.0