On Tue, Nov 24, 2020 at 01:20:21AM +0100, Andrew Lunn wrote:
> > @@ -335,10 +336,19 @@ static int sfp_i2c_read(struct sfp *sfp, bool a2, u8 
> > dev_addr, void *buf,
> >                     size_t len)
> >  {
> >     struct i2c_msg msgs[2];
> > -   u8 bus_addr = a2 ? 0x51 : 0x50;
> > +   size_t block_size;
> >     size_t this_len;
> > +   u8 bus_addr;
> >     int ret;
> >  
> > +   if (a2) {
> > +           block_size = 16;
> > +           bus_addr = 0x51;
> 
> Hi Russell, Thomas
> 
> Does this man the diagnostic page can be read 16 bytes at a time, even
> when the other page has to be 1 bytes at a time? That seems rather
> odd. Or is the diagnostic page not implemented in these SFPs?

SFF8472 requires that multibyte values are read using sequential
reads. So we can't use single byte reads to read a multibyte value -
it's just not atomic.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

Reply via email to