Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: phy: micrel: fix KSZ8081/KSZ8091 cable test

Commit 21b688dabecb ("net: phy: micrel: Cable Diag feature for lan8814
phy") introduced cable_test support for the LAN8814 that reuses parts of
the KSZ886x logic and introduced the cable_diag_reg and pair_mask
parameters to account for differences between those chips.

However, it did not update the ksz8081_type struct, so those members are
now 0, causing no pairs to be tested in ksz886x_cable_test_get_status
and ksz886x_cable_test_wait_for_completion to poll the wrong register
for the affected PHYs (Basic Control/Reset, which is 0 in normal
operation) and exit immediately.

Fix this by setting both struct members accordingly.

Fixes: 21b688dabecb ("net: phy: micrel: Cable Diag feature for lan8814 phy")
Cc: stable@vger.kernel.org
Signed-off-by: Florian Larysch <fl@n621.de>
Link: https://patch.msgid.link/20250723222250.13960-1-fl@n621.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Florian Larysch and committed by
Jakub Kicinski
49db61c2 1bbb76a8

+2
+2
drivers/net/phy/micrel.c
··· 472 472 473 473 static const struct kszphy_type ksz8081_type = { 474 474 .led_mode_reg = MII_KSZPHY_CTRL_2, 475 + .cable_diag_reg = KSZ8081_LMD, 476 + .pair_mask = KSZPHY_WIRE_PAIR_MASK, 475 477 .has_broadcast_disable = true, 476 478 .has_nand_tree_disable = true, 477 479 .has_rmii_ref_clk_sel = true,