]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: rtl931x: Fix unsafe MAC_L2_GLOBAL_CTRL2 access 19815/head
authorSven Eckelmann <sven@narfation.org>
Wed, 20 Aug 2025 03:19:31 +0000 (05:19 +0200)
committerRobert Marko <robimarko@gmail.com>
Wed, 3 Sep 2025 07:54:51 +0000 (09:54 +0200)
commitd2beb6bdc43f5a6f0b33932dbff673c5eb3edd8c
tree7cf3a3c12ba2c2cd1ab85066c24f6c29695cbee2
parentea5a749311a5c1a5dce85915e0039b1db93f703e
realtek: rtl931x: Fix unsafe MAC_L2_GLOBAL_CTRL2 access

Registers must not be accessed in parallel by multiple drivers.
Read-modify-write operations are not atomic, and the result of parallel
access is undefined.

The MAC_L2_GLOBAL_CTRL2 register is essentially a pin configuration
register and is represented by a pinmux node in the devicetree.  Operations
on this register by the realtek,rtl838x-eth driver must therefore also be
reflected in the devicetree.

Since the MDIO sets used are board-specific, the pins must be enabled in
the board’s devicetree.  This can be achieved using the pinctrl properties
for the realtek,rtl83xx-switch.

    &switch0 {
     pinctrl-names = "default";
     pinctrl-0 = <&pinmux_enable_mdc_mdio_0>,
         <&pinmux_enable_mdc_mdio_1>;
     ....
    };

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Link: https://github.com/openwrt/openwrt/pull/19815
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/dts/rtl931x.dtsi
target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c