Re: [PATCH net-next v4 1/2] net: phy: sfp: Add support for SMBus module access
From: Andrew Lunn
Date: Sat Mar 22 2025 - 11:29:18 EST
On Sat, Mar 22, 2025 at 08:57:44AM +0100, Maxime Chevallier wrote:
> The SFP module's eeprom and internals are accessible through an i2c bus.
>
> It is possible that the SFP might be connected to an SMBus-only
> controller, such as the one found in some PHY devices in the VSC85xx
> family.
>
> Introduce a set of sfp read/write ops that are going to be used if the
> i2c bus is only capable of doing smbus byte accesses.
>
> As Single-byte SMBus transaction go against SFF-8472 and breaks the
> atomicity for diagnostics data access, hwmon is disabled in the case
> of SMBus access.
>
> Moreover, as this may cause other instabilities, print a warning at
> probe time to indicate that the setup may be unreliable because of the
> hardware design.
>
> As hwmon may be disabled for both broken EEPROM and smbus, the warnings
> are udpated accordingly.
>
> Signed-off-by: Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx>
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
Andrew