netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 00/15] Aquantia PHY driver consolidation - part 1
@ 2025-08-21 15:20 Vladimir Oltean
  2025-08-21 15:20 ` [PATCH net-next 01/15] net: phy: aquantia: rename AQR412 to AQR412C and add real AQR412 Vladimir Oltean
                   ` (16 more replies)
  0 siblings, 17 replies; 22+ messages in thread
From: Vladimir Oltean @ 2025-08-21 15:20 UTC (permalink / raw)
  To: netdev
  Cc: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Daniel Golle,
	linux-kernel, Nikita Yushchenko, Bartosz Golaszewski,
	Robert Marko, Paweł Owoc, Sean Anderson, Jon Hunter

This started out as an effort to add some new features hinging on the
VEND1_GLOBAL_CFG_* registers, but I quickly started to notice that the
Aquantia PHY driver has a large code base, but individual PHYs only
implement arbitrary subsets of it.

The table below lists the PHYs known to me to have the
VEND1_GLOBAL_CFG_* registers.

 PHY       Access from            Access from
           aqr107_read_rate()     aqr113c_fill_interface_modes()
 ------------------------------------------------------------------
 AQR107    y                      n
 AQCS109   y                      n
 AQR111    y                      n
 AQR111B0  y                      n
 AQR112    y                      n
 AQR412    y                      n
 AQR113    y                      y
 AQR113C   y                      y
 AQR813    y                      n
 AQR114C   y                      n
 AQR115C   y                      y

Maybe you're wondering, after reading this, why don't more Aquantia PHYs
populate phydev->possible_interfaces based on the registers that they
are known to have? And why do AQR114C and AQR115C, PHYs from the same
generation, just having different max speeds, differ in this behaviour?
And why does AQR813, the 8-port variant of AQR113, not call
aqr113c_config_init(), but aqr107_config_init()?

I did wonder, and I don't know either, but I suspect it has to do with
developers not wanting to break what they can't test, and only touching
what they are interested in. Multiplied at a large enough scale, this
tends to result in unmaintainable code.

The tendency might also be encouraged by the slightly strange and
inconsistent naming scheme in this driver.

The set proposes a naming scheme based on generations, and feature
inheritance from Gen X to Gen X+1. This helps fill in missing
software functionalities where the hardware feature should be present.
I had to put a hard stop at 15 patches, so I've picked the more
meaningful functions to consolidate, rather than going through the
entire driver. Depending on review feedback, I can do more or I can
stop.

Furthermore, the set adds generation-appropriate support for two more
PHY IDs: AQR412 and AQR115, and fixes the improper reporting of AQR412C
as AQR412.

The changes were tested on AQR107, AQR112, AQR412C and AQR115.

Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Cc: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Cc: Robert Marko <robimarko@gmail.com>
Cc: Paweł Owoc <frut3k7@gmail.com>
Cc: Sean Anderson <sean.anderson@seco.com>

Camelia Groza (1):
  net: phy: aquantia: add support for AQR115

Vladimir Oltean (14):
  net: phy: aquantia: rename AQR412 to AQR412C and add real AQR412
  net: phy: aquantia: merge aqr113c_fill_interface_modes() into
    aqr107_fill_interface_modes()
  net: phy: aquantia: reorder AQR113C PMD Global Transmit Disable bit
    clearing with supported_interfaces
  net: phy: aquantia: rename some aqr107 functions according to
    generation
  net: phy: aquantia: fill supported_interfaces for all
    aqr_gen2_config_init() callers
  net: phy: aquantia: save a local shadow of GLOBAL_CFG register values
  net: phy: aquantia: remove handling for
    get_rate_matching(PHY_INTERFACE_MODE_NA)
  net: phy: aquantia: use cached GLOBAL_CFG registers in
    aqr107_read_rate()
  net: phy: aquantia: merge and rename aqr105_read_status() and
    aqr107_read_status()
  net: phy: aquantia: call aqr_gen2_fill_interface_modes() for AQCS109
  net: phy: aquantia: call aqr_gen3_config_init() for AQR112 and
    AQR412(C)
  net: phy: aquantia: reimplement aqcs109_config_init() as
    aqr_gen2_config_init()
  net: phy: aquantia: rename aqr113c_config_init() to
    aqr_gen4_config_init()
  net: phy: aquantia: promote AQR813 and AQR114C to
    aqr_gen4_config_init()

 drivers/net/phy/aquantia/aquantia.h      |  28 ++
 drivers/net/phy/aquantia/aquantia_main.c | 531 +++++++++++------------
 2 files changed, 289 insertions(+), 270 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2025-08-25 18:00 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21 15:20 [PATCH net-next 00/15] Aquantia PHY driver consolidation - part 1 Vladimir Oltean
2025-08-21 15:20 ` [PATCH net-next 01/15] net: phy: aquantia: rename AQR412 to AQR412C and add real AQR412 Vladimir Oltean
2025-08-21 15:35   ` Andrew Lunn
2025-08-21 15:20 ` [PATCH net-next 02/15] net: phy: aquantia: merge aqr113c_fill_interface_modes() into aqr107_fill_interface_modes() Vladimir Oltean
2025-08-21 16:20   ` Andrew Lunn
2025-08-21 15:20 ` [PATCH net-next 03/15] net: phy: aquantia: reorder AQR113C PMD Global Transmit Disable bit clearing with supported_interfaces Vladimir Oltean
2025-08-21 16:21   ` Andrew Lunn
2025-08-21 15:20 ` [PATCH net-next 04/15] net: phy: aquantia: rename some aqr107 functions according to generation Vladimir Oltean
2025-08-21 15:20 ` [PATCH net-next 05/15] net: phy: aquantia: fill supported_interfaces for all aqr_gen2_config_init() callers Vladimir Oltean
2025-08-21 15:20 ` [PATCH net-next 06/15] net: phy: aquantia: save a local shadow of GLOBAL_CFG register values Vladimir Oltean
2025-08-21 15:20 ` [PATCH net-next 07/15] net: phy: aquantia: remove handling for get_rate_matching(PHY_INTERFACE_MODE_NA) Vladimir Oltean
2025-08-22  3:22   ` Andrew Lunn
2025-08-21 15:20 ` [PATCH net-next 08/15] net: phy: aquantia: use cached GLOBAL_CFG registers in aqr107_read_rate() Vladimir Oltean
2025-08-21 15:20 ` [PATCH net-next 09/15] net: phy: aquantia: merge and rename aqr105_read_status() and aqr107_read_status() Vladimir Oltean
2025-08-21 15:20 ` [PATCH net-next 10/15] net: phy: aquantia: call aqr_gen2_fill_interface_modes() for AQCS109 Vladimir Oltean
2025-08-21 15:20 ` [PATCH net-next 11/15] net: phy: aquantia: call aqr_gen3_config_init() for AQR112 and AQR412(C) Vladimir Oltean
2025-08-21 15:20 ` [PATCH net-next 12/15] net: phy: aquantia: reimplement aqcs109_config_init() as aqr_gen2_config_init() Vladimir Oltean
2025-08-21 15:20 ` [PATCH net-next 13/15] net: phy: aquantia: rename aqr113c_config_init() to aqr_gen4_config_init() Vladimir Oltean
2025-08-21 15:20 ` [PATCH net-next 14/15] net: phy: aquantia: promote AQR813 and AQR114C " Vladimir Oltean
2025-08-21 15:20 ` [PATCH net-next 15/15] net: phy: aquantia: add support for AQR115 Vladimir Oltean
2025-08-25 17:53 ` [PATCH net-next 00/15] Aquantia PHY driver consolidation - part 1 Jakub Kicinski
2025-08-25 18:00 ` patchwork-bot+netdevbpf

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