[][openwrt-24][mt7988][eth][Fix the issue of firmware loss after toggling the interface up and down for the Aquantia 10G PHY]
[Description]
Fix the issue of firmware loss after toggling the interface up and down
for the Aquantia 10G PHY.
Because a GPIO reset clears the PHY firmware, we should relocate the
firmware load operation to the config_init function. This relocation
will assist in reloading the PHY firmware by the driver.
Without this patch, the PHY firmware will be lost and cannot be reloaded
after a GPIO reset.
[Release-log]
Change-Id: I7748c73b6f757e93a429751629e6532b338f1b37
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/9687446
diff --git a/autobuild/unified/global/common/files/target/linux/generic/hack-6.6/702-net-phy-aquantia-move-frmware-load-to-config_init.patch b/autobuild/unified/global/common/files/target/linux/generic/hack-6.6/702-net-phy-aquantia-move-frmware-load-to-config_init.patch
new file mode 100644
index 0000000..e17bdbe
--- /dev/null
+++ b/autobuild/unified/global/common/files/target/linux/generic/hack-6.6/702-net-phy-aquantia-move-frmware-load-to-config_init.patch
@@ -0,0 +1,46 @@
+diff --git a/drivers/net/phy/aquantia/aquantia_main.c b/drivers/net/phy/aquantia/aquantia_main.c
+index 924cf8e..f864f97 100644
+--- a/drivers/net/phy/aquantia/aquantia_main.c
++++ b/drivers/net/phy/aquantia/aquantia_main.c
+@@ -626,6 +626,11 @@ static int aqr107_config_init(struct phy_device *phydev)
+ ret = aqr107_wait_reset_complete(phydev);
+ if (!ret)
+ aqr107_chip_info(phydev);
++ else {
++ ret = aqr_firmware_load(phydev);
++ if (ret)
++ return ret;
++ }
+
+ ret = phy_clear_bits_mmd(phydev, MDIO_MMD_PMAPMD, MDIO_PMA_TXDIS,
+ MDIO_PMD_TXDIS_GLOBAL);
+@@ -666,6 +671,11 @@ static int aqcs109_config_init(struct phy_device *phydev)
+ ret = aqr107_wait_reset_complete(phydev);
+ if (!ret)
+ aqr107_chip_info(phydev);
++ else {
++ ret = aqr_firmware_load(phydev);
++ if (ret)
++ return ret;
++ }
+
+ /* AQCS109 belongs to a chip family partially supporting 10G and 5G.
+ * PMA speed ability bits are the same for all members of the family,
+@@ -757,17 +767,11 @@ static int aqr107_resume(struct phy_device *phydev)
+
+ static int aqr107_probe(struct phy_device *phydev)
+ {
+- int ret;
+-
+ phydev->priv = devm_kzalloc(&phydev->mdio.dev,
+ sizeof(struct aqr107_priv), GFP_KERNEL);
+ if (!phydev->priv)
+ return -ENOMEM;
+
+- ret = aqr_firmware_load(phydev);
+- if (ret)
+- return ret;
+-
+ return aqr_hwmon_probe(phydev);
+ }
+