diff mbox series

[1/2] wifi: rtw89: pci: fix interrupt stuck after leaving low power mode

Message ID 20220824063312.15784-1-pkshih@realtek.com
State New
Headers show
Series [1/2] wifi: rtw89: pci: fix interrupt stuck after leaving low power mode | expand

Commit Message

Ping-Ke Shih Aug. 24, 2022, 6:33 a.m. UTC
We turn off interrupt in ISR, and re-enable interrupt in threadfn or
napi_poll according to the mode it stays. If we are turning off interrupt,
rtwpci->running flag is unset and interrupt handler stop processing even
if it was called, so disallow to re-enable interrupt in this situation.
Or, wifi chip doesn't trigger interrupt events anymore because interrupt
status (ISR) isn't clear by interrupt handler anymore.

Fixes: c83dcd0508e2 ("rtw89: pci: add a separate interrupt handler for low power mode")
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
---
Hi Kalle,

This patchset contains two patches with fixes tag, but we don't turn on
lower power mode yet, so this patchset should go to wireless-next tree.

Thank you.

---
 drivers/net/wireless/realtek/rtw89/pci.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Kalle Valo Aug. 29, 2022, 4:07 p.m. UTC | #1
Ping-Ke Shih <pkshih@realtek.com> writes:

> We turn off interrupt in ISR, and re-enable interrupt in threadfn or
> napi_poll according to the mode it stays. If we are turning off interrupt,
> rtwpci->running flag is unset and interrupt handler stop processing even
> if it was called, so disallow to re-enable interrupt in this situation.
> Or, wifi chip doesn't trigger interrupt events anymore because interrupt
> status (ISR) isn't clear by interrupt handler anymore.
>
> Fixes: c83dcd0508e2 ("rtw89: pci: add a separate interrupt handler for low power mode")
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
> ---
> Hi Kalle,
>
> This patchset contains two patches with fixes tag, but we don't turn on
> lower power mode yet, so this patchset should go to wireless-next tree.

Very good, thanks for letting me know. This kind of info always helps.
Kalle Valo Sept. 2, 2022, 8:37 a.m. UTC | #2
Ping-Ke Shih <pkshih@realtek.com> wrote:

> We turn off interrupt in ISR, and re-enable interrupt in threadfn or
> napi_poll according to the mode it stays. If we are turning off interrupt,
> rtwpci->running flag is unset and interrupt handler stop processing even
> if it was called, so disallow to re-enable interrupt in this situation.
> Or, wifi chip doesn't trigger interrupt events anymore because interrupt
> status (ISR) isn't clear by interrupt handler anymore.
> 
> Fixes: c83dcd0508e2 ("rtw89: pci: add a separate interrupt handler for low power mode")
> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>

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

b7e715d3dcd2 wifi: rtw89: pci: fix interrupt stuck after leaving low power mode
4a29213cd775 wifi: rtw89: pci: correct TX resource checking in low power mode
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c
index c68fec9eb5a64..8a093e1cb328e 100644
--- a/drivers/net/wireless/realtek/rtw89/pci.c
+++ b/drivers/net/wireless/realtek/rtw89/pci.c
@@ -760,7 +760,8 @@  static irqreturn_t rtw89_pci_interrupt_threadfn(int irq, void *dev)
 
 enable_intr:
 	spin_lock_irqsave(&rtwpci->irq_lock, flags);
-	rtw89_chip_enable_intr(rtwdev, rtwpci);
+	if (likely(rtwpci->running))
+		rtw89_chip_enable_intr(rtwdev, rtwpci);
 	spin_unlock_irqrestore(&rtwpci->irq_lock, flags);
 	return IRQ_HANDLED;
 }