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: 8608931 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 376309F6E1 for ; Thu, 17 Mar 2016 09:49:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4CE9A2026C for ; Thu, 17 Mar 2016 09:49:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5DC2B201CD for ; Thu, 17 Mar 2016 09:49:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935450AbcCQJtF (ORCPT ); Thu, 17 Mar 2016 05:49:05 -0400 Received: from mail-lb0-f180.google.com ([209.85.217.180]:34031 "EHLO mail-lb0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932084AbcCQJtC (ORCPT ); Thu, 17 Mar 2016 05:49:02 -0400 Received: by mail-lb0-f180.google.com with SMTP id k12so64673379lbb.1 for ; Thu, 17 Mar 2016 02:49:01 -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=OsAsR3vfa3yLhuSCWtzyGOuMhxqGhS9DxKQHzeSkZUQuxZtXbCuib/pPogbqwkqHDG anUWM5phuXwm6HBXll9C7+VzthfoJA9IqmPdEPm4bKXGB/m+wsRIp09asBarkdk7IfAD DOcebXbV6499+8Fxum5ZdeIUtUcYKEO7mxYGJGfoW8Q1newFyiuyLKE0bjLjji1qbp45 LymVT1RK/ciuKggA0SVuC2R71qACfzocIEQmjYcc23LFaRAVHbcaCjaoaYdHS/xD5kXh ntw0XjqN1jMgqvNsROm2yd4PY5JFaL4eswerR7hW56oYMfZJnB88EDLojzRtBI2p+QXA B4xA== X-Gm-Message-State: AD7BkJIsF69ObB6MBtY3HHLmTcVHusmbOnMsFpB5EzMNEPMpadvJ281bFOkV6SiHDo9ER00Hc0DCKV5evyY9OICgL/gQl4S9EAVxPcNzmL4VOaP6TB3BjnJ1w0SsaL8qnRDs+JsAKgIqFA== 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 Cc: linux-wireless@vger.kernel.org, Michal Kazior 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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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); }