Skip to contentSkip to conversation

remove wake queue tx logic for usb/sdio

PATCH In review Lorenzo Bianconi 3 participants 8 messages Dec 5, 2020 – Dec 20, 2020

Subsystems (2)
lore
Share & tools
lore
author maintainer
#5 lore raw

PATCH 2/2 mt76: sdio: remove wake logic in mt76s_process_tx_queue

In reply to Lorenzo Bianconi

Similar to mmio/usb code path, remove wake logic in mt76s_process_tx_queue routine

---
 drivers/net/wireless/mediatek/mt76/sdio.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/net/wireless/mediatek/mt76/sdio.c +3 -12
index 62b5b912818f..7cd995118257 100644
@@ -157,7 +157,7 @@ static void mt76s_net_worker(struct mt76_worker *w)
 
 static int mt76s_process_tx_queue(struct mt76_dev *dev, struct mt76_queue *q)
 {
-	bool wake, mcu = q == dev->q_mcu[MT_MCUQ_WM];
+	bool mcu = q == dev->q_mcu[MT_MCUQ_WM];
 	struct mt76_queue_entry entry;
 	int nframes = 0;
 
@@ -177,21 +177,12 @@ static int mt76s_process_tx_queue(struct mt76_dev *dev, struct mt76_queue *q)
 		nframes++;
 	}
 
-	wake = q->stopped && q->queued < q->ndesc - 8;
-	if (wake)
-		q->stopped = false;
-
 	if (!q->queued)
 		wake_up(&dev->tx_wait);
 
-	if (mcu)
-		goto out;
-
-	mt76_txq_schedule(&dev->phy, q->qid);
+	if (!mcu)
+		mt76_txq_schedule(&dev->phy, q->qid);
 
-	if (wake)
-		ieee80211_wake_queue(dev->hw, q->qid);
-out:
 	return nframes;
 }
 
Signature · 1 line
2.28.0
author maintainer
#1 lore raw

PATCH 1/2 mt76: usb: remove wake logic in mt76u_status_worker

In reply to Lorenzo Bianconi

Similar to mmio code path, remove wake logic in mt76u_status_worker handler

---
 drivers/net/wireless/mediatek/mt76/usb.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/net/wireless/mediatek/mt76/usb.c +0 -7
index 81393788f98e..658b36a2281d 100644
@@ -811,7 +811,6 @@ static void mt76u_status_worker(struct mt76_worker *w)
 	struct mt76_dev *dev = container_of(usb, struct mt76_dev, usb);
 	struct mt76_queue_entry entry;
 	struct mt76_queue *q;
-	bool wake;
 	int i;
 
 	for (i = 0; i < IEEE80211_NUM_ACS; i++) {
@@ -827,10 +826,6 @@ static void mt76u_status_worker(struct mt76_worker *w)
 			mt76_queue_tx_complete(dev, q, &entry);
 		}
 
-		wake = q->stopped && q->queued < q->ndesc - 8;
-		if (wake)
-			q->stopped = false;
-
 		if (!q->queued)
 			wake_up(&dev->tx_wait);
 
@@ -839,8 +834,6 @@ static void mt76u_status_worker(struct mt76_worker *w)
 		if (dev->drv->tx_status_data &&
 		    !test_and_set_bit(MT76_READING_STATS, &dev->phy.state))
 			queue_work(dev->wq, &dev->usb.stat_work);
-		if (wake)
-			ieee80211_wake_queue(dev->hw, i);
 	}
 }
 
Signature · 1 line
2.28.0

Lorenzo Bianconi

author maintainer
#0 lore raw

cover remove wake queue tx logic for usb/sdio

Similar to mmio, remove queue wake logic for sdio and usb code path

Lorenzo Bianconi (2):
mt76: usb: remove wake logic in mt76u_status_worker
mt76: sdio: remove wake logic in mt76s_process_tx_queue

 drivers/net/wireless/mediatek/mt76/sdio.c | 15 +++------------
 drivers/net/wireless/mediatek/mt76/usb.c  |  7 -------
 2 files changed, 3 insertions(+), 19 deletions(-)
Signature · 1 line
2.28.0
#7 lore raw
Quoted 10 lines

Similar to mmio, remove queue wake logic for sdio and usb code path

Lorenzo Bianconi (2):
mt76: usb: remove wake logic in mt76u_status_worker
mt76: sdio: remove wake logic in mt76s_process_tx_queue

 drivers/net/wireless/mediatek/mt76/sdio.c | 15 +++------------
 drivers/net/wireless/mediatek/mt76/usb.c  |  7 -------
 2 files changed, 3 insertions(+), 19 deletions(-)

Hi Felix,

do you think we can take this series in wireless-driver or do you prefer it goes through your tree?

Regards,
Lorenzo

Quoted 3 lines
Signature · 1 line
2.28.0
#6 lore raw

Re: [PATCH 2/2] mt76: sdio: remove wake logic in mt76s_process_tx_queue

In reply to Lorenzo Bianconi
Quoted 2 lines

Similar to mmio/usb code path, remove wake logic in mt76s_process_tx_queue routine

Starting from commit '90d494c99a99fa2eb858754345c4a9c851b409a0 ("mt76: improve tx queue stop/wake")', the wake queue logic on the sdio status path is no longer necessary since the hw queues are no longer stopped on the mt76 tx path.

Regards,
Lorenzo

Quoted 46 lines
---
 drivers/net/wireless/mediatek/mt76/sdio.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)
drivers/net/wireless/mediatek/mt76/sdio.c +3 -12
index 62b5b912818f..7cd995118257 100644
@@ -157,7 +157,7 @@ static void mt76s_net_worker(struct mt76_worker *w)
 
 static int mt76s_process_tx_queue(struct mt76_dev *dev, struct mt76_queue *q)
 {
-	bool wake, mcu = q == dev->q_mcu[MT_MCUQ_WM];
+	bool mcu = q == dev->q_mcu[MT_MCUQ_WM];
 	struct mt76_queue_entry entry;
 	int nframes = 0;
 
@@ -177,21 +177,12 @@ static int mt76s_process_tx_queue(struct mt76_dev *dev, struct mt76_queue *q)
 		nframes++;
 	}
 
-	wake = q->stopped && q->queued < q->ndesc - 8;
-	if (wake)
-		q->stopped = false;
-
 	if (!q->queued)
 		wake_up(&dev->tx_wait);
 
-	if (mcu)
-		goto out;
-
-	mt76_txq_schedule(&dev->phy, q->qid);
+	if (!mcu)
+		mt76_txq_schedule(&dev->phy, q->qid);
 
-	if (wake)
-		ieee80211_wake_queue(dev->hw, q->qid);
-out:
 	return nframes;
 }
 
Signature · 1 line
2.28.0
#2 lore raw

Re: [PATCH 1/2] mt76: usb: remove wake logic in mt76u_status_worker

In reply to Lorenzo Bianconi
Quoted 2 lines

Similar to mmio code path, remove wake logic in mt76u_status_worker handler

Starting from commit '90d494c99a99fa2eb858754345c4a9c851b409a0 ("mt76: improve tx queue stop/wake")', the wake queue logic on the usb status path is no longer necessary since the hw queues are no longer stopped on the mt76 tx path.

Regards,
Lorenzo

Quoted 41 lines
---
 drivers/net/wireless/mediatek/mt76/usb.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/net/wireless/mediatek/mt76/usb.c +0 -7
index 81393788f98e..658b36a2281d 100644
@@ -811,7 +811,6 @@ static void mt76u_status_worker(struct mt76_worker *w)
 	struct mt76_dev *dev = container_of(usb, struct mt76_dev, usb);
 	struct mt76_queue_entry entry;
 	struct mt76_queue *q;
-	bool wake;
 	int i;
 
 	for (i = 0; i < IEEE80211_NUM_ACS; i++) {
@@ -827,10 +826,6 @@ static void mt76u_status_worker(struct mt76_worker *w)
 			mt76_queue_tx_complete(dev, q, &entry);
 		}
 
-		wake = q->stopped && q->queued < q->ndesc - 8;
-		if (wake)
-			q->stopped = false;
-
 		if (!q->queued)
 			wake_up(&dev->tx_wait);
 
@@ -839,8 +834,6 @@ static void mt76u_status_worker(struct mt76_worker *w)
 		if (dev->drv->tx_status_data &&
 		    !test_and_set_bit(MT76_READING_STATS, &dev->phy.state))
 			queue_work(dev->wq, &dev->usb.stat_work);
-		if (wake)
-			ieee80211_wake_queue(dev->hw, i);
 	}
 }
 
Signature · 1 line
2.28.0
#3 lore raw

Re: [PATCH 1/2] mt76: usb: remove wake logic in mt76u_status_worker

Quoted 7 lines · Lorenzo Bianconi
Quoted 2 lines

Similar to mmio code path, remove wake logic in mt76u_status_worker handler

Starting from commit '90d494c99a99fa2eb858754345c4a9c851b409a0 ("mt76: improve tx queue stop/wake")', the wake queue logic on the usb status path is no longer necessary since the hw queues are no longer stopped on the mt76 tx path.

Thanks, I'll update the commit logs based on the info you provided.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#4 lore raw

Re: [1/2] mt76: usb: remove wake logic in mt76u_status_worker

In reply to Lorenzo Bianconi
Quoted 6 lines · Lorenzo Bianconi

Similar to mmio code path, remove wake logic in mt76u_status_worker handler. Starting from commit 90d494c99a99 ("mt76: improve tx queue stop/wake")', the wake queue logic on the usb status path is no longer necessary since the hw queues are no longer stopped on the mt76 tx path.

2 patches applied to wireless-drivers.git, thanks.

e16ab3db87b3 mt76: usb: remove wake logic in mt76u_status_worker 123bb2b73788 mt76: sdio: remove wake logic in mt76s_process_tx_queue

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/00009bf0cfdc9565e4432cad3ed51888c667c25d.1607164041.git.lorenzo@kernel.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches