[PATCH] i2c: xiic: NACK the last byte of an SMBus block read

Siddarth Chilukuri siddarth at nexthop.ai
Thu Oct 8 15:16:44 PDT 2026


On Thu, Oct 8, 2026 at 9:02 AM Abdurrahman Hussain
<abdurrahman at nexthop.ai> 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 at nexthop.ai>

Thanks,
Siddarth



More information about the linux-arm-kernel mailing list