Re: [PATCH net-next v2 1/2] net: phy: sfp: Add support for SMBus module access
From: Russell King (Oracle)
Date: Tue Feb 25 2025 - 13:12:19 EST
On Tue, Feb 25, 2025 at 02:56:17PM +0100, Maxime Chevallier wrote:
> > > + while (len) {
> > > + ret = i2c_smbus_xfer(sfp->i2c, bus_addr, 0,
> > > + I2C_SMBUS_READ, dev_addr,
> > > + I2C_SMBUS_BYTE_DATA, &smbus_data);
> > > + if (ret < 0)
> > > + return ret;
> >
> > Isn't this the wrong order? You should do the upper byte first, then
> > the lower?
>
> You might be correct. As I have been running that code out-of-tree for
> a while, I was thinking that surely I'd have noticed if this was
> wrong, however there are only a few cases where we actually write to
> SFP :
>
> - sfp_modify_u8(...) => one-byte write
> - in sfp_cotsworks_fixup_check(...) there are 2 writes : one 1-byte
> write and a 3-bytes write.
>
> As I don't have any cotsworks SFP, then it looks like having the writes
> mis-ordered would have stayed un-noticed on my side as I only
> stressed the 1 byte write path...
This Cotsworks module is not a SFP. It's a solder-on SFF module.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!