Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [RFC 1/2] wifi: mt76: disable NAPI before deleting in dma_cleanup
       [not found] <20260916204750.1439984-1-greearb@candelatech.com>
@ 2026-09-20  3:49 ` Devin Wittmayer
  2026-09-20 14:49   ` Ben Greear
  0 siblings, 1 reply; 2+ messages in thread
From: Devin Wittmayer @ 2026-09-20  3:49 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless, linux-mediatek, nbd, lorenzo, Shiji Yang

On 9/16/26 13:47, Ben Greear wrote:
> +		napi_disable(&dev->napi[i]);
>  		netif_napi_del(&dev->napi[i]);

Ben,

The warning and the softirqd spin are both real, and your 2/2 looks like
the right place for them.

On 1/2 there is a snag. mt7921e and mt7925e already stop RX themselves,
and they do it early:

	mt76_unregister_device()
	napi_disable() on each rx queue
	tx_token_put()
	mt792x_dma_cleanup()

It has to be early. A poll still in flight can come back with a transmit
status and take an entry out of the table tx_token_put() is tearing
down. By the time the shared cleanup runs RX is already stopped, so a
second disable there just sits:

	task in D state, refcount -1
	napi_disable_locked <- mt76_dma_cleanup <- mt7925_pci_remove

That was on MT7927. The USB parts tear down a different way and never
arrive, which is probably why this is easy to miss.

Would putting the disable next to the IRQ and tasklet work in your 2/2
cover mt7996? That keeps it where the driver already knows whether it
has stopped RX.

Devin


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

* Re: [RFC 1/2] wifi: mt76: disable NAPI before deleting in dma_cleanup
  2026-09-20  3:49 ` [RFC 1/2] wifi: mt76: disable NAPI before deleting in dma_cleanup Devin Wittmayer
@ 2026-09-20 14:49   ` Ben Greear
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Greear @ 2026-09-20 14:49 UTC (permalink / raw)
  To: Devin Wittmayer; +Cc: linux-wireless, linux-mediatek, nbd, lorenzo, Shiji Yang

On 9/19/26 20:49, Devin Wittmayer wrote:
> On 9/16/26 13:47, Ben Greear wrote:
>> +		napi_disable(&dev->napi[i]);
>>   		netif_napi_del(&dev->napi[i]);
> 
> Ben,
> 
> The warning and the softirqd spin are both real, and your 2/2 looks like
> the right place for them.
> 
> On 1/2 there is a snag. mt7921e and mt7925e already stop RX themselves,
> and they do it early:
> 
> 	mt76_unregister_device()
> 	napi_disable() on each rx queue
> 	tx_token_put()
> 	mt792x_dma_cleanup()
> 
> It has to be early. A poll still in flight can come back with a transmit
> status and take an entry out of the table tx_token_put() is tearing
> down. By the time the shared cleanup runs RX is already stopped, so a
> second disable there just sits:
> 
> 	task in D state, refcount -1
> 	napi_disable_locked <- mt76_dma_cleanup <- mt7925_pci_remove
> 
> That was on MT7927. The USB parts tear down a different way and never
> arrive, which is probably why this is easy to miss.
> 
> Would putting the disable next to the IRQ and tasklet work in your 2/2
> cover mt7996? That keeps it where the driver already knows whether it
> has stopped RX.

I have a hard time figuring out exactly how to safely tear down
the mt7996 driver, especially without breaking other mt76 drivers.

But instead of just playing whack-a-mole with this,
we should figure out if sub-driver or mt76 core should be handling this,
and add some comments of expected behaviour so we don't keep fixing one chipset
and breaking another.

Maybe Felix has an opinion on correct path forward?

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



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

end of thread, other threads:[~2026-09-20 14:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260916204750.1439984-1-greearb@candelatech.com>
2026-09-20  3:49 ` [RFC 1/2] wifi: mt76: disable NAPI before deleting in dma_cleanup Devin Wittmayer
2026-09-20 14:49   ` Ben Greear

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox