[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200917140235.igfq2hq63f4qqhrr@pengutronix.de>
Date: Thu, 17 Sep 2020 16:02:35 +0200
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Christian Eggers <ceggers@...i.de>
Cc: Oleksij Rempel <linux@...pel-privat.de>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org,
NXP Linux Team <linux-imx@....com>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
linux-arm-kernel@...ts.infradead.org, linux-i2c@...r.kernel.org
Subject: Re: [PATCH 1/3] i2c: imx: Fix reset of I2SR_IAL flag
Hello,
On Thu, Sep 17, 2020 at 02:20:27PM +0200, Christian Eggers wrote:
> According to the "VFxxx Controller Reference Manual" (and the comment
> block starting at line 97), Vybrid requires writing a one for clearing
> an interrupt flag. Syncing with the method for clearing I2SR_IIF in
> i2c_imx_isr().
>
> Signed-off-by: Christian Eggers <ceggers@...i.de>
> Cc: stable@...r.kernel.org
> ---
> drivers/i2c/busses/i2c-imx.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index 0ab5381aa012..d8b2e632dd10 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -425,6 +425,7 @@ static int i2c_imx_bus_busy(struct imx_i2c_struct *i2c_imx, int for_busy, bool a
> /* check for arbitration lost */
> if (temp & I2SR_IAL) {
> temp &= ~I2SR_IAL;
> + temp |= (i2c_imx->hwdata->i2sr_clr_opcode & I2SR_IAL);
> imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2SR);
> return -EAGAIN;
This looks strange. First the flag is cleared and then it is (in some
cases) set again.
If I2SR_IIF is set in temp you ack this irq without handling it. (Which
might happen if atomic is set and irqs are off?!)
I see this idiom is used in a few more places in the driver already, I
didn't check but these might have the same problem maybe?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists