From patchwork Sat Mar 2 13:47:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10836593 X-Patchwork-Delegate: nbd@nbd.name Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3EB9A17E9 for ; Sat, 2 Mar 2019 13:48:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E2912B2C9 for ; Sat, 2 Mar 2019 13:48:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2228A2B33B; Sat, 2 Mar 2019 13:48:08 +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,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 EA3452B2C9 for ; Sat, 2 Mar 2019 13:48:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726975AbfCBNsG (ORCPT ); Sat, 2 Mar 2019 08:48:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:58482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726430AbfCBNsF (ORCPT ); Sat, 2 Mar 2019 08:48:05 -0500 Received: from lore-desk.lan (unknown [151.66.48.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3B9E320838; Sat, 2 Mar 2019 13:48:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1551534484; bh=s82Ajn8sVTPwcw+AdtP7/egcAWFrckE8dKY+4TwS318=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x5pXMt0QWHxWtQoDHTY1Vf6FkwCNfoKNbEMEzaqXO5DKdvUS+C6GoH8/Y/VqD3xz8 Qx1fPP+ZP3Pt//gCQLJExhq+LiNgUdHdJC/D9XIZHCJvvEmjprmnyQMpAyHUdvQu1l 9/OW+zYpyx2geJU0t477EK9ZIjxo7JT2MYVvjm8o= From: Lorenzo Bianconi To: nbd@nbd.name Cc: linux-wireless@vger.kernel.org, sgruszka@redhat.com, lorenzo.bianconi@redhat.com, roychl666@gmail.com, ryder.lee@mediatek.com Subject: [PATCH 5/5] mt76: introduce mt76_txq_id field in mt76_queue_entry Date: Sat, 2 Mar 2019 14:47:42 +0100 Message-Id: <4154a3ec914e43ab3802a083895b1035bc626229.1551533068.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.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 Add mt76_txq_id field to mt76_queue_entry in order to properly track outstanding frames for mt7615 that relies on a single hw queue Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/dma.c | 2 +- drivers/net/wireless/mediatek/mt76/mt76.h | 1 + drivers/net/wireless/mediatek/mt76/tx.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index a37a1af74981..75ea381ff64a 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -164,7 +164,7 @@ mt76_dma_tx_cleanup(struct mt76_dev *dev, enum mt76_txq_id qid, bool flush) while (q->queued && q->tail != last) { mt76_dma_tx_cleanup_idx(dev, q, q->tail, &entry); if (entry.schedule) - dev->q_tx[qid].swq_queued--; + dev->q_tx[entry.qid].swq_queued--; q->tail = (q->tail + 1) % q->ndesc; q->queued--; diff --git a/drivers/net/wireless/mediatek/mt76/mt76.h b/drivers/net/wireless/mediatek/mt76/mt76.h index e3160dc7c515..51245623b427 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76.h +++ b/drivers/net/wireless/mediatek/mt76/mt76.h @@ -100,6 +100,7 @@ struct mt76_queue_entry { struct mt76_txwi_cache *txwi; struct mt76u_buf ubuf; }; + enum mt76_txq_id qid; bool schedule; }; diff --git a/drivers/net/wireless/mediatek/mt76/tx.c b/drivers/net/wireless/mediatek/mt76/tx.c index 240ef2cc5c79..b59cdf88a224 100644 --- a/drivers/net/wireless/mediatek/mt76/tx.c +++ b/drivers/net/wireless/mediatek/mt76/tx.c @@ -465,6 +465,7 @@ mt76_txq_send_burst(struct mt76_dev *dev, struct mt76_sw_queue *sq, } while (n_frames < limit); if (!probe) { + hwq->entry[idx].qid = sq - dev->q_tx; hwq->entry[idx].schedule = true; sq->swq_queued++; }