netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/4] net: mdio: implement optional PHY reset before MDIO access
@ 2025-10-17 16:10 Buday Csaba
  2025-10-17 16:10 ` [PATCH net-next v3 1/4] net: mdio: common handling of phy reset properties Buday Csaba
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Buday Csaba @ 2025-10-17 16:10 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Philipp Zabel,
	Florian Fainelli, netdev, devicetree, linux-kernel
  Cc: Buday Csaba

Some Ethernet PHY devices require a hard reset before any MDIO access can
be safely performed. This includes the auto-detection of the PHY ID, which
is necessary to bind the correct driver to the device.

The kernel currently does not provide a way to assert the reset before
reading the ID, making these devices usable only when the ID is hardcoded
in the Device Tree 'compatible' string.
(One notable exception is the FEC driver and its now deprecated
`phy-reset-gpios` property).

This patchset implements an optional reset before reading of the PHY ID
register, allowing such PHYs to be used with auto-detected ID. The reset
is controlled by a newly defined DT property, so it should not break
compatibility with existing systems.

There have been several earlier attempts to implement such functionality,
of which I have collected a few in the links section.

The links to my own v1 and v2 versions are also provided.

Link: https://lore.kernel.org/lkml/1499346330-12166-2-git-send-email-richard.leitner@skidata.com/
Link: https://lore.kernel.org/all/20230405-net-next-topic-net-phy-reset-v1-0-7e5329f08002@pengutronix.de/
Link: https://lore.kernel.org/netdev/20250709133222.48802-4-buday.csaba@prolan.hu/
Link: https://lore.kernel.org/all/20251013135557.62949-1-buday.csaba@prolan.hu/
Link: https://lore.kernel.org/all/20251015134503.107925-1-buday.csaba@prolan.hu/

Buday Csaba (4):
  net: mdio: common handling of phy reset properties
  net: mdio: change property read from fwnode_property_read_u32() to
    device_property_read_u32()
  dt-bindings: net: mdio: add phy-id-read-needs-reset property
  net: mdio: reset PHY before attempting to access registers in
    fwnode_mdiobus_register_phy

 .../devicetree/bindings/net/ethernet-phy.yaml |  8 +++
 drivers/net/mdio/fwnode_mdio.c                | 40 +++++++++++---
 drivers/net/phy/mdio_bus.c                    | 39 +-------------
 drivers/net/phy/mdio_device.c                 | 52 +++++++++++++++++++
 include/linux/mdio.h                          |  2 +
 5 files changed, 98 insertions(+), 43 deletions(-)


base-commit: 00922eeaca3c5c2001781bcad40e0bd54d0fdbb6
-- 
2.39.5



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

end of thread, other threads:[~2025-10-26 21:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17 16:10 [PATCH net-next v3 0/4] net: mdio: implement optional PHY reset before MDIO access Buday Csaba
2025-10-17 16:10 ` [PATCH net-next v3 1/4] net: mdio: common handling of phy reset properties Buday Csaba
2025-10-17 16:10 ` [PATCH net-next v3 2/4] net: mdio: change property read from fwnode_property_read_u32() to device_property_read_u32() Buday Csaba
2025-10-17 16:10 ` [PATCH net-next v3 3/4] dt-bindings: net: mdio: add phy-id-read-needs-reset property Buday Csaba
2025-10-26 21:20   ` Rob Herring
2025-10-17 16:10 ` [PATCH net-next v3 4/4] net: mdio: reset PHY before attempting to access registers in fwnode_mdiobus_register_phy Buday Csaba
2025-10-20  9:16   ` Philipp Zabel
2025-10-21  7:24     ` Buday Csaba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).