Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net: phy: mediatek: fix TX blink masks using the RX bits
@ 2026-08-04 11:35 Ahmed Naseef
  2026-08-04 18:11 ` Andrew Lunn
  2026-08-06 13:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 5+ messages in thread
From: Ahmed Naseef @ 2026-08-04 11:35 UTC (permalink / raw)
  To: netdev
  Cc: David S. Miller, Andrew Lunn, AngeloGioacchino Del Regno,
	Daniel Golle, Eric Dumazet, Heiner Kallweit, Jakub Kicinski,
	Matthias Brugger, Paolo Abeni, Qingfang Deng, Russell King,
	SkyLake Huang, linux-arm-kernel, linux-kernel, linux-mediatek,
	Ahmed Naseef

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.

Fixes: 7f9c320c98db ("net: phy: mediatek: Move LED helper functions into mtk phy lib")
Cc: stable@vger.kernel.org
Signed-off-by: Ahmed Naseef <naseefkm@gmail.com>
---
 drivers/net/phy/mediatek/mtk.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/mediatek/mtk.h b/drivers/net/phy/mediatek/mtk.h
index 320f76ffa81f..79e09727b81b 100644
--- a/drivers/net/phy/mediatek/mtk.h
+++ b/drivers/net/phy/mediatek/mtk.h
@@ -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
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net] net: phy: mediatek: fix TX blink masks using the RX bits
  2026-08-04 11:35 [PATCH net] net: phy: mediatek: fix TX blink masks using the RX bits Ahmed Naseef
@ 2026-08-04 18:11 ` Andrew Lunn
  2026-08-04 18:32   ` Ahmed Naseef
  2026-08-06 13:00 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Lunn @ 2026-08-04 18:11 UTC (permalink / raw)
  To: Ahmed Naseef
  Cc: netdev, David S. Miller, AngeloGioacchino Del Regno, Daniel Golle,
	Eric Dumazet, Heiner Kallweit, Jakub Kicinski, Matthias Brugger,
	Paolo Abeni, Qingfang Deng, Russell King, SkyLake Huang,
	linux-arm-kernel, linux-kernel, linux-mediatek

On Tue, Aug 04, 2026 at 03:35:11PM +0400, Ahmed Naseef wrote:
> 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.
> 
> 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] net: phy: mediatek: fix TX blink masks using the RX bits
  2026-08-04 18:11 ` Andrew Lunn
@ 2026-08-04 18:32   ` Ahmed Naseef
  2026-08-04 19:26     ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Ahmed Naseef @ 2026-08-04 18:32 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Ahmed Naseef, netdev, David S. Miller, AngeloGioacchino Del Regno,
	Daniel Golle, Eric Dumazet, Heiner Kallweit, Jakub Kicinski,
	Matthias Brugger, Paolo Abeni, Qingfang Deng, Russell King,
	SkyLake Huang, linux-arm-kernel, linux-kernel, linux-mediatek

On Tue, Aug 04, 2026 at 08:11:21PM +0200, Andrew Lunn wrote:
> On Tue, Aug 04, 2026 at 03:35:11PM +0400, Ahmed Naseef wrote:
> > 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.
> > 
> > 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

> 
> 	Andrew


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] net: phy: mediatek: fix TX blink masks using the RX bits
  2026-08-04 18:32   ` Ahmed Naseef
@ 2026-08-04 19:26     ` Andrew Lunn
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2026-08-04 19:26 UTC (permalink / raw)
  To: Ahmed Naseef
  Cc: netdev, David S. Miller, AngeloGioacchino Del Regno, Daniel Golle,
	Eric Dumazet, Heiner Kallweit, Jakub Kicinski, Matthias Brugger,
	Paolo Abeni, Qingfang Deng, Russell King, SkyLake Huang,
	linux-arm-kernel, linux-kernel, linux-mediatek

On Tue, Aug 04, 2026 at 10:32:38PM +0400, Ahmed Naseef wrote:
> On Tue, Aug 04, 2026 at 08:11:21PM +0200, Andrew Lunn wrote:
> > On Tue, Aug 04, 2026 at 03:35:11PM +0400, Ahmed Naseef wrote:
> > > 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.
> > > 
> > > 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)

Thanks for checking.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] net: phy: mediatek: fix TX blink masks using the RX bits
  2026-08-04 11:35 [PATCH net] net: phy: mediatek: fix TX blink masks using the RX bits Ahmed Naseef
  2026-08-04 18:11 ` Andrew Lunn
@ 2026-08-06 13:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-06 13:00 UTC (permalink / raw)
  To: Ahmed Naseef
  Cc: netdev, davem, andrew, angelogioacchino.delregno, daniel,
	edumazet, hkallweit1, kuba, matthias.bgg, pabeni, dqfext, linux,
	SkyLake.Huang, linux-arm-kernel, linux-kernel, linux-mediatek

Hello:

This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Tue,  4 Aug 2026 15:35:11 +0400 you wrote:
> 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.
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-08-06 13:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04 11:35 [PATCH net] net: phy: mediatek: fix TX blink masks using the RX bits Ahmed Naseef
2026-08-04 18:11 ` Andrew Lunn
2026-08-04 18:32   ` Ahmed Naseef
2026-08-04 19:26     ` Andrew Lunn
2026-08-06 13:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox