Re: [PATCH v1 4/6] i2c: npcm: Handle spurious interrupts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jonathan:

Thank you for your comments.

Regards,
Tyrone

Jonathan Neuschäfer <j.neuschaefer@xxxxxxx> 於 2022年2月7日 週一 下午7:40寫道:
>
> Hello,
> some comments below.
>
> On Mon, Feb 07, 2022 at 02:33:36PM +0800, Tyrone Ting wrote:
> > From: Tali Perry <tali.perry1@xxxxxxxxx>
> >
> > In order to better handle spurious interrupts:
> > 1. Disable incoming interrupts in master only mode.
> > 2. Clear EOB after every interrupt.
>
> For those who rarely deal with this particular I2C controller, please
> add the meaning of EOB, e.g.: "2. Clear end of busy (EOB) after every interrupt"
>

Okay, it will be addressed.

> > 3. Return correct status during interrupt.
> >
> > Fixes: 56a1485b102e ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver")
> > Signed-off-by: Tali Perry <tali.perry1@xxxxxxxxx>
> > Signed-off-by: Tyrone Ting <kfting@xxxxxxxxxxx>
> > ---
> >  drivers/i2c/busses/i2c-npcm7xx.c | 96 +++++++++++++++++++++-----------
> >  1 file changed, 65 insertions(+), 31 deletions(-)
> >
> > diff --git a/drivers/i2c/busses/i2c-npcm7xx.c b/drivers/i2c/busses/i2c-npcm7xx.c
> > index 5c22e69afe34..1ddf309b91a3 100644
> > --- a/drivers/i2c/busses/i2c-npcm7xx.c
> > +++ b/drivers/i2c/busses/i2c-npcm7xx.c
> > @@ -360,14 +360,14 @@ static int npcm_i2c_get_SCL(struct i2c_adapter *_adap)
> >  {
> >       struct npcm_i2c *bus = container_of(_adap, struct npcm_i2c, adap);
> >
> > -     return !!(I2CCTL3_SCL_LVL & ioread32(bus->reg + NPCM_I2CCTL3));
> > +     return !!(I2CCTL3_SCL_LVL & ioread8(bus->reg + NPCM_I2CCTL3));
> >  }
> >
> >  static int npcm_i2c_get_SDA(struct i2c_adapter *_adap)
> >  {
> >       struct npcm_i2c *bus = container_of(_adap, struct npcm_i2c, adap);
> >
> > -     return !!(I2CCTL3_SDA_LVL & ioread32(bus->reg + NPCM_I2CCTL3));
> > +     return !!(I2CCTL3_SDA_LVL & ioread8(bus->reg + NPCM_I2CCTL3));
> >  }
>
> This change seems unrelated and isn't mentioned in the commit message.
> Please remove it or put it into a separate commit, or document the
> motivation in the commit message.
>

Okay, it will be addressed.

>
> >
> >  static inline u16 npcm_i2c_get_index(struct npcm_i2c *bus)
> > @@ -564,6 +564,15 @@ static inline void npcm_i2c_nack(struct npcm_i2c *bus)
> >       iowrite8(val, bus->reg + NPCM_I2CCTL1);
> >  }
> >
> > +static inline void npcm_i2c_clear_master_status(struct npcm_i2c *bus)
> > +{
> > +     u8 val;
> > +
> > +     /* Clear NEGACK, STASTR and BER bits */
> > +     val = NPCM_I2CST_BER | NPCM_I2CST_NEGACK | NPCM_I2CST_STASTR;
> > +     iowrite8(val, bus->reg + NPCM_I2CST);
>
> Small nitpick: Please keep the order the same between comment and code,
> e.g.:
>
>         /* Clear BER, NEGACK and STASTR bits */
>         val = NPCM_I2CST_BER | NPCM_I2CST_NEGACK | NPCM_I2CST_STASTR;
>
>
>
> Best regards,
> Jonathan
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEvHAHGBBjQPVy+qvDCDBEmo7zX9sFAmIBBP8ACgkQCDBEmo7z
X9srLw/9Fk0Dwv3OutJWngQjBucW7KWzadrpxsMsesyKne0BvaZUN7Dcw5Zsa9lz
vx9/xR8G/+KQNxcPFETqhHzCp9D2DLW/qTniAvocA+mACXPXRK7yA9+L2m8U58PS
QuKD1NVCtXXFziLr+4tT63xI13i28D8H9Jo1fTd+nPZgmnMeIFfNcDOeVOdNBV57
ovfJGZzFGSGR7RosMtknhf/vxIzLuu4lRqECrORFlGUVWi2pOghcElrdgY3g89CO
Fr7urdqkb7OHmGY+J9tvbIXC+fpA5W+LOlLq2C+x+qJf22T2MK9JwB9muY7DJov+
6ywzqUqQDbPVW5R7iXoN0VGXSvVdzwRV7xQm0L3gdQeiUNAkC6UkiCPtSgT9KAlm
sQCkTvSVUhP1Vo3u6jnp2kqnz8r7v8EgEdPQ0QkN2XS8lup1xlBnmXU95flzgJAj
asd1j5yB5sMkIomwugnMVZLpQaUVHEpls5ACaJXk5nmGWb3ymASO486n6d1U+BiW
EdaTohnLRD5NMXuJvtGIuCb6yZV2ggc5l1cHR/6deWp8Zre2CiJ7RELiIr5Blr1k
BfDLoS8ICOrADAfPaoVYVfhtHdjw+dicO67JA8XMIXG179Lzg7CY9yymvtk/HeA8
/hIA6sMn1M+PQLAn0HgKfo/fTaJ01CuljQYz7ud4JdKxkf+LTYY=
=/37B
-----END PGP SIGNATURE-----

[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux