net: phy: mediatek: fix TX blink masks using the RX bits
Subsystems (5)
PATCH 1/1 net: phy: mediatek: fix TX blink masks using the RX bits
MTK_GPHY_LED_TX_BLINK_SET and MTK_2P5GPHY_LED_TX_BLINK_SET are built from the RX blink bits instead of the TX ones, so both TX masks are identical to their RX counterparts. The TX bits they should be using, MTK_PHY_LED_BLINK_{10,100,1000,2500}TX, are otherwise only referenced by the per-speed branch of mtk_phy_led_hw_ctrl_set().
A TX trigger selected without a link trigger therefore programs the RX blink bits, and the LED blinks on received traffic. The masks are also used to decode the blink register in mtk_phy_led_hw_ctrl_get(), which as a result cannot tell the two triggers apart: an RX-only configuration reads back as RX and TX, and a TX-only configuration reads back as neither.
--- drivers/net/phy/mediatek/mtk.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/phy/mediatek/mtk.h +4 -4
@@ -53,15 +53,15 @@#define MTK_GPHY_LED_RX_BLINK_SET (MTK_PHY_LED_BLINK_1000RX | \ MTK_PHY_LED_BLINK_100RX | \ MTK_PHY_LED_BLINK_10RX) -#define MTK_GPHY_LED_TX_BLINK_SET (MTK_PHY_LED_BLINK_1000RX | \ - MTK_PHY_LED_BLINK_100RX | \ - MTK_PHY_LED_BLINK_10RX) +#define MTK_GPHY_LED_TX_BLINK_SET (MTK_PHY_LED_BLINK_1000TX | \ + MTK_PHY_LED_BLINK_100TX | \ + MTK_PHY_LED_BLINK_10TX)#define MTK_2P5GPHY_LED_ON_SET (MTK_PHY_LED_ON_LINK2500 | \ MTK_GPHY_LED_ON_SET)#define MTK_2P5GPHY_LED_RX_BLINK_SET (MTK_PHY_LED_BLINK_2500RX | \ MTK_GPHY_LED_RX_BLINK_SET) -#define MTK_2P5GPHY_LED_TX_BLINK_SET (MTK_PHY_LED_BLINK_2500RX | \ +#define MTK_2P5GPHY_LED_TX_BLINK_SET (MTK_PHY_LED_BLINK_2500TX | \ MTK_GPHY_LED_TX_BLINK_SET)#define MTK_PHY_LED_STATE_FORCE_ON 0
base-commit: 1a35da325cac4d5bcad76a2aa943408a6f1d9000
Signature · 1 line
2.34.1
Andrew Lunn
maintainerQuoted 6 lines · Ahmed Naseef
MTK_GPHY_LED_TX_BLINK_SETandMTK_2P5GPHY_LED_TX_BLINK_SETare built from the RX blink bits instead of the TX ones, so both TX masks are identical to their RX counterparts. The TX bits they should be using, MTK_PHY_LED_BLINK_{10,100,1000,2500}TX, are otherwise only referenced by the per-speed branch ofmtk_phy_led_hw_ctrl_set().
Quoted 8 lines
A TX trigger selected without a link trigger therefore programs the RX blink bits, and the LED blinks on received traffic. The masks are also used to decode the blink register in
mtk_phy_led_hw_ctrl_get(), which as a result cannot tell the two triggers apart: an RX-only configuration reads back as RX and TX, and a TX-only configuration reads back as neither.Fixes 7f9c320c98db ("net: phy: mediatek: Move LED helper functions into mtk phy lib")
Was this bug introduced in this commit, or did this commit just move the code around and it was broken before? The Fixes should go back to where the bug was added, which could be earlier.
Andrew
Quoted 14 lines · Andrew Lunn
Quoted 13 lines · Ahmed Naseef
MTK_GPHY_LED_TX_BLINK_SETandMTK_2P5GPHY_LED_TX_BLINK_SETare built from the RX blink bits instead of the TX ones, so both TX masks are identical to their RX counterparts. The TX bits they should be using, MTK_PHY_LED_BLINK_{10,100,1000,2500}TX, are otherwise only referenced by the per-speed branch ofmtk_phy_led_hw_ctrl_set().A TX trigger selected without a link trigger therefore programs the RX blink bits, and the LED blinks on received traffic. The masks are also used to decode the blink register in
mtk_phy_led_hw_ctrl_get(), which as a result cannot tell the two triggers apart: an RX-only configuration reads back as RX and TX, and a TX-only configuration reads back as neither.
Quoted 5 lines
Quoted 1 line
Fixes 7f9c320c98db ("net: phy: mediatek: Move LED helper functions into mtk phy lib")Was this bug introduced in this commit, or did this commit just move the code around and it was broken before? The Fixes should go back to where the bug was added, which could be earlier.
It was introduced by that commit. Before it, mtk-ge-soc.c correctly had:
#define MTK_PHY_LED_BLINK_TX (MTK_PHY_LED_BLINK_10TX |\
MTK_PHY_LED_BLINK_100TX |\
MTK_PHY_LED_BLINK_1000TX)which 7f9c320c98db removed, adding to mtk.h in the same commit:
#define MTK_GPHY_LED_TX_BLINK_SET (MTK_PHY_LED_BLINK_1000RX | \
MTK_PHY_LED_BLINK_100RX | \
MTK_PHY_LED_BLINK_10RX)Thanks,
Ahmed
Quoted 2 lines
Andrew
Quoted 21 lines · Ahmed Naseef
Quoted 14 lines · Andrew Lunn
Quoted 13 lines · Ahmed Naseef
MTK_GPHY_LED_TX_BLINK_SETandMTK_2P5GPHY_LED_TX_BLINK_SETare built from the RX blink bits instead of the TX ones, so both TX masks are identical to their RX counterparts. The TX bits they should be using, MTK_PHY_LED_BLINK_{10,100,1000,2500}TX, are otherwise only referenced by the per-speed branch ofmtk_phy_led_hw_ctrl_set().A TX trigger selected without a link trigger therefore programs the RX blink bits, and the LED blinks on received traffic. The masks are also used to decode the blink register in
mtk_phy_led_hw_ctrl_get(), which as a result cannot tell the two triggers apart: an RX-only configuration reads back as RX and TX, and a TX-only configuration reads back as neither.Quoted 5 lines
Quoted 1 line
Fixes 7f9c320c98db ("net: phy: mediatek: Move LED helper functions into mtk phy lib")Was this bug introduced in this commit, or did this commit just move the code around and it was broken before? The Fixes should go back to where the bug was added, which could be earlier.
Quoted 5 lines
It was introduced by that commit. Before it,
mtk-ge-soc.ccorrectly had:#define MTK_PHY_LED_BLINK_TX (MTK_PHY_LED_BLINK_10TX |\ MTK_PHY_LED_BLINK_100TX |\ MTK_PHY_LED_BLINK_1000TX)
Thanks for checking.
Andrew
This patch was applied to netdev/net.git (main) by Paolo Abeni <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <[email protected]>:
Quoted 6 lines · On Tue, 4 Aug 2026 15:35:11 +0400 you wrote:
MTK_GPHY_LED_TX_BLINK_SETandMTK_2P5GPHY_LED_TX_BLINK_SETare built from the RX blink bits instead of the TX ones, so both TX masks are identical to their RX counterparts. The TX bits they should be using, MTK_PHY_LED_BLINK_{10,100,1000,2500}TX, are otherwise only referenced by the per-speed branch ofmtk_phy_led_hw_ctrl_set().
Quoted 8 lines
A TX trigger selected without a link trigger therefore programs the RX blink bits, and the LED blinks on received traffic. The masks are also used to decode the blink register in
mtk_phy_led_hw_ctrl_get(), which as a result cannot tell the two triggers apart: an RX-only configuration reads back as RX and TX, and a TX-only configuration reads back as neither.[...]
Here is the summary with links:
- [net] net: phy: mediatek: fix TX blink masks using the RX bits
https://git.kernel.org/netdev/net/c/f684c514f796
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html