[PATCH v4 1/3] i2c: xiic: preserve PEC byte length in SMBus block read setup

Andi Shyti andi.shyti at kernel.org
Mon Sep 21 01:43:32 PDT 2026


Hi Abdurraham,

...

>  		xiic_read_rx(i2c);
>  		if (xiic_rx_space(i2c) == 0) {
> +			/*
> +			 * If the setup path padded a short SMBus block read up
> +			 * to SMBUS_BLOCK_READ_MIN_LEN for the HW exit
> +			 * workaround, trim rx_msg->len back to the number of
> +			 * bytes that are actually valid so the SMBus core's
> +			 * PEC check reads the right index. Must happen before
> +			 * the rx_msg = NULL below.
> +			 */
> +			if (i2c->rx_msg && i2c->smbus_actual_len)
> +				i2c->rx_msg->len = i2c->smbus_actual_len;

We do need to reset smbus_actual_len at every xiic_start_recv(),
otherwise this would be true for every rx_msg. Right?

Andi

>  			/* this is the last part of the message */
>  			i2c->rx_msg = NULL;
>  
> 
> -- 
> 2.54.0
> 



More information about the linux-arm-kernel mailing list