[PATCH v4] i2c: npcm: Add clock toggle recovery

Andi Shyti andi.shyti at kernel.org
Fri Apr 18 02:11:34 AEST 2025


Hi Mohammed,

...

> > > +                              npcm_i2c_get_SDA(&bus->adap), npcm_i2c_get_SCL(&bus->adap));
> > > +             if (npcm_i2c_recovery_tgclk(&bus->adap)) {
> > > +                     dev_err(bus->dev, "I2C%d init fail: SDA=%d SCL=%d\n",
> > > +                             bus->num, npcm_i2c_get_SDA(&bus->adap),
> > > +                             npcm_i2c_get_SCL(&bus->adap));
> > > +                     return -ENXIO;
> >
> > why don't we return the error coming from
> > npcm_i2c_recovery_tgclk() instead of forcing it to ENXIO?
> 
> The error that comes from the current driver is only -ENOTRECOVERABLE.
> I do not see why we cannot return that error instead. I understand the
> difference between both states; however, from the driver's
> perspective, on initialization, ENXIO and ENOTRECOVERABLE behavior is
> identical in that state.

I think it makes more sense to return the error we receive from
npcm_i2c_recovery_tgclk(). Then we can discuss whether that error
is correct or not, but that's a different topic.

> ENXIO was what the driver returned by default without trying to
> recover. Do you recommend changing it? Let me know. I am happy to send
> the v5 patch with the change and address the above comments, too.

Yes, please do.

Andi


More information about the openbmc mailing list