From patchwork Sun May 6 13:25:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10382789 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EFF2660318 for ; Sun, 6 May 2018 13:26:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0FFC288D1 for ; Sun, 6 May 2018 13:26:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C318A28B4B; Sun, 6 May 2018 13:26:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73BBB288D1 for ; Sun, 6 May 2018 13:26:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751297AbeEFN0B (ORCPT ); Sun, 6 May 2018 09:26:01 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:41036 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751180AbeEFN0A (ORCPT ); Sun, 6 May 2018 09:26:00 -0400 Received: by mail-lf0-f68.google.com with SMTP id o123-v6so36889215lfe.8 for ; Sun, 06 May 2018 06:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=/h9x56cY8QiiHcV9MKlja6R5eOFeUJtBBx0j1uNEXWA=; b=PwCHvnKUVFvhyMY40wrJ5dr+Tez9HrJu+Vf73/uBE+zvtNlW4lcc4mnbv7QVmtIwd0 MYTfJWmqWMDQIts1XsOb4bdH5aROVYHBbNvmecGbB1R6WlPpXPVKMIZL/mCarq/lf8ff AgCcyHtUj3Dr+tPm3lrVbApa8qNc30MS17BRHIFPyOwP+l0OLYSp0bn/sV5DXXq5RIZl fvn4GxPQdKI3mhnNLmKYPf+0ehWwveahjZ7wasxBhWjfYhYw56U0ArI0mGl4Ra68dbtS hlPa5HOAO92nImeFJufKu4PIMCTkm5qaPIuRwjH6KY6oOCnwVfiL69U5pXrxYTopSldr ZgEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=/h9x56cY8QiiHcV9MKlja6R5eOFeUJtBBx0j1uNEXWA=; b=XvkvjUFxmfdwWzclgZtX1l45RUapw7pID7NhlB777eG+weWi/EreFOc6A5e5U/hG/D Bm44Ip6INJRYhtdBUML0qpbQ+sGPJLxp6jzlGT+vGw4dd57s2aV28RvEMxLVtJZ9comm mdNIfYDoEC5evFVCovco9UZQgLWKtSRqThmc4fR/FBFhQwtJownzyAV5RpKNmP07AUsH N8xKi+n524FpUQqDCXEIO7egBZfoNBaOIGO0SPF4X+2QI6WROYipAu5/2pBZHwsUW+U6 Cp95uKB0h5+VxVAhLjEdM7zWw4BlAWE6v+Toouqumia2mEzlKgaJtiglubpS1MEaIW3g ygSQ== X-Gm-Message-State: ALQs6tAl7d1mTvx4w0aN7gcN/P4IWZEHTuokzarl5YRYf5RsQxiGsADV yngvXuNpYB5qiQZY11Rs+Kw= X-Google-Smtp-Source: AB8JxZonUywvIxAxY8ODvln1vHGTS7pX4Hd3mh6+MS6rC5tqEH/dYxZ4c/Ja/d8XUn0tNk+S3zE4UQ== X-Received: by 2002:a19:4813:: with SMTP id v19-v6mr20690819lfa.63.1525613158643; Sun, 06 May 2018 06:25:58 -0700 (PDT) Received: from localhost.localdomain (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id z1-v6sm3285890ljz.1.2018.05.06.06.25.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 May 2018 06:25:57 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Cc: Erik Stromdahl Subject: [PATCH] ath10k: fix return value check in wake_tx_q op Date: Sun, 6 May 2018 15:25:00 +0200 Message-Id: <20180506132500.16888-1-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ath10k_mac_tx_push_txq returns either a postive integer (length) on success or a negative error code on error. The "if (ret) break;" statement will thus always break out of the loop immediately after ath10k_mac_tx_push_txq has returned (making the loop pointless). A side effect of this fix is that we will iterate the queue until ath10k_mac_tx_push_txq returns -ENOENT. This will make sure the queue is not added back to ar->txqs when it is empty. This could potentially improve performance somewhat (I have seen a small improvement with SDIO devices). Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 3d7119ad7c7a..487a7a7380fd 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4290,7 +4290,7 @@ static void ath10k_mac_op_wake_tx_queue(struct ieee80211_hw *hw, while (ath10k_mac_tx_can_push(hw, f_txq) && max--) { ret = ath10k_mac_tx_push_txq(hw, f_txq); - if (ret) + if (ret < 0) break; } if (ret != -ENOENT)