Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3619019pxb; Mon, 24 Jan 2022 13:39:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEKbQA3RRDecqh2G9+QeO7JfPNEr0RKZmhm00Xa8M0hGSn9r/EX4h7BFb/ZC2Gtb7BwHDM X-Received: by 2002:a17:90b:1e45:: with SMTP id pi5mr303080pjb.82.1643060357593; Mon, 24 Jan 2022 13:39:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643060357; cv=none; d=google.com; s=arc-20160816; b=JnitfmKLj/d0cBqeDdcfVZXBxXFLjZK4VxLdASBOSuo7vC28VJk54LzZWnJYAENe7J csmtNOintveCzelIOgvIu1vcnqxuYsTwaJe/GHVUFxzJ3CreAAr6YeZRF7x0kZarweeL zM/LulEG208g/nd+d1qFwezjUXq7OkjQ/kjZ0T2/GaMmYKQwq7arB16kn9vsyvxZBrrC bLtCB78rOttLWem5CZaB+Cev56D2/H9PEXMNMjcgRZdLKr13r6JsgxPYB4GfNysO+xRr iKij0RMJ/0Hd8eI7OSTwa0tsqhq2bVuRsmILzVg1v3A0qNX0LZ9tqBTQ1wv8ziKJ0qIN FOhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Z2PMv/Ht0Fwr57LAvMgJgG9UrUiR23cjL5chwhuTyMY=; b=ybKz6Je8Pk5fHZ5+dzaLAGB8p9iNTcF/kkRysRpwsysjH9s2Mvy1jo5hyZ93O/bjYr YF0FA+AdIXPfNq+hDBG6lntFHQ5435IDDTPcMv6pldW9bpVV89uQ/i5SvDXdLS6Nd+9g 9KF9HCkiKrsjJUgzjvLOAHqNXYNbjLYVc+S4ENLsq4T5Pkl1UQSgpQvPpTapBxxzWV/C YPNih9hxHB6DpGMqBmMV8CbzXwNQuzhcqvYfkmivTfdCt+kyowCEiJjWya+B1HYJDqDG V3gDG7s0RVqQzV6AadzOnRIoRWOniO2SSR1A6xdc8U/2lV/8P339ocwErMHXTK9wXVEe AW1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=alcG0En+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e7si409193pjd.32.2022.01.24.13.39.05; Mon, 24 Jan 2022 13:39:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=alcG0En+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1450681AbiAXVVL (ORCPT + 99 others); Mon, 24 Jan 2022 16:21:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1441924AbiAXUwX (ORCPT ); Mon, 24 Jan 2022 15:52:23 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47EDCC054336; Mon, 24 Jan 2022 11:58:44 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D9D6C60B43; Mon, 24 Jan 2022 19:58:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2ADFC340E5; Mon, 24 Jan 2022 19:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643054323; bh=HBx2Z0bo2vlrE7hqQN6Os7uEULxdugf4B9uv+P7rybc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=alcG0En+VMtFGIBsXGjRtdHapGd6w2so9qAJzLz5j+SKLWCG9uEUg5ET/CA2VnGq4 c/PlOhDJHqw2BpI5mG7LjAJlXENiSCAjitICQXcYsdQuzwrhEO0iqdtvq8e4jgHQNl FfUpnPHl0puv+8Y3WXjFPipb1iBx8O6UwHxMDb8k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sebastian Gottschall , Kalle Valo , Sasha Levin Subject: [PATCH 5.10 350/563] ath10k: Fix tx hanging Date: Mon, 24 Jan 2022 19:41:55 +0100 Message-Id: <20220124184036.511935255@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184024.407936072@linuxfoundation.org> References: <20220124184024.407936072@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sebastian Gottschall [ Upstream commit e8a91863eba3966a447d2daa1526082d52b5db2a ] While running stress tests in roaming scenarios (switching ap's every 5 seconds, we discovered a issue which leads to tx hangings of exactly 5 seconds while or after scanning for new accesspoints. We found out that this hanging is triggered by ath10k_mac_wait_tx_complete since the empty_tx_wq was not wake when the num_tx_pending counter reaches zero. To fix this, we simply move the wake_up call to htt_tx_dec_pending, since this call was missed on several locations within the ath10k code. Signed-off-by: Sebastian Gottschall Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210505085806.11474-1-s.gottschall@dd-wrt.com Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath10k/htt_tx.c | 3 +++ drivers/net/wireless/ath/ath10k/txrx.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index 1fc0a312ab587..5f67da47036cf 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -147,6 +147,9 @@ void ath10k_htt_tx_dec_pending(struct ath10k_htt *htt) htt->num_pending_tx--; if (htt->num_pending_tx == htt->max_num_pending_tx - 1) ath10k_mac_tx_unlock(htt->ar, ATH10K_TX_PAUSE_Q_FULL); + + if (htt->num_pending_tx == 0) + wake_up(&htt->empty_tx_wq); } int ath10k_htt_tx_inc_pending(struct ath10k_htt *htt) diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index aefe1f7f906c0..f51f1cf2c6a40 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -82,8 +82,6 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt, flags = skb_cb->flags; ath10k_htt_tx_free_msdu_id(htt, tx_done->msdu_id); ath10k_htt_tx_dec_pending(htt); - if (htt->num_pending_tx == 0) - wake_up(&htt->empty_tx_wq); spin_unlock_bh(&htt->tx_lock); rcu_read_lock(); -- 2.34.1