Received: by 2002:ac8:4f8f:0:b0:429:955e:b7c6 with SMTP id j15csp20923qtw; Tue, 16 Jan 2024 13:38:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IG0+4PyqRtISJRWcWEX5v5rDVp3oDfO1sEFerdr3VJ+5oT6OJ7pAz0B1lQBUz64dzI46Gog X-Received: by 2002:a05:620a:4689:b0:783:70f2:b797 with SMTP id bq9-20020a05620a468900b0078370f2b797mr515698qkb.108.1705441108703; Tue, 16 Jan 2024 13:38:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705441108; cv=pass; d=google.com; s=arc-20160816; b=FSVuPScXqKTn29+FKEZLijgCCMG20kw5iMAEQ6V20oPbUxA99ItpZWPhpaDbtTV+AL xpRuQeCxRkuNzDIs68MqdwIuZB9C1qSndHQ3AeGitUIEy2VXcuUTHTxqSswLlqfhspLd 4PeQ3jQkg1/iaH+0ZeGthHnUVCnvxHc6HoZvYFgDm80pLGf8Fq0s1YCE7fsZnr8pBrQn 0L+WscK9NcY4VYr8u2Mn3ZewtDtg7p3lLUNr48/0GLedUfI31G6M26IFtz7LU76XysYU h5VqPs5YKGkXgfVpX6DyiWimAbZpaqdf6X3DbigGSF7h1uOSpZD/m2Gq6AuOonhMNOXk A2XQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=xMg46FofMbyxC8MHGH7wFL03NTsY9lnh4EUrbVb3fxQ=; fh=4Jtr/Xq1G46gTiSKRC/8ZZRiaNEH/H+FQsZHLCmJDR8=; b=AzKAc1RwSzRYrpd71slG0P2Zm0i9LtwUxwpRyGcW3bc2DUEtEuF0Bt01JXyukbmHiI Ak6G427vxLoqGo1rKeV3ShIQ6QIsCEPhjZwN2uh527JOKdxnzQIVz4giOX7S/UeqBFkL V7ybKjg/iyzlVHe/R0uFbP+MoFLsEeJfeAUSwl5A7y1VtUAIbL+ekuIdvafbluQTfzcV Vp0JueYMeYM40jj4T2vTTH1UZ6oXHJcRILP30rCkeZ5TKlfu1r0b8dYyFR8lPeg9/2lq Z3NbAiR6g23Y9kUo6qiF28UxjHu9Npp7nNNqAuoktBtBfi2NDMlHaGKjVgh1afQfko0I GRzw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C0CqQpnF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-2046-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2046-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id oq47-20020a05620a612f00b007833aafe7b4si10172197qkn.621.2024.01.16.13.38.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 13:38:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-2046-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C0CqQpnF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-wireless+bounces-2046-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-2046-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8C5591C26430 for ; Tue, 16 Jan 2024 21:38:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B8DE8159595; Tue, 16 Jan 2024 20:00:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="C0CqQpnF" X-Original-To: linux-wireless@vger.kernel.org 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 8D096159578; Tue, 16 Jan 2024 20:00:47 +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=1705435247; cv=none; b=i3zddoZqPmO4N5yHj1PSUFwPgUE6ioKLpQLmoTcs9DIjL4+fcK3bORa4et8+190qm8srQ/+U8sYus1lmIGNOZ8tZq1GTSxvCTVnPyCx0+ThVVR1Y3wIXwguiOzicqp5kmMUnB3qXqqyLUB+qSNymyejNWppjYnFtuq0JCVXURBA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705435247; c=relaxed/simple; bh=BFuDl7jZgUpCrCi2lYx1c4RCb0gQPBMpbsEwz7aPAPo=; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID: X-Mailer:MIME-Version:X-stable:X-Patchwork-Hint:X-stable-base: Content-Transfer-Encoding; b=WQm1PHXLK5XvMZQHlai+eefiXJl2RxL7M6ZamUcASQIOIDm1SWamUvy1oF741e+F2L6cPtM1iMAZeDHAFfc5Wc/UcBWIH5FGr1y7VzfxyGtteTq0df4+qEYT7VbOtrG3+mYjcMpCET3RPBrnAmsAEekGFsxJlz3H7GXxVX2TDTw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C0CqQpnF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B6E8C433C7; Tue, 16 Jan 2024 20:00:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705435247; bh=BFuDl7jZgUpCrCi2lYx1c4RCb0gQPBMpbsEwz7aPAPo=; h=From:To:Cc:Subject:Date:From; b=C0CqQpnFSPnnI2HnyuIjL+uycWVnX8tPJptmh53vGCy8NREp8AK4HyUbXekjFf28X YaHN5XGbp/ND5+bUpUsiMWpUJlE/uRc3zPCHUSFdEAzpACvx3qgugpca+2ltye1yS7 wadyIHRWlbXE5VXyd8UyeM2u14/peV9RAPGpfghPssZf6OCAX+ItxWHmS2Wn5UXWbR WQTl3g2PmkUb6FboIALF5Ybi3CJWsisig/WNB75ljdmQ3bdBE8sXZ4vcDujRF9uume sYFCBKF6tjKS4tyRNARQkoUejO0pSncH6js1wxhhpvjwv1ud59BLbD/raLWOuEEm5+ QaZ6BpBoIaJ/g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Shiji Yang , Stanislaw Gruszka , Kalle Valo , Sasha Levin , linux-wireless@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 01/44] wifi: rt2x00: restart beacon queue when hardware reset Date: Tue, 16 Jan 2024 14:59:30 -0500 Message-ID: <20240116200044.258335-1-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.10.208 Content-Transfer-Encoding: 8bit From: Shiji Yang [ Upstream commit a11d965a218f0cd95b13fe44d0bcd8a20ce134a8 ] When a hardware reset is triggered, all registers are reset, so all queues are forced to stop in hardware interface. However, mac80211 will not automatically stop the queue. If we don't manually stop the beacon queue, the queue will be deadlocked and unable to start again. This patch fixes the issue where Apple devices cannot connect to the AP after calling ieee80211_restart_hw(). Signed-off-by: Shiji Yang Acked-by: Stanislaw Gruszka Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/TYAP286MB031530EB6D98DCE4DF20766CBCA4A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM Signed-off-by: Sasha Levin --- drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 3 +++ drivers/net/wireless/ralink/rt2x00/rt2x00mac.c | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c index b04f76551ca4..be3c153ab3b0 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c @@ -101,6 +101,7 @@ void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev) rt2x00link_stop_tuner(rt2x00dev); rt2x00queue_stop_queues(rt2x00dev); rt2x00queue_flush_queues(rt2x00dev, true); + rt2x00queue_stop_queue(rt2x00dev->bcn); /* * Disable radio. @@ -1272,6 +1273,7 @@ int rt2x00lib_start(struct rt2x00_dev *rt2x00dev) rt2x00dev->intf_ap_count = 0; rt2x00dev->intf_sta_count = 0; rt2x00dev->intf_associated = 0; + rt2x00dev->intf_beaconing = 0; /* Enable the radio */ retval = rt2x00lib_enable_radio(rt2x00dev); @@ -1298,6 +1300,7 @@ void rt2x00lib_stop(struct rt2x00_dev *rt2x00dev) rt2x00dev->intf_ap_count = 0; rt2x00dev->intf_sta_count = 0; rt2x00dev->intf_associated = 0; + rt2x00dev->intf_beaconing = 0; } static inline void rt2x00lib_set_if_combinations(struct rt2x00_dev *rt2x00dev) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c index 2f68a31072ae..795bd3b0ebd8 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00mac.c @@ -599,6 +599,17 @@ void rt2x00mac_bss_info_changed(struct ieee80211_hw *hw, */ if (changes & BSS_CHANGED_BEACON_ENABLED) { mutex_lock(&intf->beacon_skb_mutex); + + /* + * Clear the 'enable_beacon' flag and clear beacon because + * the beacon queue has been stopped after hardware reset. + */ + if (test_bit(DEVICE_STATE_RESET, &rt2x00dev->flags) && + intf->enable_beacon) { + intf->enable_beacon = false; + rt2x00queue_clear_beacon(rt2x00dev, vif); + } + if (!bss_conf->enable_beacon && intf->enable_beacon) { rt2x00dev->intf_beaconing--; intf->enable_beacon = false; -- 2.43.0