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] [day] [month] [year] [list]
Message-ID: <CAEnQRZAz_-S29L66a_ySxGAX-SKAeAvHfKqjanLsGNCZ7_zsAw@mail.gmail.com>
Date: Fri, 16 Jan 2026 11:27:58 +0200
From: Daniel Baluta <daniel.baluta@...il.com>
To: LI Qingwu <Qing-wu.Li@...ca-geosystems.com.cn>
Cc: o.rempel@...gutronix.de, kernel@...gutronix.de, andi.shyti@...nel.org, 
	shawnguo@...nel.org, s.hauer@...gutronix.de, festevam@...il.com, 
	linux-i2c@...r.kernel.org, imx@...ts.linux.dev, 
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, 
	bsp-development.geo@...ca-geosystems.com
Subject: Re: [PATCH V2 2/2] i2c: imx: add abort path for invalid block length

On Fri, Jan 16, 2026 at 11:19 AM LI Qingwu
<Qing-wu.Li@...ca-geosystems.com.cn> wrote:
>
> When a block read returns an invalid length (0 or >I2C_SMBUS_BLOCK_MAX),
> the current implementation leaves the bus hanging with SDA held low,
> blocking all further I2C communication on the bus.
>
> Add a dedicated IMX_I2C_STATE_READ_BLOCK_DATA_ABORT state and ISR
> handler to properly terminate the transfer when an invalid block length
> is detected:
>   - Set TXAK and receive the next byte with NACK
>   - On the following interrupt, generate a Stop condition
>   - Read and discard the final byte
>   - Report -EPROTO to the caller
>
> This ensures the bus is released correctly and allows other devices on
> the bus to continue operating normally.
>
> Tested on i.MX 8M Plus with continuous block read operations.
>
> Signed-off-by: LI Qingwu <Qing-wu.Li@...ca-geosystems.com.cn>
> ---
>  drivers/i2c/busses/i2c-imx.c | 55 ++++++++++++++++++++++++++++++++++--
>  1 file changed, 53 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
> index 85f554044cf1..71457dbffb7a 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -233,6 +233,7 @@ enum imx_i2c_state {
>         IMX_I2C_STATE_READ_CONTINUE,
>         IMX_I2C_STATE_READ_BLOCK_DATA,
>         IMX_I2C_STATE_READ_BLOCK_DATA_LEN,
> +       IMX_I2C_STATE_READ_BLOCK_DATA_ABORT

Please add the comma at the end of the last line so that we still have
nice diffs
next time we add an element at the end of the enum.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ