netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next RFC PATCH 0/6] net: phy: support multi PHY in phy_driver Was: net: phy: detach PHY driver OPs from phy_driver struct
@ 2024-02-18 19:00 Christian Marangi
  2024-02-18 19:00 ` [net-next RFC PATCH 1/6] net: phy: add support for defining multiple PHY IDs in PHY driver Christian Marangi
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Christian Marangi @ 2024-02-18 19:00 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Florian Fainelli,
	Broadcom internal kernel review list, Christian Marangi,
	Robert Marko, Russell King (Oracle), Greg Kroah-Hartman,
	Pieter Jansen van Vuuren, Nipun Gupta, Andy Shevchenko,
	Puneet Gupta, Abhijit Gangurde, Umang Jain, netdev, linux-kernel

This is an alternative implementation of "net: phy: detach PHY driver OPs
from phy_driver struct" with the same object in mind.

As was pointed out in the previous series, deatching OPs is a way too big
change (although IMHO needed, but I understand the problem with downstream
and ugly code). As suggested and was already an idea discussed privately,
a more easier approach is introduce an alternative way in phy_driver
struct to declare PHY with the use of an array of IDs.

Some small changes were needed to mod_devicetable to make mdio_device_id
more suitable for the task.

This implementation keep the single way to declare PHY ID in phy_driver
but also indotruce .ids where a table of mdio_device_id can be defined.
Each entry can optionally have a .name variable to define a more specific
PHY name (for phydev_info/err.. usage) that if detected will overwrite
the dev name.

An example of this name is a phy_driver with a .name "Aquantia 107/102"
and .ids with single mdio_device_id with "Aquantia 107" and "Aquantia 102"

"Aquantia 107/102" will be used for early PHY driver probe and the more
specific name will be used as soon as the phydev dev_id is populated.

Aquantia driver is reworked to this implementation and BCM7xxx driver
table is rewritten to greatly benefits from this implementation.

While at it I also notice a strange problem with detected PHY ID and
C45 PHYs. Probably i will have to drop it, but including in this series
just to make someone aware and maybe discuss about it too?

Christian Marangi (6):
  net: phy: add support for defining multiple PHY IDs in PHY driver
  net: phy: fill phy_id with C45 PHY
  mod_devicetable: permit to define a name for an mdio_device_id
  net: phy: support named mdio_device_id PHY IDs
  net: phy: aquantia: group common OPs for PHYs where possible
  net: phy: bcm7xxx: rework phy_driver table to new multiple PHY ID
    format

 drivers/net/phy/aquantia/aquantia_main.c | 170 +++++++++--------------
 drivers/net/phy/bcm7xxx.c                | 140 +++++++++++--------
 drivers/net/phy/phy_device.c             | 104 +++++++++++---
 include/linux/mod_devicetable.h          |   2 +
 include/linux/phy.h                      |   8 +-
 5 files changed, 243 insertions(+), 181 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2024-02-19 22:00 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-18 19:00 [net-next RFC PATCH 0/6] net: phy: support multi PHY in phy_driver Was: net: phy: detach PHY driver OPs from phy_driver struct Christian Marangi
2024-02-18 19:00 ` [net-next RFC PATCH 1/6] net: phy: add support for defining multiple PHY IDs in PHY driver Christian Marangi
2024-02-18 19:33   ` Russell King (Oracle)
2024-02-18 19:57     ` Christian Marangi
2024-02-18 20:10       ` Andrew Lunn
2024-02-18 20:27         ` Christian Marangi
2024-02-18 20:34           ` Russell King (Oracle)
2024-02-18 20:44             ` Christian Marangi
2024-02-18 21:06               ` Russell King (Oracle)
2024-02-18 22:07               ` Andrew Lunn
2024-02-18 19:00 ` [net-next RFC PATCH 2/6] net: phy: fill phy_id with C45 PHY Christian Marangi
2024-02-18 19:35   ` Russell King (Oracle)
2024-02-18 19:59     ` Christian Marangi
2024-02-18 19:00 ` [net-next RFC PATCH 3/6] mod_devicetable: permit to define a name for an mdio_device_id Christian Marangi
2024-02-18 19:00 ` [net-next RFC PATCH 4/6] net: phy: support named mdio_device_id PHY IDs Christian Marangi
2024-02-18 19:00 ` [net-next RFC PATCH 5/6] net: phy: aquantia: group common OPs for PHYs where possible Christian Marangi
2024-02-18 19:00 ` [net-next RFC PATCH 6/6] net: phy: bcm7xxx: rework phy_driver table to new multiple PHY ID format Christian Marangi
2024-02-19  4:26   ` Florian Fainelli
2024-02-19 16:41     ` Christian Marangi
2024-02-19 20:15       ` Florian Fainelli
2024-02-19 22:00         ` Christian Marangi

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).