netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] r8169: bail out from probe if fiber mode is detected on RTL8127AF
@ 2025-11-13 21:09 Heiner Kallweit
  2025-11-18  4:30 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Heiner Kallweit @ 2025-11-13 21:09 UTC (permalink / raw)
  To: Realtek linux nic maintainers, Andrew Lunn, Paolo Abeni,
	Eric Dumazet, Jakub Kicinski, Simon Horman
  Cc: netdev@vger.kernel.org, Daniel Golle

It was reported that on a card with RTL8127AF (SFP + DAC) link-up isn't
detected. Realtek hides the SFP behind the internal PHY, which isn't
behaving fully compliance with clause 22 any longer in fiber mode.
Due to not having access to chip documentation there isn't much I can
do for now. Instead of silently failing to detect link-up in fiber mode,
inform the user that fiber mode isn't support and bail out.

The logic to detect fiber mode is borrowed from Realtek's r8127 driver.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/ethernet/realtek/r8169_main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index 2a4d9b548..d9113b6c6 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5448,6 +5448,15 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 	tp->aspm_manageable = !rc;
 
+	/* Fiber mode on RTL8127AF isn't supported */
+	if (rtl_is_8125(tp)) {
+		u16 data = r8168_mac_ocp_read(tp, 0xd006);
+
+		if ((data & 0xff) == 0x07)
+			return dev_err_probe(&pdev->dev, -ENODEV,
+					     "Fiber mode not supported\n");
+	}
+
 	tp->dash_type = rtl_get_dash_type(tp);
 	tp->dash_enabled = rtl_dash_is_enabled(tp);
 
-- 
2.51.2


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

* Re: [PATCH net-next] r8169: bail out from probe if fiber mode is detected on RTL8127AF
  2025-11-13 21:09 [PATCH net-next] r8169: bail out from probe if fiber mode is detected on RTL8127AF Heiner Kallweit
@ 2025-11-18  4:30 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-11-18  4:30 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: nic_swsd, andrew+netdev, pabeni, edumazet, kuba, horms, netdev,
	daniel

Hello:

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

On Thu, 13 Nov 2025 22:09:08 +0100 you wrote:
> It was reported that on a card with RTL8127AF (SFP + DAC) link-up isn't
> detected. Realtek hides the SFP behind the internal PHY, which isn't
> behaving fully compliance with clause 22 any longer in fiber mode.
> Due to not having access to chip documentation there isn't much I can
> do for now. Instead of silently failing to detect link-up in fiber mode,
> inform the user that fiber mode isn't support and bail out.
> 
> [...]

Here is the summary with links:
  - [net-next] r8169: bail out from probe if fiber mode is detected on RTL8127AF
    https://git.kernel.org/netdev/net-next/c/28c0074fd4b7

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:[~2025-11-18  4:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-13 21:09 [PATCH net-next] r8169: bail out from probe if fiber mode is detected on RTL8127AF Heiner Kallweit
2025-11-18  4:30 ` 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;
as well as URLs for NNTP newsgroup(s).