openwrt/target/linux/realtek
Markus Stockhausen 461fc06f9d
Some checks are pending
Build Kernel / Build all affected Kernels (push) Waiting to run
Build all core packages / Build all core packages for selected target (push) Waiting to run
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Waiting to run
Build host tools / Build host tools for linux and macos based systems (push) Waiting to run
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>
2025-05-22 18:58:58 +02:00
..
base-files realtek: Split Zyxel GS1900-8 into v1 and v2 2025-01-25 15:07:13 +01:00
dts realtek: fix cpu port link type 2025-05-06 10:56:58 +02:00
files/firmware/rtl838x_phy
files-6.6 realtek: fix mdio parent/child locking issues 2025-05-22 18:58:58 +02:00
image realtek: add support for D-Link DGS-1210-26 2025-04-07 12:22:00 +02:00
patches-6.6 kernel: bump 6.6 to 6.6.88 2025-05-03 19:57:53 +02:00
profiles target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00
rtl838x realtek: add missing symbol 2025-05-03 23:23:10 +03:00
rtl839x realtek: add missing symbol 2025-05-03 23:23:10 +03:00
rtl930x realtek: add missing symbol 2025-05-03 23:23:10 +03:00
rtl931x realtek rtl931x: mark subtarget as source-only 2025-05-09 16:38:19 +02:00
Makefile realtek: trim default package selection 2025-01-04 20:35:48 +01:00