]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: phy: keep register state during RTL8214FC fibre check 21393/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Sun, 4 Jan 2026 20:41:12 +0000 (21:41 +0100)
committerStijn Tintel <stijn@linux-ipv6.be>
Fri, 9 Jan 2026 15:20:35 +0000 (17:20 +0200)
commit1137aaa1c97e44bf1f5582250dc7a030828dcd53
tree7db57065235d9a4b161a391cec57dc362213c4c9
parentb5195cd473a9eb622073709e3a32ea51770095eb
realtek: phy: keep register state during RTL8214FC fibre check

Reading the fibre status of a RTL8214FC needs access to the
page register (31) and the extended page register (30).

The current implementation has two issues.

- The extended page register is not restored after changes
- Instead of register 30 its write-only sibling 29 is used.

This has the following side effect:

During regular polling kernel calls rtl8214fc_read_status
and determines the media status via __rtl8214fc_media_is_fibre.
Writing to register 29 a copy of that value is handed over
to register 30. This makes use of mdio tools for the first
port of the RTL8214FC hard. Register 30 is overwritten with
zero every second.

Change access from register 29 to register 30 and adapt
the sequence to restore register 30 contents at the end.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21393
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c