All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled
@ 2021-12-15 17:11 Larry Finger
  2021-12-20 19:04 ` Kalle Valo
  0 siblings, 1 reply; 2+ messages in thread
From: Larry Finger @ 2021-12-15 17:11 UTC (permalink / raw)
  To: kvalo; +Cc: linux-wireless, Larry Finger, syzbot+cce1ee31614c171f5595, stable

Syzbot reports the following WARNING:

[200~raw_local_irq_restore() called with IRQs enabled
WARNING: CPU: 1 PID: 1206 at kernel/locking/irqflag-debug.c:10
   warn_bogus_irq_restore+0x1d/0x20 kernel/locking/irqflag-debug.c:10

Hardware initialization for the rtl8188cu can run for as long as 350 ms,
and the routine may be called with interrupts disabled. To avoid locking
the machine for this long, the current routine saves the interrupt flags
and enables local interrupts. The problem is that it restores the flags
at the end without disabling local interrupts first.

This patch fixes commit a53268be0cb9 ("rtlwifi: rtl8192cu: Fix too long
disable of IRQs").

Reported-by: syzbot+cce1ee31614c171f5595@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Fixes: a53268be0cb9 ("rtlwifi: rtl8192cu: Fix too long disable of IRQs")
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
index 6312fddd9c00..eaba66113328 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
@@ -1000,6 +1000,7 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw)
 	_initpabias(hw);
 	rtl92c_dm_init(hw);
 exit:
+	local_irq_disable();
 	local_irq_restore(flags);
 	return err;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled
  2021-12-15 17:11 [PATCH] rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled Larry Finger
@ 2021-12-20 19:04 ` Kalle Valo
  0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2021-12-20 19:04 UTC (permalink / raw)
  To: Larry Finger
  Cc: linux-wireless, Larry Finger, syzbot+cce1ee31614c171f5595, stable

Larry Finger <Larry.Finger@lwfinger.net> wrote:

> Syzbot reports the following WARNING:
> 
> [200~raw_local_irq_restore() called with IRQs enabled
> WARNING: CPU: 1 PID: 1206 at kernel/locking/irqflag-debug.c:10
>    warn_bogus_irq_restore+0x1d/0x20 kernel/locking/irqflag-debug.c:10
> 
> Hardware initialization for the rtl8188cu can run for as long as 350 ms,
> and the routine may be called with interrupts disabled. To avoid locking
> the machine for this long, the current routine saves the interrupt flags
> and enables local interrupts. The problem is that it restores the flags
> at the end without disabling local interrupts first.
> 
> This patch fixes commit a53268be0cb9 ("rtlwifi: rtl8192cu: Fix too long
> disable of IRQs").
> 
> Reported-by: syzbot+cce1ee31614c171f5595@syzkaller.appspotmail.com
> Cc: stable@vger.kernel.org
> Fixes: a53268be0cb9 ("rtlwifi: rtl8192cu: Fix too long disable of IRQs")
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>

Patch applied to wireless-drivers-next.git, thanks.

8b144dedb928 rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20211215171105.20623-1-Larry.Finger@lwfinger.net/

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-20 19:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15 17:11 [PATCH] rtlwifi: rtl8192cu: Fix WARNING when calling local_irq_restore() with interrupts enabled Larry Finger
2021-12-20 19:04 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.