openwrt-mirror/target/linux/realtek
Markus Stockhausen 0f9ebe2da7 realtek: fix mdio parent/child locking issues
Since the early beginning of the Realtek DSA driver there is an uncovered
locking issue between the standard (parent) mdio bus and the DSA (child)
mdio bus. This comes from the fact that the DSA bus simply links to the
parent read and write functions and calls them directly. This leads to
the following lock issue.

- Child bus calls phy_read/write functions and uses its internal lock
- Parent bus calls phy_read/write functions and uses its internal lock

It becomes clear that critical section can be accessed twice without
knowing that a operation from the other bus is currently active. This
can lead to critical malfunctions because the mdio driver needs a lot of
internal magic to get page selection done right. Effects are:

- The original page is lost after a phy_write/read_paged() call
- dmesg like "Realtek RTL8218B (external) rtl838x slave mii-0:00:
  Expected external RTL8218B, found PHY-ID 6b23"

Other DSA drivers simply use the read/write functions from the parent bus
and thus avoid locking issues. Do it the same way.

Fixes: 2b88563ee5 ("realtek: update the tree to the latest refactored version")
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/18824
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 461fc06f9d)
Link: https://github.com/openwrt/openwrt/pull/18755
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-06-08 21:19:31 +02:00
..
base-files realtek: Split Zyxel GS1900-8 into v1 and v2 2025-02-22 12:32:35 +01:00
dts realtek: add PoE enable line to Netgear GS310TP 2025-02-22 12:33:08 +01:00
files/firmware/rtl838x_phy
files-6.6 realtek: fix mdio parent/child locking issues 2025-06-08 21:19:31 +02:00
image realtek: HPE 1920-48G-PoE: allow fan speed control 2025-02-22 12:32:35 +01:00
patches-6.6 generic: net: phy: sfp: backport some FS copper SFP fixes 2025-05-20 20:49:01 +01:00
profiles target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00
rtl838x realtek: add missing symbol 2025-05-20 20:49:01 +01:00
rtl839x realtek: add missing symbol 2025-05-20 20:49:01 +01:00
rtl930x realtek: add missing symbol 2025-05-20 20:49:01 +01:00
rtl931x realtek: drop old RTL8231 driver 2025-02-22 12:32:35 +01:00
Makefile realtek: trim default package selection 2025-01-04 20:40:02 +01:00