]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: phy: dp83869: fix status reporting for 1000base-x autonegotiation
authorRomain Gantois <romain.gantois@bootlin.com>
Tue, 12 Nov 2024 14:06:08 +0000 (15:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Dec 2024 09:40:59 +0000 (10:40 +0100)
commit6b29c887a63a30c769c15bddb6281abfa02e89c6
treeef83037d4a5bdabdc01c14c9ccfb022400ef95aa
parenteaafbcf0a5782ae412ca7de12ef83fc48ccea4cf
net: phy: dp83869: fix status reporting for 1000base-x autonegotiation

commit 378e8feea9a70d37a5dc1678b7ec27df21099fa5 upstream.

The DP83869 PHY transceiver supports converting from RGMII to 1000base-x.
In this operation mode, autonegotiation can be performed, as described in
IEEE802.3.

The DP83869 has a set of fiber-specific registers located at offset 0xc00.
When the transceiver is configured in RGMII-to-1000base-x mode, these
registers are mapped onto offset 0, which should make reading the
autonegotiation status transparent.

However, the fiber registers at offset 0xc04 and 0xc05 follow the bit
layout specified in Clause 37, and genphy_read_status() assumes a Clause 22
layout. Thus, genphy_read_status() doesn't properly read the capabilities
advertised by the link partner, resulting in incorrect link parameters.

Similarly, genphy_config_aneg() doesn't properly write advertised
capabilities.

Fix the 1000base-x autonegotiation procedure by replacing
genphy_read_status() and genphy_config_aneg() with their Clause 37
equivalents.

Fixes: a29de52ba2a1 ("net: dp83869: Add ability to advertise Fiber connection")
Cc: stable@vger.kernel.org
Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
Link: https://patch.msgid.link/20241112-dp83869-1000base-x-v3-1-36005f4ab0d9@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/dp83869.c