Thread (6 messages) 6 messages, 2 authors, 5d ago

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

From: "Abdurrahman Hussain" <abdurrahman@nexthop.ai>
Date: 2026-09-24 01:44:37
Also in: linux-i2c, lkml, stable

On Wed Sep 23, 2026 at 11:04 AM PDT, Andi Shyti wrote:
quoted
+			/*
+			 * Undo the setup-time padding before rx_msg is cleared,
+			 * so the PEC check sees the right byte.
+			 */
+			if (i2c->rx_msg && i2c->smbus_actual_len)
+				i2c->rx_msg->len = i2c->smbus_actual_len;
I think this restore needs to go also in xiic_recv_atomic.

Andi
Yes. I2C_M_RECV_LEN forces standard mode for the whole transfer, so an
atomic block read hits the same padded branch and then completes in
xiic_recv_atomic() without the trim.

v6 pulls the trim into a xiic_smbus_trim_len() helper and calls it from
both sites that clear rx_msg. Patches 2 and 3 unchanged.

Abdurrahman
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help