mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Abdurrahman Karadag <abdurrahmankaradag19@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: pkshih@realtek.com, linux-kernel@vger.kernel.org,
	rtl8821cerfe2@gmail.com
Subject: [PATCH rtw-next v4] wifi: rtw88: pci: wake the TX queues after restart_hw and interface up
Date: Wed, 21 Oct 2026 13:13:15 +0300	[thread overview]
Message-ID: <20261021101315.1974894-1-abdurrahmankaradag19@gmail.com> (raw)

When a TX ring fills, rtw_pci_tx_write() stops the mac80211 queue and
records it in ring->queue_stopped. The completion loop in
rtw_pci_tx_isr() is what clears them, and it needs a descriptor to
complete. If the device goes down first, rtw_pci_dma_release() rewinds
the indices and frees what was in flight, so nothing is left that
could. ieee80211_reconfig() does not help either: it wakes only
IEEE80211_QUEUE_STOP_REASON_SUSPEND, and an interface down/up does not
reach it at all. TX then stays dead although the device came back.

Reset that state where the device starts, which both
ieee80211_restart_hw() and an interface down/up reach through
rtw_core_start(). Wake only when a ring was recorded as stopped:
mac80211 keeps a single non-refcounted DRIVER stop per queue, so an
unconditional wake here would also release the stop that
rtw_hw_scan_start() takes before it reaches rtw_pci_start() from idle.

Signed-off-by: Abdurrahman Karadag <abdurrahmankaradag19@gmail.com>
---
v4:
 - reset the flags and wake from rtw_pci_start() instead of
   rtw_reconfig_complete(), so an interface down/up is covered as well
   (Ping-Ke Shih)
 - name restart_hw in the subject (Ping-Ke Shih)

v3: wake from rtw_reconfig_complete() on RECONFIG_TYPE_RESTART
v2: wake from rtw_pci_reset_trx_ring(), gated on ring->queue_stopped
v1: https://lore.kernel.org/linux-wireless/20261002231013.11792-1-abdurrahmankaradag19@gmail.com/

 drivers/net/wireless/realtek/rtw88/pci.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c
index 66d2e5f..fd84ace 100644
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
@@ -571,12 +571,20 @@ static void rtw_pci_napi_stop(struct rtw_dev *rtwdev)
 static int rtw_pci_start(struct rtw_dev *rtwdev)
 {
 	struct rtw_pci *rtwpci = (struct rtw_pci *)rtwdev->priv;
+	enum rtw_tx_queue_type queue;
+	bool wake = false;
 
 	rtw_pci_napi_start(rtwdev);
 
 	spin_lock_bh(&rtwpci->irq_lock);
 	rtwpci->running = true;
 	rtw_pci_enable_interrupt(rtwdev, rtwpci, false);
+	for (queue = 0; queue < RTK_MAX_TX_QUEUE_NUM; queue++) {
+		wake |= rtwpci->tx_rings[queue].queue_stopped;
+		rtwpci->tx_rings[queue].queue_stopped = false;
+	}
+	if (wake)
+		ieee80211_wake_queues(rtwdev->hw);
 	spin_unlock_bh(&rtwpci->irq_lock);
 
 	return 0;
base-commit: 9b0be45d4d52fd223994e151f169743a97abd290
-- 
2.56.0


             reply	other threads:[~2026-10-21 10:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 10:13 Abdurrahman Karadag [this message]
2026-10-21 13:15 ` Luka Gejak
2026-10-21 15:03   ` Abdurrahman Karadag
2026-10-22  1:36 ` Ping-Ke Shih
2026-10-23 11:02   ` Abdurrahman Karadag

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261021101315.1974894-1-abdurrahmankaradag19@gmail.com \
    --to=abdurrahmankaradag19@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=rtl8821cerfe2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®