All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v6 0/2] net: phy: fix a second attach of an attached PHY and the module put on detach
@ 2026-10-13 15:11 Aleksei Sviridkin
  2026-10-13 15:11 ` [PATCH net-next v6 1/2] net: phy: refuse a second attach before touching the PHY Aleksei Sviridkin
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Aleksei Sviridkin @ 2026-10-13 15:11 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, netdev
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	linux-kernel, Florian Fainelli, Woojung Huh, Vladimir Oltean,
	Maxime Chevallier

Two phylib fixes found on a Keenetic KN-1012 (MT7981) while chasing a
PHY driver unbind race. A second attach of an attached PHY tears down
the first consumer, and a detach after a driver unbind leaks the module
reference.

1: refuse a second attach before the driver module is taken or the
   generic driver bound.
2: put the module the attach pinned, not whatever driver is bound at
   detach.

Patch 1 goes first: with patch 2 alone, the second attach error path
leaves the first consumer's module reference pinned.

Changes in v6 (since v5):
https://lore.kernel.org/netdev/20261009180551.1234107-1-f@lex.la/
- Dropped patches 3 and 4 (the bind_lock and the unbind wait), as
  Andrew suggested: unbinding a PHY driver is a development tool and
  not worth that complexity.
- Dropped the Fixes tags, the series targets net-next.
- Patch 2: added Andrew's Reviewed-by.

Aleksei Sviridkin (2):
  net: phy: refuse a second attach before touching the PHY
  net: phy: put the driver module the attach took

 drivers/net/phy/phy_device.c | 25 +++++++++++++++----------
 include/linux/phy.h          |  2 ++
 2 files changed, 17 insertions(+), 10 deletions(-)

-- 
2.53.0


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

end of thread, other threads:[~2026-10-17  1:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-13 15:11 [PATCH net-next v6 0/2] net: phy: fix a second attach of an attached PHY and the module put on detach Aleksei Sviridkin
2026-10-13 15:11 ` [PATCH net-next v6 1/2] net: phy: refuse a second attach before touching the PHY Aleksei Sviridkin
2026-10-14 11:51   ` Andrew Lunn
2026-10-13 15:12 ` [PATCH net-next v6 2/2] net: phy: put the driver module the attach took Aleksei Sviridkin
2026-10-17  1:50 ` [PATCH net-next v6 0/2] net: phy: fix a second attach of an attached PHY and the module put on detach patchwork-bot+netdevbpf

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.