[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201011140948.GC4971@Mani-XPS-13-9360>
Date: Sun, 11 Oct 2020 19:39:48 +0530
From: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
To: Cristian Ciocaltea <cristian.ciocaltea@...il.com>
Cc: Andreas Färber <afaerber@...e.de>,
Wolfram Sang <wsa@...nel.org>, Peter Rosin <peda@...ntia.se>,
linux-i2c@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-actions@...ts.infradead.org
Subject: Re: [PATCH 1/3] i2c: owl: Clear NACK and BUS error bits
On Fri, Oct 09, 2020 at 12:44:39AM +0300, Cristian Ciocaltea wrote:
> When the NACK and BUS error bits are set by the hardware, the driver is
> responsible for clearing them by writing "1" into the corresponding
> status registers.
>
> Hence perform the necessary operations in owl_i2c_interrupt().
>
> Fixes: d211e62af466 ("i2c: Add Actions Semiconductor Owl family S900 I2C driver")
> Reported-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@...il.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Thanks,
Mani
> ---
> drivers/i2c/busses/i2c-owl.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/i2c/busses/i2c-owl.c b/drivers/i2c/busses/i2c-owl.c
> index 672f1f239bd6..a163b8f308c1 100644
> --- a/drivers/i2c/busses/i2c-owl.c
> +++ b/drivers/i2c/busses/i2c-owl.c
> @@ -176,6 +176,9 @@ static irqreturn_t owl_i2c_interrupt(int irq, void *_dev)
> fifostat = readl(i2c_dev->base + OWL_I2C_REG_FIFOSTAT);
> if (fifostat & OWL_I2C_FIFOSTAT_RNB) {
> i2c_dev->err = -ENXIO;
> + /* Clear NACK error bit by writing "1" */
> + owl_i2c_update_reg(i2c_dev->base + OWL_I2C_REG_FIFOSTAT,
> + OWL_I2C_FIFOSTAT_RNB, true);
> goto stop;
> }
>
> @@ -183,6 +186,9 @@ static irqreturn_t owl_i2c_interrupt(int irq, void *_dev)
> stat = readl(i2c_dev->base + OWL_I2C_REG_STAT);
> if (stat & OWL_I2C_STAT_BEB) {
> i2c_dev->err = -EIO;
> + /* Clear BUS error bit by writing "1" */
> + owl_i2c_update_reg(i2c_dev->base + OWL_I2C_REG_STAT,
> + OWL_I2C_STAT_BEB, true);
> goto stop;
> }
>
> --
> 2.28.0
>
Powered by blists - more mailing lists