diff options
| author | Abdurrahman Hussain <abdurrahman@nexthop.ai> | 2026-09-24 17:10:36 -0700 |
|---|---|---|
| committer | Andi Shyti <andi.shyti@kernel.org> | 2026-09-28 01:28:35 +0200 |
| commit | e6fe3ea04f0113fe4d47c03d76e03805a4768ca7 (patch) | |
| tree | ea4cf4bcfca8077624be0e841ded7dda45d2c1b8 /scripts/Makefile.debug | |
| parent | b7e6df2f52ed5c02838832f53c171a5645f9b376 (diff) | |
| download | linux-stable-e6fe3ea04f0113fe4d47c03d76e03805a4768ca7.tar.gz linux-stable-e6fe3ea04f0113fe4d47c03d76e03805a4768ca7.zip | |
i2c: xiic: defer RX_FULL until all trailing bytes are in FIFO
For the normal path of xiic_smbus_block_read_setup() -- the trailing
bytes all fit in one Rx FIFO fill -- RFD was programmed two below the
byte count, which fires the RX_FULL interrupt while the last byte is
still in flight. xiic_read_rx() then lands in its bytes_rem == 1 branch
and sets NACK on a byte still on the wire, truncating the read.
Without PEC this is harmless: the truncated byte is the dummy one the
caller never looks at. With PEC enabled it is the PEC byte itself, and
i2c_smbus_check_pec() fails the transfer with -EBADMSG.
Raise the threshold by one so RX_FULL fires only once every remaining
byte is already buffered. That routes the drain through
xiic_read_rx()'s bytes_rem == 0 path, which reads everything out and
emits the stop cleanly. The only change for the non-PEC case is that
the controller waits one extra byte-time before servicing the
interrupt.
rfd_set stays inside the 4 bits of XIIC_RFD_REG_OFFSET: this branch is
only reached when rxmsg_len + pec_len <= IIC_RX_FIFO_DEPTH, so the
value is at most IIC_RX_FIFO_DEPTH - 1.
Fixes: e4c1ff772e1a ("i2c: xiic: Add smbus_block_read functionality")
Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Cc: <stable@vger.kernel.org> # v6.3+
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://patch.msgid.link/20260924-i2c-xiic-v7-2-df7e752332ef@nexthop.ai
Diffstat (limited to 'scripts/Makefile.debug')
0 files changed, 0 insertions, 0 deletions
