Re: [PATCH] i2c: xiic: NACK the last byte of an SMBus block read
From: Siddarth Chilukuri
Date: Thu Oct 08 2026 - 18:17:39 EST
On Thu, Oct 8, 2026 at 9:02 AM Abdurrahman Hussain
<abdurrahman@xxxxxxxxxx> wrote:
> + if (tail == 1) {
> + u8 cr = xiic_getreg8(i2c, XIIC_CR_REG_OFFSET);
> +
> + xiic_setreg8(i2c, XIIC_CR_REG_OFFSET,
> + cr | XIIC_CR_NO_ACK_MASK);
> + rfd_set = 0;
> + } else {
> + rfd_set = tail - 2;
> + }
Thanks for chasing this down!
Small nit: it looks like the tail == 1 branch can't be reached. The
padded branch above already takes 1 + rxmsg_len + pec_len <
SMBUS_BLOCK_READ_MIN_LEN (i.e. tail <= 1), so this else branch only
sees tail >= 2. It could just be:
rfd_set = rxmsg_len + pec_len - 2;
With that:
Reviewed-by: Siddarth Chilukuri <siddarth@xxxxxxxxxx>
Thanks,
Siddarth