Hi Marek,
> > 
> > > > > +
> > > > > +                     /* Check NAK here ? */
> > > > 
> > > > checking for the NAK at this point is really necessary.
> > > > 
> > > > I've tested the patches by writing to the EEPROM using the at24
> > > > driver.
> > > > If the data to write cross the EEPROM's page boundary then the at24
> > > > driver splits the I2C write commands.
> > > > 
> > > > After the first I2C write command is done the at24 driver immediately
> > > > tries
> > > > to send the next I2C write command. Normally the EEPROM signals a NAK,
> > > > because the previous write operation is internally still in progress.
> > > > The NAK will be handled by the at24 driver. It later retries the I2C
> > > > write command.
> > > > 
> > > > But if the the EEPROM signals a NAK and the I2C write command has more
> > > > than
> > > > 3 and less than 7 bytes then the error "PIO: Failed to finish WRITE
> > > > cmd!" appears, because the loop is not exited due to the NAK.
> > > 
> > > Ok, so we check
> > > 
> > > HW_I2C_STAT :: GOT_A_NAK bit at the end of the loop and if it's set, we
> > > "goto cleanup" with ret = -ENXIO . How does it sound to you?
> > 
> > this sounds good to me.
> 
> Does it fix your EEPROM issue then ?

yes, this fix solves the EEPROM issue. I have tested it.

Best regards
Torsten Fleischer
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to