Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4373866pxb; Tue, 10 Nov 2020 15:04:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyXbyPqE4ZjwhPcne6QqjkzvGrejULyKZAWPMxtEk6rh0JFRiFciRv6CtrqkFSzuAYS5hWh X-Received: by 2002:a17:906:a28f:: with SMTP id i15mr23741009ejz.468.1605049462957; Tue, 10 Nov 2020 15:04:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605049462; cv=none; d=google.com; s=arc-20160816; b=xqEvgu6xmsMSByd5Wz7wQyKCYpVFf5n+/8z8fvcXMUYXc+qqEMdKS3elWVxFESNTv7 0LxFA/CkjFnwgttf1MO+E6c0Xide+IylAI5i+6ootENkF3ZzsXsiGgMbeAfjAGnLW2WA 3RwhEiBxLJee0LmLKeFNT/7kuLDnfay798Lqz++mcn/IljBwlxIG9CascBK/3kRAO8Ax cz0H1tGdW3tF3haN4yV8cEpUdlVJl+1+CDsRaklARIYDJ6+ahgWKz+dv9A8tDwInHx12 QFPWngCwmO8Vc+KGUYkuN7uc3UQhPYj3dqXXq0GKjUkA3Gfh1eiXzb+e4EkG/a6NVbME 6Hzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eJSQIT/Ggn5XLfy13/s1uOGwX65Elq5RkLzwebaJgLM=; b=pmV47ty0ihs6tbX0zc4DVG+YgnbLPQITYcMF+JIQ9xgfUkfsKot9VmbDBcIq6jerQD Q61avLfbuQz0pwjo2GLMXKvvInpBZ04TJKzqqSGa6s3MsKus4NwhF6/vBsrL0gQHQDvp 2d6zYWWeHkvQF0hg/OEDAfq4NHaY115Z7RWL0nrcQ31rOzhJDrF4WJuQN9jXc1bi2rTl UQURx4hbXRcrVF+h5pxrO+k/9WpUpmDOdvZSRr17K0VgubVCAxizGdsbnsXRghy9jVaN 8yYoHOQ4fCgFKAKS2wVZpPHCSc8DXKx7PVFjiaZ1zc1RHenN9NVzgHGZzjzUZj39AjR4 5grg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FlkNJ+Tl; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h15si16334ejq.475.2020.11.10.15.03.38; Tue, 10 Nov 2020 15:04:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FlkNJ+Tl; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732158AbgKJXDT (ORCPT + 99 others); Tue, 10 Nov 2020 18:03:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:56418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730254AbgKJXDT (ORCPT ); Tue, 10 Nov 2020 18:03:19 -0500 Received: from lore-desk.redhat.com (unknown [151.66.8.153]) (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 77F6620679; Tue, 10 Nov 2020 23:03:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605049398; bh=76pQH5dblxCsO3pFkGkXB9/oOO2m06B9Elm5ty6+btE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FlkNJ+TlSm4ULR/JCi00YWy0CZ/mhtxMy6lGmWj2t6scrF9HVfNe41u2BfT8AvzGx YKA4AFAW8w3Kyom9MQUDe6BSeAFQYSPNWuScAd+nvg55LkJkiksDB/WD7z+8ZjSRoE ljnV0Ktok+JXqixWzhBSP34U+bydWA31VXlHztrk= From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, ryder.lee@mediatek.com, sean.wang@mediatek.com Subject: [PATCH 03/10] mt76: sdio: rely on mt76_queue in mt76s_process_tx_queue signature Date: Wed, 11 Nov 2020 00:02:53 +0100 Message-Id: <05e16fb5e8dbdd71182f29c5043a7488eb59cba4.1605048763.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This is a preliminary patch to move data queues in mt76_phy and properly support dbdc for mt7915 Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/sdio.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/sdio.c b/drivers/net/wireless/mediatek/mt76/sdio.c index 4c6a65cec318..ddd454d628aa 100644 --- a/drivers/net/wireless/mediatek/mt76/sdio.c +++ b/drivers/net/wireless/mediatek/mt76/sdio.c @@ -155,12 +155,11 @@ static void mt76s_net_worker(struct mt76_worker *w) } while (nframes > 0); } -static int mt76s_process_tx_queue(struct mt76_dev *dev, enum mt76_txq_id qid) +static int mt76s_process_tx_queue(struct mt76_dev *dev, struct mt76_queue *q) { - struct mt76_queue *q = dev->q_tx[qid]; + bool wake, mcu = q == dev->q_tx[MT_TXQ_MCU]; struct mt76_queue_entry entry; int nframes = 0; - bool wake; while (q->queued > 0) { if (!q->entry[q->tail].done) @@ -169,7 +168,7 @@ static int mt76s_process_tx_queue(struct mt76_dev *dev, enum mt76_txq_id qid) entry = q->entry[q->tail]; q->entry[q->tail].done = false; - if (qid == MT_TXQ_MCU) { + if (mcu) { dev_kfree_skb(entry.skb); entry.skb = NULL; } @@ -185,13 +184,13 @@ static int mt76s_process_tx_queue(struct mt76_dev *dev, enum mt76_txq_id qid) if (!q->queued) wake_up(&dev->tx_wait); - if (qid == MT_TXQ_MCU) + if (mcu) goto out; - mt76_txq_schedule(&dev->phy, qid); + mt76_txq_schedule(&dev->phy, q->qid); if (wake) - ieee80211_wake_queue(dev->hw, qid); + ieee80211_wake_queue(dev->hw, q->qid); out: return nframes; } @@ -206,7 +205,7 @@ static void mt76s_status_worker(struct mt76_worker *w) do { nframes = 0; for (i = 0; i < MT_TXQ_MCU_WA; i++) - nframes += mt76s_process_tx_queue(dev, i); + nframes += mt76s_process_tx_queue(dev, dev->q_tx[i]); if (dev->drv->tx_status_data && !test_and_set_bit(MT76_READING_STATS, &dev->phy.state)) -- 2.26.2