[PATCH v2 00/18] wifi: drop redundant USB device references

Johan Hovold posted 18 patches 1 month ago
drivers/net/wireless/ath/ath10k/usb.c            |  8 ++------
drivers/net/wireless/ath/ath6kl/usb.c            | 16 ++++------------
drivers/net/wireless/ath/ath9k/hif_usb.c         |  4 ----
drivers/net/wireless/atmel/at76c50x-usb.c        | 12 ++++--------
drivers/net/wireless/marvell/libertas/if_usb.c   |  3 ---
.../net/wireless/marvell/libertas_tf/if_usb.c    |  2 --
drivers/net/wireless/marvell/mwifiex/usb.c       |  4 ----
drivers/net/wireless/mediatek/mt76/mt7615/usb.c  |  3 ---
drivers/net/wireless/mediatek/mt76/mt76x0/usb.c  |  3 ---
drivers/net/wireless/mediatek/mt76/mt76x2/usb.c  |  4 ----
drivers/net/wireless/mediatek/mt76/mt7921/usb.c  |  2 --
drivers/net/wireless/mediatek/mt76/mt7925/usb.c  |  2 --
drivers/net/wireless/mediatek/mt76/mt792x_usb.c  |  1 -
drivers/net/wireless/mediatek/mt7601u/usb.c      |  3 ---
drivers/net/wireless/ralink/rt2x00/rt2x00usb.c   | 12 +-----------
.../net/wireless/realtek/rtl818x/rtl8187/dev.c   |  4 ----
drivers/net/wireless/realtek/rtl8xxxu/core.c     | 11 +++--------
drivers/net/wireless/realtek/rtw88/usb.c         |  3 +--
18 files changed, 15 insertions(+), 82 deletions(-)
[PATCH v2 00/18] wifi: drop redundant USB device references
Posted by Johan Hovold 1 month ago
Driver core holds a reference to the USB interface and its parent USB
device while the interface is bound to a driver and there is no need to
take additional references unless the structures are needed after
disconnect.

Drop redundant device references to reduce cargo culting, make it easier
to spot drivers where an extra reference is needed, and reduce the risk
of memory leaks when drivers fail to release them.

Note that I sent an ath9k patch separately here:

	https://lore.kernel.org/all/20260305105803.17011-1-johan@kernel.org/

but I included it here in v2 for completeness.

Also note that Greg had already sent a fix for rtw88 which has been
picked up by Ping-Ke, but who asked me to send a replacement. If an
incremental patch is preferred I can instead send a follow up for that
one later.

Johan


Changes in v2:
 - include ath9k, previously submitted separately
 - include ath6kl and ath10k
 - rename the ath6kl and ath10k disconnect callbacks
 - fix a reference leak in rtw88 previously reported (and fixed
   differently) by Greg


Johan Hovold (18):
  wifi: ath6kl: drop redundant device reference
  wifi: ath6kl: rename disconnect callback
  wifi: ath9k: drop redundant device reference
  wifi: ath10k: drop redundant device reference
  wifi: ath10k: rename disconnect callback
  wifi: at76c50x: drop redundant device reference
  wifi: libertas: drop redundant device reference
  wifi: libertas_tf: drop redundant device reference
  wifi: mwifiex: drop redundant device reference
  wifi: mt76: drop redundant device reference
  wifi: mt76x0u: drop redundant device reference
  wifi: mt76x2u: drop redundant device reference
  wifi: mt76: mt792xu: drop redundant device reference
  wifi: mt7601u: drop redundant device reference
  wifi: rt2x00: drop redundant device reference
  wifi: rtl818x: drop redundant device reference
  wifi: rtl8xxxu: drop redundant device reference
  wifi: rtw88: fix device leak on probe failure

 drivers/net/wireless/ath/ath10k/usb.c            |  8 ++------
 drivers/net/wireless/ath/ath6kl/usb.c            | 16 ++++------------
 drivers/net/wireless/ath/ath9k/hif_usb.c         |  4 ----
 drivers/net/wireless/atmel/at76c50x-usb.c        | 12 ++++--------
 drivers/net/wireless/marvell/libertas/if_usb.c   |  3 ---
 .../net/wireless/marvell/libertas_tf/if_usb.c    |  2 --
 drivers/net/wireless/marvell/mwifiex/usb.c       |  4 ----
 drivers/net/wireless/mediatek/mt76/mt7615/usb.c  |  3 ---
 drivers/net/wireless/mediatek/mt76/mt76x0/usb.c  |  3 ---
 drivers/net/wireless/mediatek/mt76/mt76x2/usb.c  |  4 ----
 drivers/net/wireless/mediatek/mt76/mt7921/usb.c  |  2 --
 drivers/net/wireless/mediatek/mt76/mt7925/usb.c  |  2 --
 drivers/net/wireless/mediatek/mt76/mt792x_usb.c  |  1 -
 drivers/net/wireless/mediatek/mt7601u/usb.c      |  3 ---
 drivers/net/wireless/ralink/rt2x00/rt2x00usb.c   | 12 +-----------
 .../net/wireless/realtek/rtl818x/rtl8187/dev.c   |  4 ----
 drivers/net/wireless/realtek/rtl8xxxu/core.c     | 11 +++--------
 drivers/net/wireless/realtek/rtw88/usb.c         |  3 +--
 18 files changed, 15 insertions(+), 82 deletions(-)

-- 
2.52.0
Re: [PATCH v2 00/18] wifi: drop redundant USB device references
Posted by Johan Hovold 2 weeks, 2 days ago
On Fri, Mar 06, 2026 at 09:51:26AM +0100, Johan Hovold wrote:
> Driver core holds a reference to the USB interface and its parent USB
> device while the interface is bound to a driver and there is no need to
> take additional references unless the structures are needed after
> disconnect.
> 
> Drop redundant device references to reduce cargo culting, make it easier
> to spot drivers where an extra reference is needed, and reduce the risk
> of memory leaks when drivers fail to release them.

> Johan Hovold (18):

>   wifi: mt76: drop redundant device reference
>   wifi: mt76x0u: drop redundant device reference
>   wifi: mt76x2u: drop redundant device reference
>   wifi: mt76: mt792xu: drop redundant device reference
>   wifi: mt7601u: drop redundant device reference

All of these are now in linux-next except for the five Mediatek fixes.

Could someone pick them up as well? Not sure which tree they'd usually
go through.

Johan
Re: [PATCH v2 00/18] wifi: drop redundant USB device references
Posted by Johan Hovold 1 day, 3 hours ago
On Tue, Mar 24, 2026 at 09:31:25AM +0100, Johan Hovold wrote:
> On Fri, Mar 06, 2026 at 09:51:26AM +0100, Johan Hovold wrote:
> > Driver core holds a reference to the USB interface and its parent USB
> > device while the interface is bound to a driver and there is no need to
> > take additional references unless the structures are needed after
> > disconnect.
> > 
> > Drop redundant device references to reduce cargo culting, make it easier
> > to spot drivers where an extra reference is needed, and reduce the risk
> > of memory leaks when drivers fail to release them.
> 
> > Johan Hovold (18):
> 
> >   wifi: mt76: drop redundant device reference
> >   wifi: mt76x0u: drop redundant device reference
> >   wifi: mt76x2u: drop redundant device reference
> >   wifi: mt76: mt792xu: drop redundant device reference
> >   wifi: mt7601u: drop redundant device reference
> 
> All of these are now in linux-next except for the five Mediatek fixes.
> 
> Could someone pick them up as well? Not sure which tree they'd usually
> go through.

It's been two more weeks (and these haven't shown up in linux-next) so
sending another reminder.

Can someone please pick these up for 7.1?

Johan
RE: [PATCH v2 00/18] wifi: drop redundant USB device references
Posted by Ping-Ke Shih 2 weeks, 2 days ago
Hi Johan,

Johan Hovold <johan@kernel.org> wrote:
> On Fri, Mar 06, 2026 at 09:51:26AM +0100, Johan Hovold wrote:
> > Driver core holds a reference to the USB interface and its parent USB
> > device while the interface is bound to a driver and there is no need to
> > take additional references unless the structures are needed after
> > disconnect.
> >
> > Drop redundant device references to reduce cargo culting, make it easier
> > to spot drivers where an extra reference is needed, and reduce the risk
> > of memory leaks when drivers fail to release them.
> 
> > Johan Hovold (18):
> 
> >   wifi: mt76: drop redundant device reference
> >   wifi: mt76x0u: drop redundant device reference
> >   wifi: mt76x2u: drop redundant device reference
> >   wifi: mt76: mt792xu: drop redundant device reference
> >   wifi: mt7601u: drop redundant device reference
> 
> All of these are now in linux-next except for the five Mediatek fixes.
> 
> Could someone pick them up as well? Not sure which tree they'd usually
> go through.

  wifi: rtl818x: drop redundant device reference
  wifi: rtl8xxxu: drop redundant device reference
  wifi: rtw88: fix device leak on probe failure

Realtek WiFi got merged into my tree (not in linux-next yet), and I plan to
send pull-request to wireless tree before 7.1 merge window. 

Ping-Ke
Re: [PATCH v2 00/18] wifi: drop redundant USB device references
Posted by Johan Hovold 2 weeks, 2 days ago
On Tue, Mar 24, 2026 at 08:40:10AM +0000, Ping-Ke Shih wrote:
> Johan Hovold <johan@kernel.org> wrote:
> > On Fri, Mar 06, 2026 at 09:51:26AM +0100, Johan Hovold wrote:
> > > Driver core holds a reference to the USB interface and its parent USB
> > > device while the interface is bound to a driver and there is no need to
> > > take additional references unless the structures are needed after
> > > disconnect.
> > >
> > > Drop redundant device references to reduce cargo culting, make it easier
> > > to spot drivers where an extra reference is needed, and reduce the risk
> > > of memory leaks when drivers fail to release them.
> > 
> > > Johan Hovold (18):
> > 
> > >   wifi: mt76: drop redundant device reference
> > >   wifi: mt76x0u: drop redundant device reference
> > >   wifi: mt76x2u: drop redundant device reference
> > >   wifi: mt76: mt792xu: drop redundant device reference
> > >   wifi: mt7601u: drop redundant device reference
> > 
> > All of these are now in linux-next except for the five Mediatek fixes.
> > 
> > Could someone pick them up as well? Not sure which tree they'd usually
> > go through.
> 
>   wifi: rtl818x: drop redundant device reference
>   wifi: rtl8xxxu: drop redundant device reference
>   wifi: rtw88: fix device leak on probe failure
> 
> Realtek WiFi got merged into my tree (not in linux-next yet), and I plan to
> send pull-request to wireless tree before 7.1 merge window. 

Yes, sorry, I forgot to mention that. I got a message about these having
been picked up so I didn't include them in the list above. Thanks.

Johan
Re: [PATCH v2 00/18] wifi: drop redundant USB device references
Posted by Jeff Johnson 1 month ago
On 3/6/2026 12:51 AM, Johan Hovold wrote:
> Driver core holds a reference to the USB interface and its parent USB
> device while the interface is bound to a driver and there is no need to
> take additional references unless the structures are needed after
> disconnect.
> 
> Drop redundant device references to reduce cargo culting, make it easier
> to spot drivers where an extra reference is needed, and reduce the risk
> of memory leaks when drivers fail to release them.
> 
> Note that I sent an ath9k patch separately here:
> 
> 	https://lore.kernel.org/all/20260305105803.17011-1-johan@kernel.org/
> 
> but I included it here in v2 for completeness.
> 
> Also note that Greg had already sent a fix for rtw88 which has been
> picked up by Ping-Ke, but who asked me to send a replacement. If an
> incremental patch is preferred I can instead send a follow up for that
> one later.
> 
> Johan
> 
> 
> Changes in v2:
>  - include ath9k, previously submitted separately
>  - include ath6kl and ath10k
>  - rename the ath6kl and ath10k disconnect callbacks
>  - fix a reference leak in rtw88 previously reported (and fixed
>    differently) by Greg
> 
> 
> Johan Hovold (18):
>   wifi: ath6kl: drop redundant device reference
>   wifi: ath6kl: rename disconnect callback
>   wifi: ath9k: drop redundant device reference
>   wifi: ath10k: drop redundant device reference
>   wifi: ath10k: rename disconnect callback
>   wifi: at76c50x: drop redundant device reference
>   wifi: libertas: drop redundant device reference
>   wifi: libertas_tf: drop redundant device reference
>   wifi: mwifiex: drop redundant device reference
>   wifi: mt76: drop redundant device reference
>   wifi: mt76x0u: drop redundant device reference
>   wifi: mt76x2u: drop redundant device reference
>   wifi: mt76: mt792xu: drop redundant device reference
>   wifi: mt7601u: drop redundant device reference
>   wifi: rt2x00: drop redundant device reference
>   wifi: rtl818x: drop redundant device reference
>   wifi: rtl8xxxu: drop redundant device reference
>   wifi: rtw88: fix device leak on probe failure
> 
>  drivers/net/wireless/ath/ath10k/usb.c            |  8 ++------
>  drivers/net/wireless/ath/ath6kl/usb.c            | 16 ++++------------
>  drivers/net/wireless/ath/ath9k/hif_usb.c         |  4 ----
>  drivers/net/wireless/atmel/at76c50x-usb.c        | 12 ++++--------
>  drivers/net/wireless/marvell/libertas/if_usb.c   |  3 ---
>  .../net/wireless/marvell/libertas_tf/if_usb.c    |  2 --
>  drivers/net/wireless/marvell/mwifiex/usb.c       |  4 ----
>  drivers/net/wireless/mediatek/mt76/mt7615/usb.c  |  3 ---
>  drivers/net/wireless/mediatek/mt76/mt76x0/usb.c  |  3 ---
>  drivers/net/wireless/mediatek/mt76/mt76x2/usb.c  |  4 ----
>  drivers/net/wireless/mediatek/mt76/mt7921/usb.c  |  2 --
>  drivers/net/wireless/mediatek/mt76/mt7925/usb.c  |  2 --
>  drivers/net/wireless/mediatek/mt76/mt792x_usb.c  |  1 -
>  drivers/net/wireless/mediatek/mt7601u/usb.c      |  3 ---
>  drivers/net/wireless/ralink/rt2x00/rt2x00usb.c   | 12 +-----------
>  .../net/wireless/realtek/rtl818x/rtl8187/dev.c   |  4 ----
>  drivers/net/wireless/realtek/rtl8xxxu/core.c     | 11 +++--------
>  drivers/net/wireless/realtek/rtw88/usb.c         |  3 +--
>  18 files changed, 15 insertions(+), 82 deletions(-)
> 

Johannes, will you be taking the entire series via wireless-next?

Or should the individual wireless driver maintainers take their patches
through their individual trees? I'm OK either way.

/jeff
Re: [PATCH v2 00/18] wifi: drop redundant USB device references
Posted by Johannes Berg 1 month ago
On Fri, 2026-03-06 at 13:39 -0800, Jeff Johnson wrote:
> 
> Johannes, will you be taking the entire series via wireless-next?
> 
> Or should the individual wireless driver maintainers take their patches
> through their individual trees? I'm OK either way.

So far I took the ones patchwork had auto-assigned to me. I can take
others though, no particular preference, but I guess I already pulled
the series apart anyway.

Let's just say if you want me to take any, assign them to me in
patchwork.

johannes
Re: [PATCH v2 00/18] wifi: drop redundant USB device references
Posted by Jeff Johnson 1 month ago
On 3/8/2026 11:27 PM, Johannes Berg wrote:
> On Fri, 2026-03-06 at 13:39 -0800, Jeff Johnson wrote:
>>
>> Johannes, will you be taking the entire series via wireless-next?
>>
>> Or should the individual wireless driver maintainers take their patches
>> through their individual trees? I'm OK either way.
> 
> So far I took the ones patchwork had auto-assigned to me. I can take
> others though, no particular preference, but I guess I already pulled
> the series apart anyway.
> 
> Let's just say if you want me to take any, assign them to me in
> patchwork.

ok, then I'll go forward with the ones assigned to me...

/jeff
Re: (subset) [PATCH v2 00/18] wifi: drop redundant USB device references
Posted by Jeff Johnson 1 month ago
On Fri, 06 Mar 2026 09:51:26 +0100, Johan Hovold wrote:
> Driver core holds a reference to the USB interface and its parent USB
> device while the interface is bound to a driver and there is no need to
> take additional references unless the structures are needed after
> disconnect.
> 
> Drop redundant device references to reduce cargo culting, make it easier
> to spot drivers where an extra reference is needed, and reduce the risk
> of memory leaks when drivers fail to release them.
> 
> [...]

Applied, thanks!

[01/18] wifi: ath6kl: drop redundant device reference
        commit: 86581adf05f526f53b90ebcbbc2fd4d9f9fd4c96
[02/18] wifi: ath6kl: rename disconnect callback
        commit: 0bc013d68a5d1943728d110d759c6587c2b81913
[03/18] wifi: ath9k: drop redundant device reference
        commit: 2ddbec82e1650d57ea0f63d284b5da01d2f21293
[04/18] wifi: ath10k: drop redundant device reference
        commit: c880c0794076f04b0058dd5cbc1f94c33d7bff44
[05/18] wifi: ath10k: rename disconnect callback
        commit: fcc3555fce3c35333891e904c3592375d5e63cf4

Best regards,
-- 
Jeff Johnson <jeff.johnson@oss.qualcomm.com>