From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 026DC1B424F for ; Sun, 23 Nov 2025 18:41:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763923292; cv=none; b=NWQnnnYdAyXB1XLeOUIbaSQg900FTd5DfSSKb3KVNIFos10O2vVNY3Y4NL9zN5ttdPQKt+ID62hh++iRkpy6kFpuOwHY9eL0rh+gfowhTfotLXTppJNaHxUzDsO0MyLMhvZ+LQUiGH+SxgKaXi6KCH5YhVttdotkHplo8bdHhnY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763923292; c=relaxed/simple; bh=/PNQfLV0ii+5KCQrTkIiqc7h27eTmNP0h2RgkZd/OCw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NpB/PO84Qlo41QoSSCUU4U1HkXqSMuWDr8jiF+sCOIx9KrepOISX3WrBaPfvl7gL04+PO2T3Abxg2Uw7grZwkxa8Y8NJGsZv4wIIlIkZ55FHJu1RdDk94l+rHd0boj4gsR7Na/1nTlkbgbO12TCTjkoXsM/fqihUNx877CXsBoU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=e+6xZvpP; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="e+6xZvpP" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-42b3ad51fecso2886429f8f.1 for ; Sun, 23 Nov 2025 10:41:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763923289; x=1764528089; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=t1xHDzT4djyLcgh+WAmNWD5JMkOMsweKMSDPqf2u50M=; b=e+6xZvpPcaHuQwJj//cs0z94LM8hjWbyReLd+s/GUFopq64qUetTgktc5ilvA2hmqq AILBGLhkOrbGilzjyDfF75a63GtmkUtcIRaYrT2nFKTQnP1mxpO8ivnG8P31dJawNrNI zL9/l8aq5CT5uQup8Sw43HjAtCx3EkewD2zTSq4Fze0tJw2EwjKQOmA8PrHlPEg2d+yz tFjmfvyn2jD/Zvek4ZVyS1iDuFQ9Lum2cpVaKL3fH0rbVFI4ydvZeKfVuP2pPsCUN+Hh XzSHJM1OrE3VE/n5WBASq52T09ik35mnh/fD2VSDBJeQtvRf1hmvRpsK3xQMSYI8EsbR mo6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763923289; x=1764528089; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t1xHDzT4djyLcgh+WAmNWD5JMkOMsweKMSDPqf2u50M=; b=QJblsyimtOSfp7tWmLEeZWOF7y53u18lOxBDdqsEnHz/FWAG1Mnu2zHbl1Y6s4CBp9 DWt/eqlk4GvEk+NYLFD2mLsZH9mte+rkSM6g08nZZIZ5/x64dhEuTMCg9oxrcAR76+kG +lg4mxn8pNUvcnG7/Xhup8yRGQNFIPmVK0g6R4A8TqStB7h6nm6z+jBerwEY6jNtlJst dJG0hxFREcZDQ4b+bg0+3IOoXPqw1zClgU8HeE/0f71CltjNsm2ANJUtIAm/9dylDsv4 yOOO8mp1iJ+Bzj989WLFdjpZkumbaYcm40etwU/YTs904l324tfZAuwYLQHOTpiiQfHl L1Fg== X-Forwarded-Encrypted: i=1; AJvYcCUr4DMkvvMvxfgvrWcRtArapk8FDXFW1FL6hX/N3fZ2MQAuEhzF0EiyecWenDzlUhu0VYGwpd2Y8x7qxdk=@vger.kernel.org X-Gm-Message-State: AOJu0Yy10Ed4GGw5zscYuqyiMPaUfnahsdtXwyiXJpPV1Uu+EeUWkN7H 7hEjIzein/oGx5LeKsXNwMzgkvNKdTvdc+kJh0IQ356rAm4tr6+7K8E3 X-Gm-Gg: ASbGnct+ez59sh6tVlKOVXKfS7713WP0QTrqlkS8iaSf3oyzH/KYd9bzHKczqLtqJ9h v54KTW92TfDp/RXuVYzMIXkilXGj7yQBPhN8QA7bEOPPmk/qg6wo/Jj5+CeaqSnTAURukkWQ/DF JhZa/ZyfyWuaZYQT4r8weMAXssV6515xCohQKhf1WzXM+s/uwAj2CqGVOYK8DPVsF1ygCr72MdE T2rM+bcNAUv9E1tlAJKs6RYGQOClzFEB5E0xT9u6elOEQefr/3RI58zzFxzy9HxUx/i7XfhWq1x kR80QvlpF+uifthpBk2iPmXd/huCY2qvBzyytj+dW7CVDreWisXV1OC8zLmXJT4jbe7LY/l4Zl+ UgCFg+2u8vcYmBxGV6osK7Gpotcq68XmNvPLwidsk3vKnwBl3z30o7MyuLPjjzfcYxkKzcC32VA jtaY8OBz2dST+mqCOGJeIWoYbzNA== X-Google-Smtp-Source: AGHT+IF1SpjNDPWAJYuXZSPQwQ/bLUCgvaXufYBwuNWA9Q1BqBGfTLWNb0cPDYzg9eLVl5FAwHnEpw== X-Received: by 2002:a05:6000:2004:b0:3f7:b7ac:f3d2 with SMTP id ffacd0b85a97d-42cc1d3209amr9664628f8f.43.1763923288992; Sun, 23 Nov 2025 10:41:28 -0800 (PST) Received: from google.com ([37.228.206.31]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42cb7fa7affsm24014550f8f.23.2025.11.23.10.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Nov 2025 10:41:28 -0800 (PST) Date: Sun, 23 Nov 2025 18:41:26 +0000 From: Fabio Baltieri To: Heiner Kallweit Cc: nic_swsd@realtek.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Michael Zimmermann , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] r8169: add support for RTL8127ATF Message-ID: References: <20251120195055.3127-1-fabio.baltieri@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Heiner, On Sun, Nov 23, 2025 at 04:58:23PM +0100, Heiner Kallweit wrote: > This is a version with better integration with phylib, and with 10G support only. > Maybe I simplified the PHY/Serdes initialization too much, we'll see. > A difference to your version is that via ethtool you now can and have to set autoneg to off. > > I'd appreciate if you could give it a try and provide a full dmesg log and output of "ethtool ". > > Note: This patch applies on top of net-next and linux-next. However, if you apply it on top > of some other recent kernel version, conflicts should be easy to resolve. Thanks for the patch, ran some initial tests, I'm on Linus tree for other reasons but applied 3dc2a17efc5f, 1479493c91fc, 28c0074fd4b7 and the recent suspend fix, then your patch applies cleanly. Here's ethtool output: # ethtool eth1 Settings for eth1: Supported ports: [ ] Supported link modes: 10000baseT/Full Supported pause frame use: Symmetric Receive-only Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: 10000baseT/Full Advertised pause frame use: Symmetric Receive-only Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: 10000Mb/s Duplex: Full Auto-negotiation: off master-slave status: master Port: Twisted Pair PHYAD: 0 Transceiver: internal MDI-X: Unknown Supports Wake-on: pumbg Wake-on: d Link detected: yes The phy is identified correctly: [ 1563.678133] Realtek SFP PHY Mode r8169-1-500:00: attached PHY driver (mii_bus:phy_addr=r8169-1-500:00, irq=MAC) That said I've observed two issues with the current patch: 1. the link on the other end is flapping, I've seen this while working on the original patch and seems to be due to the EEE settings, it is addressed by: @@ -2439,7 +2439,10 @@ static void rtl8125a_config_eee_mac(struct rtl8169_private *tp) static void rtl8125b_config_eee_mac(struct rtl8169_private *tp) { - r8168_mac_ocp_modify(tp, 0xe040, 0, BIT(1) | BIT(0)); + if (tp->sfp_mode) + r8168_mac_ocp_modify(tp, 0xe040, BIT(1) | BIT(0), 0); + else + r8168_mac_ocp_modify(tp, 0xe040, 0, BIT(1) | BIT(0)); } static void rtl_rar_exgmac_set(struct rtl8169_private *tp, const u8 *addr) 2. the link is lost after a module reload or after an ip link down and up, the driver logs "Link is Down" and stays there until the cable is unplugged and re-plugged. This seems to be addressed by the code that was in rtl8127_sds_phy_reset(), re-adding that code fixes it: @@ -2477,6 +2480,13 @@ static void r8127_init_sfp_10g(struct rtl8169_private *tp) { int val; + RTL_W8(tp, 0x2350, RTL_R8(tp, 0x2350) & ~BIT(0)); + udelay(1); + + RTL_W16(tp, 0x233a, 0x801f); + RTL_W8(tp, 0x2350, RTL_R8(tp, 0x2350) | BIT(0)); + udelay(10); + RTL_W16(tp, 0x233a, 0x801a); RTL_W16(tp, 0x233e, (RTL_R16(tp, 0x233e) & ~0x3003) | 0x1000); Guess the phy needs a reset after all. With these two applied it seems to be working fine, tested suspend as well. Would you integrate these two or want to try me something different?