Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3556312pxb; Mon, 24 Jan 2022 12:08:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwr5Q71uhzkR6y+qC5aId6HqvuuPYd3o0JMxNHxTttDU+UFv1g1S2jXsSTAgU0bd6U4N77c X-Received: by 2002:a17:902:bd4b:b0:149:460a:9901 with SMTP id b11-20020a170902bd4b00b00149460a9901mr15464917plx.44.1643054914210; Mon, 24 Jan 2022 12:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643054914; cv=none; d=google.com; s=arc-20160816; b=F+e01Gy5bVHJU1pQQofgV4G2L2yIdAXQCNA6m6GyTk2P6tAsdlhlV9UURpbwSMDeHo Ijs1Ou0UnnR+9pXiyBgs49K32jbpIO8vxrBFtzgOdOjELusJ36aoDDXIDl3fRdrIpKbA x1s3IUBaipDQ9yZDWSoQKZJ4ubKBDZDP+WnvoPO7EHa44O5aMPZVl0lVFYRkw+gKHok5 Rsgj2MqjG2e+jBuMmtSEKBvhVYmmM55ZVNtiUoMwDe74bHFuU8j4AH+EZO/a7l8imRdo Vs06YwpwAEVc7EDdEcnyVDXKSoqsH3NXYfAXjeAS5nB22k4aLmRzU8mYGPsNMCdeD+Wg x1yw== 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=JyW0Upqv7lTyVKZ3wpivI+c+91jLYaAFLUDhjehGN4Y=; b=RhDw7yZEoU0wfcrX5uRBkbbGginZjieJtZmd+WrAyH5+lThdqL5pwVvhaHqY4Gmend n8SsMb7SJRCYCl4efcgKEIcrPLQ6+CJM+ODpe1Q+BYAwmApv5cLgzaSAJuE2Mk+ngtwI mJV4V9PUF70jxLyTumXu/Vp6/+jhB41U3fw92XTDQjYLZUuauvP6yYOCVSsxFSHLlGWe 7Vq3G983GEZSnx5sDNBNt5xlws4+5bokEKMURCmLbCu8tS2LbxM30K0GnWuwDWWnI9Zn ydg1mvoCVVb/2kTGffV/KQk5EOfSk6zTbb9xhR3V2W1TSP1fLqsHr5ZRxmHjpXhodN/C 5uSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KmRuewr7; 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 n4si251674pjk.138.2022.01.24.12.08.21; Mon, 24 Jan 2022 12:08:34 -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=KmRuewr7; 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 S245457AbiAXTHd (ORCPT + 99 others); Mon, 24 Jan 2022 14:07:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345879AbiAXTBO (ORCPT ); Mon, 24 Jan 2022 14:01:14 -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 53369C061A83; Mon, 24 Jan 2022 10:58:27 -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 1CD14B8121B; Mon, 24 Jan 2022 18:58:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54BEAC340E5; Mon, 24 Jan 2022 18:58:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050704; bh=fkB1Uenr+wOd5Si9NwVeQ3Cj6i2+Q4Nx/VagxEJT/Tc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KmRuewr7Xh+iiNhTMzLbA2CUGDG9jJkQz2VvIxZ6NfdVBac0dOuHZdCKRfPQP/Mok cbE/v2Bsu9hVivdbFeb2qV90GUikfmH4kJdgy5z6JwosYjxqXJ41L0ML+ESlWRYoNH 5JKVTvSu3gx0MDjpwFrSXThVA1edSiHr5TyEJMc8= 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 4.9 087/157] ath10k: Fix tx hanging Date: Mon, 24 Jan 2022 19:42:57 +0100 Message-Id: <20220124183935.544944696@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183932.787526760@linuxfoundation.org> References: <20220124183932.787526760@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 ae5b33fe5ba82..374ce35940d07 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -158,6 +158,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 beeb6be06939b..b6c050452b757 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -89,8 +89,6 @@ int ath10k_txrx_tx_unref(struct ath10k_htt *htt, 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); dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); -- 2.34.1