]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: pcs: rtl93xx: commit attachment only after successful config
authorJonas Jelonek <jelonek.jonas@gmail.com>
Mon, 13 Jul 2026 10:50:21 +0000 (10:50 +0000)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Wed, 15 Jul 2026 17:37:00 +0000 (19:37 +0200)
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 <jelonek.jonas@gmail.com>
target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c

index 3b69844c793b99f6726d5b059e71909b85135e65..8c3e39ab8607d5064fadb50213778a216a20036b 100644 (file)
@@ -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);