From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D261C433FE for ; Tue, 21 Dec 2021 02:04:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235069AbhLUCD7 (ORCPT ); Mon, 20 Dec 2021 21:03:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234564AbhLUCC0 (ORCPT ); Mon, 20 Dec 2021 21:02:26 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02610C06137A; Mon, 20 Dec 2021 18:01:21 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BF0EEB81114; Tue, 21 Dec 2021 02:01:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BC32C36AEA; Tue, 21 Dec 2021 02:01:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640052078; bh=w0RVGCeueN/la09ebnRmDq2WhTwUHXFzYlYFFfb2mYw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HD37SXDqbmpLfHlGMLg+r15u1YwnffUOgSpnIFrB2fhbkaH+q5Y/kjRNIQaVYGlp+ ZfnaoDb+3+WWGvuRJWyLjtC0ztRKtNigFDlscsBY6BHSOM3jjH2ZqVJpXTXrKnIY4T dma5RMJ08hjGpxjA4a0sXXEelOvhoUjJRkn7GJj+VGO1Hw2RlcdXhAeB962Ao7MX/I UqLa3yO9QwmpvwAqM7/Dbdl4LY2w6HLK9p26HI7EbIEjg4382oFA5ILwP9ypa38ocD njj1f3ODVZHLdTGu7EkmPSjn4LC9UFTuqwS3gP6YjWiNEnxYcllaxUu8mkS+vEQv4S q8qi3sM15FpDQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Johannes Berg , Luca Coelho , Sasha Levin , johannes@sipsolutions.net, davem@davemloft.net, kuba@kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 08/11] mac80211: do drv_reconfig_complete() before restarting all Date: Mon, 20 Dec 2021 21:00:27 -0500 Message-Id: <20211221020030.117225-8-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211221020030.117225-1-sashal@kernel.org> References: <20211221020030.117225-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johannes Berg [ Upstream commit 13dee10b30c058ee2c58c5da00339cc0d4201aa6 ] When we reconfigure, the driver might do some things to complete the reconfiguration. It's strange and could be broken in some cases because we restart other works (e.g. remain-on-channel and TX) before this happens, yet only start queues later. Change this to do the reconfig complete when reconfiguration is actually complete, not when we've already started doing other things again. For iwlwifi, this should fix a race where the reconfig can race with TX, for ath10k and ath11k that also use this it won't make a difference because they just start queues there, and mac80211 also stopped the queues and will restart them later as before. Signed-off-by: Johannes Berg Signed-off-by: Luca Coelho Link: https://lore.kernel.org/r/iwlwifi.20211129152938.cab99f22fe19.Iefe494687f15fd85f77c1b989d1149c8efdfdc36@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/util.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/net/mac80211/util.c b/net/mac80211/util.c index a653632ac5902..7eda8b59e4da8 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -2222,6 +2222,13 @@ int ieee80211_reconfig(struct ieee80211_local *local) mutex_unlock(&local->sta_mtx); } + /* + * If this is for hw restart things are still running. + * We may want to change that later, however. + */ + if (local->open_count && (!suspended || reconfig_due_to_wowlan)) + drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART); + if (local->in_reconfig) { local->in_reconfig = false; barrier(); @@ -2240,13 +2247,6 @@ int ieee80211_reconfig(struct ieee80211_local *local) IEEE80211_QUEUE_STOP_REASON_SUSPEND, false); - /* - * If this is for hw restart things are still running. - * We may want to change that later, however. - */ - if (local->open_count && (!suspended || reconfig_due_to_wowlan)) - drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART); - if (!suspended) return 0; -- 2.34.1