Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3976263pxb; Tue, 25 Jan 2022 00:26:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwqIggbLT0BiB5gybd3nZrbkWd/JMNB5YpvrUb9CMTg49swAmN4GIW/qCVRpPdJIKtpmFAM X-Received: by 2002:a17:907:62a1:: with SMTP id nd33mr15252008ejc.578.1643099200125; Tue, 25 Jan 2022 00:26:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643099200; cv=none; d=google.com; s=arc-20160816; b=oyaVqadYNPeLv8cKt6zGkNjEyavFOFgtem503s0rw4UiGSJBWaiIDrgO/DnV8Rqb4g +ZOvbBzLQ3rRtbFio7FWK7WuKmNb/6Va9c/PFv3ZbK1yOXj9QCETaE+XCXImXg4x/fk3 0uoOn+sxkCPhn6k7aRZ4nje50WM+ceaeyz+fM8zy+b5Hz6kVO+4ETuhOvnn6Wk93k6f5 2fkGMuJ8cvudJzRVieVGH7Nzxa5owtMS/fcPEivIGdbcKxiku1ZaIa+3JftE6k819dz6 Gi4dN5CpxwrAYkA605526uaAZsThr4Z3Bvx3kGeHfkzWVhXwTWq0s1m90dDaZ6tQsE86 I0fA== 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=duLINSiqWwY+dcctB06UsTzcgPEhzAtvuiwNh3Lh+Yw=; b=RXK6BdoIsKmm7Z/m7xiKj1AsIBqVczkRUGOTSUw+kY2C4Q3fVHgs1jhrR9L/nBAZrJ yvUaGo+0Mfgdis/JS/QPsUkBO/6k1qkLAbvdaywsIilT8D+HniNAYTw4UfPtxFhPZ8e6 hTnLHS+5zgzfX469a6cd3f/y3ZMMXsIUk6ku0eUdX1p9B3PwzAwbbBNC3O7x9slldayZ u//RqCPCmoNUw9hnG8LtKOOyUv9JiuIeFDWoPRkMjXgnMg0gEZj4sa27zfIfGwbl/MAz eY/nrYyN9iemw3on2FXhAjhxP1FRgtaHCQpLRHANCU1fx/tkmc5Zqmg5ShJvX+V+Lmnt Tn7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=P1wOvy8H; 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 w20si8735151eje.418.2022.01.25.00.26.15; Tue, 25 Jan 2022 00:26:40 -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=P1wOvy8H; 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 S3422122AbiAYCaV (ORCPT + 99 others); Mon, 24 Jan 2022 21:30:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379374AbiAXULU (ORCPT ); Mon, 24 Jan 2022 15:11:20 -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 6B422C06F8E0; Mon, 24 Jan 2022 11:33: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 28EF6B811FC; Mon, 24 Jan 2022 19:33:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5086AC340E5; Mon, 24 Jan 2022 19:33:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052804; bh=QzS4tXh8Kdb+NYlC5nFHkToGbuxguFI/gh7D8iqd0oc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P1wOvy8Hbe/UQQhFjKIQpwcWFztU2WqXQ81VQ5db290uHArVItTIuCzJyMdCjG8dm UXgTd3Sf3LbM2O8pD+GuZBskXqiiG56t1vHjC/kt3VQwxb8Mm3jiuC+/9bO3AX8MfG NDuUEMi0D/rYbneTLqFcxWi1NQ2hPRY76DKtB/ag= 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.4 180/320] ath10k: Fix tx hanging Date: Mon, 24 Jan 2022 19:42:44 +0100 Message-Id: <20220124183959.787054022@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@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 c38e1963ebc05..f73ed1044390c 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 f46b9083bbf10..2c254f43790d2 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -80,8 +80,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); rcu_read_lock(); -- 2.34.1