All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] r8169: give RTL_GIGA_MAC_VER_EXTENDED a distinct value
@ 2026-08-08 10:19 Karl Mehltretter
  2026-08-13  1:00 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Mehltretter @ 2026-08-08 10:19 UTC (permalink / raw)
  To: Heiner Kallweit, nic_swsd
  Cc: Karl Mehltretter, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Simon Horman, Javen Xu, netdev,
	linux-kernel, stable

RTL_GIGA_MAC_VER_EXTENDED implicitly follows
RTL_GIGA_MAC_VER_LAST = RTL_GIGA_MAC_NONE - 1, so it has the same value
as RTL_GIGA_MAC_NONE.

rtl_init_one() therefore sends unknown chips through extended detection.
If TX_CONFIG_V2 reads as zero, they are misidentified as RTL9151AS
instead of being rejected.

Give RTL_GIGA_MAC_VER_EXTENDED a distinct value. It is only a detection
marker and is never stored in tp->mac_version.

Found by Clang's -Wduplicate-enum and verified with a QEMU stub.

Fixes: 5e3c5a2b85da9 ("r8169: add support for extended chip version id and RTL9151AS")
Cc: stable@vger.kernel.org
Assisted-by: Claude:claude-fable-5
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
 drivers/net/ethernet/realtek/r8169.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/realtek/r8169.h b/drivers/net/ethernet/realtek/r8169.h
index 0b9c1d4eb48ba..fb772cc043105 100644
--- a/drivers/net/ethernet/realtek/r8169.h
+++ b/drivers/net/ethernet/realtek/r8169.h
@@ -74,7 +74,7 @@ enum mac_version {
 	RTL_GIGA_MAC_VER_80,
 	RTL_GIGA_MAC_NONE,
 	RTL_GIGA_MAC_VER_LAST = RTL_GIGA_MAC_NONE - 1,
-	RTL_GIGA_MAC_VER_EXTENDED
+	RTL_GIGA_MAC_VER_EXTENDED = RTL_GIGA_MAC_NONE + 1
 };
 
 struct rtl8169_private;
-- 
2.53.0


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

* Re: [PATCH net] r8169: give RTL_GIGA_MAC_VER_EXTENDED a distinct value
  2026-08-08 10:19 [PATCH net] r8169: give RTL_GIGA_MAC_VER_EXTENDED a distinct value Karl Mehltretter
@ 2026-08-13  1:00 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-13  1:00 UTC (permalink / raw)
  To: Karl Mehltretter
  Cc: hkallweit1, nic_swsd, andrew+netdev, davem, edumazet, kuba,
	pabeni, horms, javen_xu, netdev, linux-kernel, stable

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat,  8 Aug 2026 12:19:41 +0200 you wrote:
> RTL_GIGA_MAC_VER_EXTENDED implicitly follows
> RTL_GIGA_MAC_VER_LAST = RTL_GIGA_MAC_NONE - 1, so it has the same value
> as RTL_GIGA_MAC_NONE.
> 
> rtl_init_one() therefore sends unknown chips through extended detection.
> If TX_CONFIG_V2 reads as zero, they are misidentified as RTL9151AS
> instead of being rejected.
> 
> [...]

Here is the summary with links:
  - [net] r8169: give RTL_GIGA_MAC_VER_EXTENDED a distinct value
    https://git.kernel.org/netdev/net-next/c/d77f3f016826

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] 2+ messages in thread

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-08 10:19 [PATCH net] r8169: give RTL_GIGA_MAC_VER_EXTENDED a distinct value Karl Mehltretter
2026-08-13  1:00 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.