lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 8 Feb 2022 17:19:58 +0800
From:   warp5tw <warp5tw@...il.com>
To:     Jonathan Neuschäfer <j.neuschaefer@....net>
Cc:     avifishman70@...il.com, tmaimon77@...il.com, tali.perry1@...il.com,
        venture@...gle.com, yuenn@...gle.com, benjaminfair@...gle.com,
        robh+dt@...nel.org, krzysztof.kozlowski@...onical.com,
        semen.protsenko@...aro.org, yangyicong@...ilicon.com,
        wsa@...nel.org, sven@...npeter.dev, bence98@....bme.hu,
        lukas.bulwahn@...il.com, arnd@...db.de, olof@...om.net,
        andriy.shevchenko@...ux.intel.com, tali.perry@...oton.com,
        Avi.Fishman@...oton.com, tomer.maimon@...oton.com,
        KWLIU@...oton.com, JJLIU0@...oton.com, kfting@...oton.com,
        devicetree@...r.kernel.org, openbmc@...ts.ozlabs.org,
        linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v1 4/6] i2c: npcm: Handle spurious interrupts

Hi Jonathan:

Thank you for your comments.

Regards,
Tyrone

Jonathan Neuschäfer <j.neuschaefer@....net> 於 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@...il.com>
> >
> > 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@...il.com>
> > Signed-off-by: Tyrone Ting <kfting@...oton.com>
> > ---
> >  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

View attachment "signature.asc" of type "text/plain" (849 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ