From: Jakub Kicinski Date: Mon, 25 Aug 2025 17:54:18 +0000 (-0700) Subject: Merge branch 'aquantia-phy-driver-consolidation-part-1' X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=444b02ce3f5cd4ba4cc06f3f0166a1b1ed73aadf;p=thirdparty%2Fkernel%2Fstable.git Merge branch 'aquantia-phy-driver-consolidation-part-1' Vladimir Oltean says: ==================== Aquantia PHY driver consolidation - part 1 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. ==================== Link: https://patch.msgid.link/20250821152022.1065237-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski --- 444b02ce3f5cd4ba4cc06f3f0166a1b1ed73aadf