From patchwork Thu Mar 17 09:51:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 8608991 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D15AB9FD29 for ; Thu, 17 Mar 2016 09:49:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E298A20306 for ; Thu, 17 Mar 2016 09:49:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0581F2026C for ; Thu, 17 Mar 2016 09:49:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1agUYZ-0003Zp-Ic; Thu, 17 Mar 2016 09:49:27 +0000 Received: from mail-lb0-x22f.google.com ([2a00:1450:4010:c04::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1agUYU-0003Nt-HC for ath10k@lists.infradead.org; Thu, 17 Mar 2016 09:49:24 +0000 Received: by mail-lb0-x22f.google.com with SMTP id oe12so64914117lbc.0 for ; Thu, 17 Mar 2016 02:49:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=f1sSvnkOaqwdDOdCrdGziPVXN9GLqcSnAcPIUx2fcDk=; b=hlQZJHC9xjfzTSlPBMgWwJabniO75IkNLWSC4WmNytv8EQWh4HrPNgfKTER/Uozwpa Qm87CoJ63KLPAYly8ZX2ftN20RWBTVMcLicgxRvbe53/Wp1YPHaqVlAeeh6E0xi/JOxB ESspvw0d6oEdpoowUllCzr8U7JKAOaZf68bVw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=f1sSvnkOaqwdDOdCrdGziPVXN9GLqcSnAcPIUx2fcDk=; b=ULbNumuTzi+s5Dpnaw482oQRiwbXUqZFbJoGF7h1Hpybj/++Z7g+Z9lZKS+7FbMJ8A iTnrCdHe/kL+amlUkkb+VIH+j/lAtLSu1sGhWiqmFMdftICHMDaFbPaXlOjaTqlfOMQQ gcQsQelNEWaBiMs8wfnb6vAFeJTiWa0qAZ6kijKdyFFP1TyLsdiclHLOndtd031bwVxc Ey/ILbUBlOI23RLIo/z0xUwwGnSdTlY8OfHT3IU5eqd7cZAlDPkrV4IdyonhnWu9AH6v nsSKUfWxGmYZghXnD5jkRlzlhQddFVhgOy792WNc6ZseogQJorOZsBTBpisCfr74KAdj egqA== X-Gm-Message-State: AD7BkJJiVS0uNcQyjSIoJ31XevmjhF2mbVNQGgWDEnJt3sF7KEkirjzEYw6lIe0/YoK7Ct7VVnMSTCY+XHzMc1tUnBoxaYnOnT/sCtM6AcTVa8uJefcTUNiecPerktHTmxYJ7Ns/BNTaMNg8U+/BGKmJMOplxpTPzKliDYvGdxPnBBrc7wAidrNJoPoAKd4OlQ== X-Received: by 10.112.150.133 with SMTP id ui5mr3139959lbb.12.1458208140653; Thu, 17 Mar 2016 02:49:00 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.10]) by smtp.gmail.com with ESMTPSA id m64sm1213020lfd.36.2016.03.17.02.48.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Mar 2016 02:48:59 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH 2/2] ath10k: fix pull-push tx threshold handling Date: Thu, 17 Mar 2016 10:51:05 +0100 Message-Id: <1458208265-16715-3-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458208265-16715-1-git-send-email-michal.kazior@tieto.com> References: <1458208265-16715-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160317_024922_882766_B1089BFC X-CRM114-Status: GOOD ( 10.59 ) X-Spam-Score: -2.7 (--) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Michal Kazior MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This prevents tx hangs or hiccups if pull-push supporting firmware defines per-txq thresholds or switches modes dynamically. Fixes: 299468782d94 ("ath10k: implement wake_tx_queue") Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 74dd010a9188..4d51b92e67e0 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3772,7 +3772,8 @@ void ath10k_mac_tx_push_pending(struct ath10k *ar) /* Prevent aggressive sta/tid taking over tx queue */ max = 16; - while (max--) { + ret = 0; + while (ath10k_mac_tx_can_push(hw, txq) && max--) { ret = ath10k_mac_tx_push_txq(hw, txq); if (ret < 0) break; @@ -4015,14 +4016,13 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw, struct ath10k *ar = hw->priv; struct ath10k_txq *artxq = (void *)txq->drv_priv; - if (ath10k_mac_tx_can_push(hw, txq)) { - spin_lock_bh(&ar->txqs_lock); - if (list_empty(&artxq->list)) - list_add_tail(&artxq->list, &ar->txqs); - spin_unlock_bh(&ar->txqs_lock); + spin_lock_bh(&ar->txqs_lock); + if (list_empty(&artxq->list)) + list_add_tail(&artxq->list, &ar->txqs); + spin_unlock_bh(&ar->txqs_lock); + if (ath10k_mac_tx_can_push(hw, txq)) tasklet_schedule(&ar->htt.txrx_compl_task); - } ath10k_htt_tx_txq_update(hw, txq); }