All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.19] wifi: mt76: mt7921e: fix crash in chip reset fail
@ 2022-09-15  5:32 sean.wang
  2022-09-16  9:32 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: sean.wang @ 2022-09-15  5:32 UTC (permalink / raw)
  To: stable
  Cc: linux-wireless, linux-mediatek, linux-kernel, Deren Wu, Johannes Berg

From: Deren Wu <deren.wu@mediatek.com>

commit fa3fbe64037839f448dc569212bafc5a495d8219 upstream.

In case of drv own fail in reset, we may need to run mac_reset several
times. The sequence would trigger system crash as the log below.

Because we do not re-enable/schedule "tx_napi" before disable it again,
the process would keep waiting for state change in napi_diable(). To
avoid the problem and keep status synchronize for each run, goto final
resource handling if drv own failed.

[ 5857.353423] mt7921e 0000:3b:00.0: driver own failed
[ 5858.433427] mt7921e 0000:3b:00.0: Timeout for driver own
[ 5859.633430] mt7921e 0000:3b:00.0: driver own failed
[ 5859.633444] ------------[ cut here ]------------
[ 5859.633446] WARNING: CPU: 6 at kernel/kthread.c:659 kthread_park+0x11d
[ 5859.633717] Workqueue: mt76 mt7921_mac_reset_work [mt7921_common]
[ 5859.633728] RIP: 0010:kthread_park+0x11d/0x150
[ 5859.633736] RSP: 0018:ffff8881b676fc68 EFLAGS: 00010202
......
[ 5859.633766] Call Trace:
[ 5859.633768]  <TASK>
[ 5859.633771]  mt7921e_mac_reset+0x176/0x6f0 [mt7921e]
[ 5859.633778]  mt7921_mac_reset_work+0x184/0x3a0 [mt7921_common]
[ 5859.633785]  ? mt7921_mac_set_timing+0x520/0x520 [mt7921_common]
[ 5859.633794]  ? __kasan_check_read+0x11/0x20
[ 5859.633802]  process_one_work+0x7ee/0x1320
[ 5859.633810]  worker_thread+0x53c/0x1240
[ 5859.633818]  kthread+0x2b8/0x370
[ 5859.633824]  ? process_one_work+0x1320/0x1320
[ 5859.633828]  ? kthread_complete_and_exit+0x30/0x30
[ 5859.633834]  ret_from_fork+0x1f/0x30
[ 5859.633842]  </TASK>

Cc: stable@vger.kernel.org
Fixes: 0efaf31dec57 ("mt76: mt7921: fix MT7921E reset failure")
Signed-off-by: Deren Wu <deren.wu@mediatek.com>
Link: https://lore.kernel.org/r/727eb5ffd3c7c805245e512da150ecf0a7154020.1659452909.git.deren.wu@mediatek.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c
index b0f58bcf70cb..106c88b723b9 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/pci_mac.c
@@ -345,7 +345,7 @@ int mt7921e_mac_reset(struct mt7921_dev *dev)
 
 	err = mt7921e_driver_own(dev);
 	if (err)
-		return err;
+		goto out;
 
 	err = mt7921_run_firmware(dev);
 	if (err)
-- 
2.25.1


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

* Re: [PATCH 5.19] wifi: mt76: mt7921e: fix crash in chip reset fail
  2022-09-15  5:32 [PATCH 5.19] wifi: mt76: mt7921e: fix crash in chip reset fail sean.wang
@ 2022-09-16  9:32 ` Greg KH
  2022-09-16 22:55   ` Sean Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2022-09-16  9:32 UTC (permalink / raw)
  To: sean.wang
  Cc: stable, linux-wireless, linux-mediatek, linux-kernel, Deren Wu,
	Johannes Berg

On Thu, Sep 15, 2022 at 01:32:35PM +0800, sean.wang@mediatek.com wrote:
> From: Deren Wu <deren.wu@mediatek.com>
> 
> commit fa3fbe64037839f448dc569212bafc5a495d8219 upstream.

This is already in the 5.19.9 kernel release, right?  Do we need it
again?

thanks,

greg k-h

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

* Re: [PATCH 5.19] wifi: mt76: mt7921e: fix crash in chip reset fail
  2022-09-16  9:32 ` Greg KH
@ 2022-09-16 22:55   ` Sean Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Sean Wang @ 2022-09-16 22:55 UTC (permalink / raw)
  To: Greg KH
  Cc: sean.wang, stable, linux-wireless, linux-mediatek, linux-kernel,
	Deren Wu, Johannes Berg

Hi, Greg

On Fri, Sep 16, 2022 at 2:39 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Thu, Sep 15, 2022 at 01:32:35PM +0800, sean.wang@mediatek.com wrote:
> > From: Deren Wu <deren.wu@mediatek.com>
> >
> > commit fa3fbe64037839f448dc569212bafc5a495d8219 upstream.
>
> This is already in the 5.19.9 kernel release, right?  Do we need it
> again?

Ah, If so, we don't need it again. It seemed unavailable when I
submitted the patch. Sorry for bothering you.

    Sean

>
> thanks,
>
> greg k-h

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

end of thread, other threads:[~2022-09-16 22:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-15  5:32 [PATCH 5.19] wifi: mt76: mt7921e: fix crash in chip reset fail sean.wang
2022-09-16  9:32 ` Greg KH
2022-09-16 22:55   ` Sean Wang

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.