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: 10382791 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 4EA2860318 for ; Sun, 6 May 2018 13:26:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C198288D1 for ; Sun, 6 May 2018 13:26:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FAF628B4B; Sun, 6 May 2018 13:26:36 +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=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 93B31288D1 for ; Sun, 6 May 2018 13:26:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=QKNU3J5cIV03ygrzhW+u8EyItYuIldXJ0RkIdCCDDVs=; b=WKw eeQ1VDi0sMCTVPXklxYxFAQJ4J+ApctVaRjBIsQi1GKD+rj3LBeSASZcTWNbGZMzVpG0U0gJTMJlf wUww3MKFsAOhCtU6w87XkClhurB9E20rG5sYx02HQ1UMdHoDZOW6AMTvOrfCfEryL4wU6tcOw4R1s sIJsS2ptYqCrLHQuDMT1+nAFw76hzbbw4ZGc2HPUj5U3C8S8AEenjJCNIY00zcKByYDkImn9f7UsW vE/KoEJqZh7sYJhfGTJOO5nVm7WRDKBcEwGbGB0RsL5ELSy7PRIg4YYrE/naGUCy6oxCNoPVyedoH Cf6fIteCb4sXBdXbV90cyWGty5qRQLA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fFJg8-0005wZ-OX; Sun, 06 May 2018 13:26:16 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fFJg5-0005vI-Cn for ath10k@lists.infradead.org; Sun, 06 May 2018 13:26:14 +0000 Received: by mail-lf0-x242.google.com with SMTP id g12-v6so36895910lfb.10 for ; Sun, 06 May 2018 06:26:00 -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=cEObVKEK/fo5t8QjdEU+eUetMkNzdbvNLIe7A0TN1TgaYhbZlC01TpZjbIRiFaid4a 7p8XlyzaPWI3H3i6sl56E1MyytZg08IWU2gltiiCn3q7BT4xnpsigDwPqdeoBqet15HE KWr567luu5erQsKpoTbi2d4E3SOnHugIXHysqmJvBGH9Es5nfXZSx4w8uIARzRP0/B9O oyNipGWNs66TNsvvqNPyuYs7vckenLV/ZbJ5P81ztKPtOL4RiXL1SE+8hbkYEafhHZIk u+efMgWZkXH9/o4S88VebsPTh2R5XsiEyuYUG4r/YBksbZszhphfZXpcrClF9n8hM5Hd 72lA== X-Gm-Message-State: ALQs6tClQpBSRNGvsAwhjLN95KzvihsZBpyfy2g0Iykb5+d34o1Nzid+ rnz/qV3WqX6A/IRbhHkaxBw= 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180506_062613_436301_AAA49D1D X-CRM114-Status: GOOD ( 11.77 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Erik Stromdahl MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.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)