From 3498acda6b68139ec7b8037dbdf1ea720997ed04 Mon Sep 17 00:00:00 2001 From: Ziyou Xu Date: Sat, 29 Aug 2026 11:38:43 +0800 Subject: [PATCH] net: phy: air_en8811h: restore AN8811HB LED GPIO after MCU restart Commit 03b4702fc5e3 ("net: phy: air_en8811h: move LED GPIO configuration to config_init") moved the EN8811H LED GPIO setup from probe to config_init because an MD32 restart clears the output-enable bits. AN8811HB follows the same initialization sequence: an8811hb_probe() enables GPIO3/4/5, and later config_init() calls restart MD32. Move the AN8811HB GPIO setup to the end of an8811hb_config_init(), matching the current EN8811H path. Suggested-by: Jakub Kicinski Signed-off-by: Ziyou Xu Link: https://patch.msgid.link/20260829033844.1975-1-xuziyougm@gmail.com Signed-off-by: Jakub Kicinski --- drivers/net/phy/air_en8811h.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c index 0eeb7b9a4e26..38eb18f0e9bb 100644 --- a/drivers/net/phy/air_en8811h.c +++ b/drivers/net/phy/air_en8811h.c @@ -1125,13 +1125,6 @@ static int an8811hb_probe(struct phy_device *phydev) if (ret) goto err_dev_create; - /* Configure led gpio pins as output */ - ret = air_phy_buckpbus_reg_modify(phydev, AN8811HB_GPIO_OUTPUT, - AN8811HB_GPIO_OUTPUT_345, - AN8811HB_GPIO_OUTPUT_345); - if (ret < 0) - goto err_dev_create; - return 0; err_dev_create: @@ -1265,9 +1258,15 @@ static int an8811hb_config_init(struct phy_device *phydev) ret = air_leds_init(phydev, EN8811H_LED_COUNT, AIR_PHY_LED_DUR, AIR_LED_MODE_USER_DEFINE); - if (ret < 0) + if (ret < 0) { phydev_err(phydev, "Failed to initialize leds: %d\n", ret); + return ret; + } + /* Restore LED GPIO output enables after MCU initialization. */ + ret = air_phy_buckpbus_reg_modify(phydev, AN8811HB_GPIO_OUTPUT, + AN8811HB_GPIO_OUTPUT_345, + AN8811HB_GPIO_OUTPUT_345); return ret; }