From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 E2B3A275AF5 for ; Sat, 4 Apr 2026 22:37:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775342227; cv=none; b=f92aep9elCIuf3mRSkDlvgmjdi5BReaJAFSTonSKWtIpK8BfEgmI1FmwRNJJBjf3pXUAaJauUxISXD31hX1px4d4CVj4xrNvx3HhWwVXKL5dwSlQY8togRrA7Mv8Jd5oy/qapFyF8SOXRaW3HLlkiQkvRZJkrB9+JuynLB0sGvk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775342227; c=relaxed/simple; bh=IbKWs0FRRSyvt8BvPbylLQ7uiD2KK/uG0ITeQhiLXWg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DzNxJar3/jLI4UjIpWX389UZhenk+y0wvkY7DXpu2zITXrC71/mRFdxKYIGFsX9uxyqRcDh/VuK7FdTXpg1bLo8nM8cRvTg3WKPFO28LSYsl5Hjt29YJcIexq1WGTjEoYpOsceZbDga+1BFM40M41oNBZIrVSZvapftcwEMszkM= 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=gRNmZDeL; arc=none smtp.client-ip=209.85.128.43 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="gRNmZDeL" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4853c1ca73aso29380975e9.2 for ; Sat, 04 Apr 2026 15:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775342224; x=1775947024; 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=fY6Ig6Y0dfBXw64AbBiE+YxKcmOZephZVFw4+gdj224=; b=gRNmZDeLfIhktVKhAsVZhImq3bViFB7J3xtBC4/W9I3TUxsumGdKIHOEc+j22EbGnD v1loXf2iyDV2rD1t/HXZDRaQO1l4bfmlXsfwCo6YJZ9Tfv4RXPW1u6a/i5Eo3sIs906q jICmj1jpR+omHzwI5vMvXo6M93vaRGNLxw1Z1jWbpv7Ssx2mUDDa5HcAcbYppwS7z7V4 iDjO6oHVnsjYEIKmvCkJohQDHO022fbSkYdQike4lYmqOHnNlLBv84P9VF9cHkBReXoL sBMRRrfGMYVbRlCvP6a0Nshi4echXN70KEOcbpZbD2CvCilT2nvR4eQrEXAWYRgKPj+O +dhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775342224; x=1775947024; 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=fY6Ig6Y0dfBXw64AbBiE+YxKcmOZephZVFw4+gdj224=; b=pb80HBP8kmqr6lTDrYPTU+fH7KP2datmbJqp+6PTrP4l30X/TsH6fdidCi65Bk0evo aStHK1r2XEov6EBjncMxqMI+lEB/S1N/Z++/zQ2BFaWjxn1wFbbiq4gzbiAC7ucG/q/q iAinwDa5me4tKehV/PHuUiNTfb1rUoJY89SFbTYEqfU3sN1c5SEmVTtc/gqn3vwVeb2f gjxK3PUkQdFibBD683eUYT8c5iK8yRoW5puH5VfhzouCR5eiSBenG1LDYr+WGCzdwKJ5 DTi7qGe12UcvDWXuy8Rt7edOnxBT8pD8Z4nROSXc7gJnsCO11qkS6+r2axDWFxz2Zduv ahyw== X-Forwarded-Encrypted: i=1; AJvYcCVP7SZ4sX26eCvPhgyfaaeH0jVcgrneGzPaGffJUvr38LIxBRv1CpKm8n8kCnuASLlIlaKZp7ttiYx441A=@vger.kernel.org X-Gm-Message-State: AOJu0YyKC+JAXZoKrJ2CZ4wqvuqpyo6uGAuj7bPR8HTmSQZ+6F+pdpTY TheCSpeAth80xm/i12frsjbt2hQcUcxlIf0GCKukdv3PenSz4MzZkmdM X-Gm-Gg: AeBDieteyIxUBHy7Wp4QqDxHyT4Vrz2hOGLbFwE+NgmChxlpoahojFOP9pcwhUuqy0Y k6ZXQShvCPh93pTzEcuQWUKmON94xAFWQUQO8fE8pPRUXDS+H9tTF0oqPUOxnchLm9wShxh/x8K gix0R5B1f1L3fh+6GKEAnEy/ykr2muVdF1Odj4jm9GAarPvsCPSFRWTOoE3pHH/0ZKGlCmu+xYT tfjp2FCdY6S4zNLiy8LRnfxxkH3vu60GcI2KQJYFDuAxFrrXzgg709T7mzLdRJ8CQ1rhZPzZNsJ znRXbb1KsmjVUz4GaPv4cnYF0g5WiBtNCLh7UxLVZLVw6KjUohwo6FOMbk75DgwtfKz3Kpchuxq l19JhBwc8a0gtH2XYDN5fviBqdNdUW8o05xlDSwb/0GGPcEMmD7/g8nX/S2LdQGiNjVBneoZ3l7 UcVIVLF1T1KpXRhi0Qefai4oMKA5U= X-Received: by 2002:a05:600c:4593:b0:485:3b00:f93b with SMTP id 5b1f17b1804b1-488997e7b16mr126655695e9.31.1775342223961; Sat, 04 Apr 2026 15:37:03 -0700 (PDT) Received: from google.com ([37.228.206.31]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4888a72baa8sm232711105e9.15.2026.04.04.15.37.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Apr 2026 15:37:03 -0700 (PDT) Date: Sat, 4 Apr 2026 23:37:01 +0100 From: Fabio Baltieri To: Heiner Kallweit Cc: nic_swsd@realtek.com, Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King - ARM Linux , Andrew Lunn , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next v1] r8169: implement get_module functions for rtl8127atf Message-ID: References: <20260404201333.2849-1-fabio.baltieri@gmail.com> <4f8310c2-07be-452a-84fa-0ec87d985651@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: <4f8310c2-07be-452a-84fa-0ec87d985651@gmail.com> On Sat, Apr 04, 2026 at 11:55:25PM +0200, Heiner Kallweit wrote: > On 04.04.2026 22:13, Fabio Baltieri wrote: > > Implement get_module_info and get_module_eeprom for supported devices, > > right now that's the rtl8127atf. > > > > This enables using ethtool to retrieve the transceiver identification > > and diagnostic data. > > > > Signed-off-by: Fabio Baltieri > > --- > > > > Hi, > > > > Realtek released a new out of tree driver for the rtl8127 and it > > includes some code that exposes the I2C controller connected to the SFP > > port. > > > > This patch implements get_module_info and get_module_eeprom based on the > > information found on that driver, it allows ethtool to fetch the SFP > > module information, which is useful both to identify the module and to > > track the health of fiber optic transceivers. > > > > The logic for the SFF standard and i2c address selection is borrowed > > directly from the aquantia/atlantic driver, I don't have a lot of stuff > > to test it but I was able to trigger all code paths from a fiber optic > > transceiver and an SFP cable I have available. > > > > Hi Fabio, thanks for the patch. Being able to access the SFP I2C bus is an > important step towards future phylink/SFP support. > > @Russell/@Andrew > I'm not really familiar with the phylink and sfp code. And I would like to have > the functionality being implemented here reusable once we do further steps > towards phylink support in r8169. So how shall the code be modeled, which > components are needed? > - Shall the SFP I2C bus be modeled as a struct i2c_adapter? > - Shall we (partially?) implement a struct sfp, so that functions like > sfp_module_eeprom() can be used (implicitly)? Yeah happy to hear any input on it, the controller actually seems to be a designware IP and there is some reusable code for it but what I've seen done for other drivers for this functionality is to implement a minimum i2c "read bulk" functionality in the driver itself, so that's what I proposed here too, the code is fairly simple after all. However I did borrow some logic much verbatim from the atlantis driver as I mentioned, happy to hear if there's a path to reuse. > > I assume this patch includes logic which duplicates what is available in > phylink/sfp already. I'd a appreciate any hints you can provide. > > Thanks, Heiner