From: Jonas Jelonek Date: Mon, 13 Jul 2026 10:50:21 +0000 (+0000) Subject: realtek: pcs: rtl93xx: commit attachment only after successful config X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f8afbb637befb49009e39f1cd5e7e6693aca6caf;p=thirdparty%2Fopenwrt.git realtek: pcs: rtl93xx: commit attachment only after successful config sds->attachment was written right after selection, before config_attachment() ran, so a failed config call would leave it reflecting a value that was never actually applied to hardware. Move the assignment after the call succeeds, matching how sds->hw_mode is only committed after set_hw_mode() succeeds. Link: https://github.com/openwrt/openwrt/pull/24232 Signed-off-by: Jonas Jelonek --- diff --git a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c index 3b69844c793..8c3e39ab860 100644 --- a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c +++ b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c @@ -3927,11 +3927,11 @@ static int rtpcs_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode, if (ret < 0) return ret; - sds->attachment = attachment; - ret = sds->ops->config_attachment(sds, attachment, hw_mode); if (ret < 0) return ret; + + sds->attachment = attachment; } ret = sds->ops->set_hw_mode(sds, hw_mode);