From nobody Wed Jun 17 05:14:12 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4C1E1E1C11; Tue, 28 Apr 2026 00:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777335490; cv=none; b=NEGgLpY0gBehVJI088iCvUwqXj4Gp+Wql7LzuKZ5WbKnaeYrXf0sFp3TzvX1oaM5oXTOaB1wc5EvC+nGfDmBvf8dMc+5lKHCErciZzBvZz4CibWL6MsHdXo+TcPyg2IT0F+Dum7APF7PPxj4I3QAp+lqXC4yotA752Ikh2r/FHk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777335490; c=relaxed/simple; bh=pX6+8HgPg+/75SzAsHB9znme86Aih5ZL9FPNk75ERIc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aB2nkYX50YLbBY+0CGXU25GiugLUjCFUE2BqYKY2MKtoPLDx1g7/vv+Dok2RRDCR20tLxHaVf3BpzfRRYge/uluaks5KF6iyD3HeepcyHo/551h6jiup7OrgJf0QomYLebDJrkhYhlHDh+b378w+1GtlXMmwIl6uyLGfxfrwQ2o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FTZO1ACo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FTZO1ACo" Received: by smtp.kernel.org (Postfix) with ESMTPS id 64E53C2BCB7; Tue, 28 Apr 2026 00:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777335490; bh=pX6+8HgPg+/75SzAsHB9znme86Aih5ZL9FPNk75ERIc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=FTZO1ACond1QyuWms2yeUh6w2WvZrK/37C6xfPBDNsQn/yZ915BFqTI8hSl3MyPGq 7UX62Cia71C7Hk91H6CuY0lNqX1S03nNgzqrDhRmTD7DsbAHuzpBreCfS5DkivpPhA y3OARf6rlex1UMgYomJpBEHx3TkleSjfc8GIledGH+uw5M/SQZJxAbKs/ljFKtG0qk UoYiS0Xww6ECLlYUY3XvIm6h3j5mgL9Nl3VZL1AykUCKyWJfVFT9UDXHXKZSFpABXC 1QtFsceu0F9Bd6Ok2uP0Zh+wgeECWmay9hU6lc6NtVaWqTLhno4vMzNTrVOd10sLut umrHOd78wosHw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 524F9FF8867; Tue, 28 Apr 2026 00:18:10 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 27 Apr 2026 17:18:06 -0700 Subject: [PATCH 1/3] i2c: xiic: preserve PEC byte length in SMBus block read setup Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260427-i2c-xiic-v1-1-e6207f9aa5ad@nexthop.ai> References: <20260427-i2c-xiic-v1-0-e6207f9aa5ad@nexthop.ai> In-Reply-To: <20260427-i2c-xiic-v1-0-e6207f9aa5ad@nexthop.ai> To: Michal Simek , Andi Shyti Cc: linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2279; i=abdurrahman@nexthop.ai; h=from:subject:message-id; bh=WbRNSgR6fF75ujIFRpZT+WIk0CWNPjAlMacuue3U6KE=; b=owJ4nJvAy8zAJbYltPXv6rsCXxhPqyUxZL7/c3B1ziaWhgZtFrFK/7l1X/ruSL6cYMDSVjL1j c2+ms//ngV2lLIwiHExyIopssx55P+mraMtYkPMIXuYOaxMIEMYuDgFYCJT7jAydHBtfsJ7Ujyo QjBN2L0pu0lRwTj1x/cph3/Ku6i+WVcWz/BPQZ3xXJja3qblId0ujyKkJq17U3jguKjB1QquM6I zzQ/zAgDNJ07Z X-Developer-Key: i=abdurrahman@nexthop.ai; a=openpgp; fpr=9CE24FEC86888658B05CC23FB45585FDABDD10F4 X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/default with auth_id=756 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain xiic_smbus_block_read_setup() overwrites rx_msg->len based on the announced block length byte, but the i2c core appends an extra byte to msg->len when PEC is enabled on the client (see __i2c_smbus_xfer_emulated in i2c-core-smbus.c). Before this handler runs, rx_msg->len is therefore 1 + pec_len, where pec_len is 0 or 1. Overwriting rx_msg->len to rxmsg_len + 1 drops that PEC byte from the caller's buffer: the PEC byte is never drained from the FIFO and the core's i2c_smbus_check_pec() reads the last payload byte instead of the actual PEC, returning -EBADMSG even on clean transfers. Capture pec_len before the overwrite and add it back when recomputing rx_msg->len. This is a pure bug fix; non-PEC behaviour is unchanged (pec_len =3D=3D 0). Tested on a Xilinx AXI IIC FPGA block driving an adm1266 PMBus blackbox read -- with PEC enabled the full 64-byte record transfers cleanly after this change. Signed-off-by: Abdurrahman Hussain Acked-by: Michal Simek Reviewed-by: Shubhrajyoti Datta --- drivers/i2c/busses/i2c-xiic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 3e7735e1dae0..959a47b645a5 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -539,6 +539,8 @@ static void xiic_smbus_block_read_setup(struct xiic_i2c= *i2c) =20 /* Check if received length is valid */ if (rxmsg_len <=3D I2C_SMBUS_BLOCK_MAX) { + unsigned int pec_len =3D i2c->rx_msg->len - 1; + /* Set Receive fifo depth */ if (rxmsg_len > IIC_RX_FIFO_DEPTH) { /* @@ -546,7 +548,7 @@ static void xiic_smbus_block_read_setup(struct xiic_i2c= *i2c) * Receive fifo depth should set to Rx fifo capacity minus 1 */ rfd_set =3D IIC_RX_FIFO_DEPTH - 1; - i2c->rx_msg->len =3D rxmsg_len + 1; + i2c->rx_msg->len =3D rxmsg_len + 1 + pec_len; } else if ((rxmsg_len =3D=3D 1) || (rxmsg_len =3D=3D 0)) { /* @@ -562,7 +564,7 @@ static void xiic_smbus_block_read_setup(struct xiic_i2c= *i2c) * Receive fifo depth should set to Rx msg len minus 2 */ rfd_set =3D rxmsg_len - 2; - i2c->rx_msg->len =3D rxmsg_len + 1; + i2c->rx_msg->len =3D rxmsg_len + 1 + pec_len; } xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, rfd_set); =20 --=20 2.53.0 From nobody Wed Jun 17 05:14:12 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4CE61E9B35; Tue, 28 Apr 2026 00:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777335490; cv=none; b=eG0II+gPdbKtVAG55AKQY3B5xz/sTfd1LkK5mTt8+1HLzZamo7qseFUZ2x2+P57wM33L1uIoK4LiurSiAiqI9sbtoPNK0EP33OU0DqFxLmoFqoZ17B86D1nfzJYeVNAEaAYxeAG4qm/WmTsVYRVU1soOawysPvgfVFLtNz3wN6M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777335490; c=relaxed/simple; bh=d+UqHWNaoYjdpV1iYpCW920gidcbWxrsiy5vMFkmcMQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SFhGHr5p30pSlD05+mq+xRnUfagCjmwhIgOLlpaTJ6O46Lwh2/NRdaJMJ82rL3M0anuE+lRiOl4r8kxUoGLc8z9A3lLCsq76aEwUCYae088oyVaB+wVYz5RLdbbKJqCpYxkFMAiMLINtobF5wjAPaP5rwVOkbAvuhUFL8SSmkA4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lLFNUe3b; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lLFNUe3b" Received: by smtp.kernel.org (Postfix) with ESMTPS id 6E450C2BCB4; Tue, 28 Apr 2026 00:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777335490; bh=d+UqHWNaoYjdpV1iYpCW920gidcbWxrsiy5vMFkmcMQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=lLFNUe3bSNg/1uCqlXTdkE/mAURCsQ0gFP2NkN6gwGhvqAVgokLWkvRVWQB5JNpvx fjWBef9v1Li2V961/m5TG99K4BdL+VT/UKBcr8IKSVOmXuPk+8CVNmDk3K+i+ldWva UjoU9GICSwSCbRbC7bwfkihJ0RcmfI9eKAVeVMF3JI4FmaKv2c9uMqfn/WaNnngSH4 DRMPmdjIWGPXmEQsypkkCxd0STmBFUvRG3d+ZU6VcTG/zdjEwqCBTeqk5wdnPgU62p NNa2kELd0vCK+khH/t9ICpNPO1CDb9alxf2LDrZXzs89Y3EwGTfNV4KwGemvRomJ3z +TSm+ay0M/lOw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 60D85FF8870; Tue, 28 Apr 2026 00:18:10 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 27 Apr 2026 17:18:07 -0700 Subject: [PATCH 2/3] i2c: xiic: defer RX_FULL until all trailing bytes are in FIFO Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260427-i2c-xiic-v1-2-e6207f9aa5ad@nexthop.ai> References: <20260427-i2c-xiic-v1-0-e6207f9aa5ad@nexthop.ai> In-Reply-To: <20260427-i2c-xiic-v1-0-e6207f9aa5ad@nexthop.ai> To: Michal Simek , Andi Shyti Cc: linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1720; i=abdurrahman@nexthop.ai; h=from:subject:message-id; bh=/BR++2xUka9oKwbdfFmIjG9WrhZsf5+FmlIpH4Pjs/c=; b=owJ4nJvAy8zAJbYltPXv6rsCXxhPqyUxZL7/c5Dl1rVsxY3/f5udq7z6ZWXx1n2lu9jToncwV nQ8kNa6vuJvRykLgxgXg6yYIsucR/5v2jraIjbEHLKHmcPKBDKEgYtTACbCacjIcIOLUWjar5tb n+Tu97xhFckYv8L3SMvfx/KTDnMU3Em03cHIsOGUcENQ5t4lVzP5PCTOxCUzhAVOOVD/xHJyg4d ObZ81KwAG1lBj X-Developer-Key: i=abdurrahman@nexthop.ai; a=openpgp; fpr=9CE24FEC86888658B05CC23FB45585FDABDD10F4 X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/default with auth_id=756 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain For the normal path of xiic_smbus_block_read_setup() (rxmsg_len less than IIC_RX_FIFO_DEPTH), RFD was programmed to rxmsg_len - 2, which fires the RX_FULL interrupt while the last payload byte is still in flight. xiic_read_rx()'s bytes_rem =3D=3D 1 branch then sets NACK on that byte still on the wire, truncating the read in the PEC-enabled case. Raise the threshold so RX_FULL fires only once every remaining byte (payload plus optional PEC) is already buffered in the FIFO. That routes the drain through xiic_read_rx()'s bytes_rem =3D=3D 0 path, which reads everything out and emits the stop cleanly. For the non-PEC path the full payload is still read out through the same bytes_rem =3D=3D 0 branch; the only user-visible change is that the controller waits one extra byte-time before servicing the interrupt. Signed-off-by: Abdurrahman Hussain Acked-by: Michal Simek Reviewed-by: Shubhrajyoti Datta --- drivers/i2c/busses/i2c-xiic.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 959a47b645a5..946e3ed2d760 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -559,11 +559,8 @@ static void xiic_smbus_block_read_setup(struct xiic_i2= c *i2c) rfd_set =3D 0; i2c->rx_msg->len =3D SMBUS_BLOCK_READ_MIN_LEN; } else { - /* - * When Rx msg len less than Rx fifo capacity - * Receive fifo depth should set to Rx msg len minus 2 - */ - rfd_set =3D rxmsg_len - 2; + /* Defer RX_FULL until all trailing bytes are in FIFO. */ + rfd_set =3D rxmsg_len + pec_len - 1; i2c->rx_msg->len =3D rxmsg_len + 1 + pec_len; } xiic_setreg8(i2c, XIIC_RFD_REG_OFFSET, rfd_set); --=20 2.53.0 From nobody Wed Jun 17 05:14:12 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4BC117B505; Tue, 28 Apr 2026 00:18:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777335490; cv=none; b=L5lHlQ4kzB6MuKYUZu6oOl6w3M8k+aETDbgtHZwvS6c6u5FUkgKX78lTLiMDaAC7HpRTo4R8pNGu+6khvcdo2ytgFkskRF73fak17zCxYU4eOKdxqP3AzNV/Gevabb1CvJ93oe/GnglSrDRLcqLeLgwoIoHGXJ2k+u70joM4cl8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777335490; c=relaxed/simple; bh=socDHfUvQqpc9gwIt9f18GJimPy7QixuJ0SteirtT0o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iGmR9fHUm16OzjHvgE92STiH87YcnDk19XDGd2TgNU/VqfEF4ahfc98sm9tX8RhIAVsWj7k7O+/y8gj16X9F0tPcUpVFCcilIewkjaFhNTMlDB52WjzYXg8R3NvUC3ERE70P6i+RTzDC01n/KXyQLbzWRnRvtjYP3M/FM9Xi9Yg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oW+MLxvp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oW+MLxvp" Received: by smtp.kernel.org (Postfix) with ESMTPS id 7C9FDC2BCC4; Tue, 28 Apr 2026 00:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777335490; bh=socDHfUvQqpc9gwIt9f18GJimPy7QixuJ0SteirtT0o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=oW+MLxvpS4tM91Fej4aIsS9mAPEi0PcRTJu5CH+oCKIaAfH9IIFPdT6p6k19DPPgG B3LLM/5JRKhLaT6XUuicL3Vg/Xl4GAxBYmkSJAKQh4RbXq31FKPU3yl2bVmLujLEu/ i3erW4YmZsTV3pcSz+Z31L7BUAtyvIFSyjbI7aa6rvNsUt32u1WmKeoc4K5qgUdnkJ /EtAamfuFYMYxZ0IOTALVrxMVV+bP4o8dZC0AdFPlFv7+atxm9LYb2ffw49tj2CF4p wkER2m0yN+qdHhzD7Hj0j2xM+bM4VwczQcvUafhX5ORVx+evuErR+oVwP4TKgcRuuQ oPokcYzNBwGvg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EDFAFF8864; Tue, 28 Apr 2026 00:18:10 +0000 (UTC) From: Abdurrahman Hussain via B4 Relay Date: Mon, 27 Apr 2026 17:18:08 -0700 Subject: [PATCH 3/3] i2c: xiic: don't clobber msg->len to signal block-read completion Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260427-i2c-xiic-v1-3-e6207f9aa5ad@nexthop.ai> References: <20260427-i2c-xiic-v1-0-e6207f9aa5ad@nexthop.ai> In-Reply-To: <20260427-i2c-xiic-v1-0-e6207f9aa5ad@nexthop.ai> To: Michal Simek , Andi Shyti Cc: linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Abdurrahman Hussain X-Mailer: b4 0.15.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1863; i=abdurrahman@nexthop.ai; h=from:subject:message-id; bh=OktgHJV/MKY6BGPhmYAbpjHL8E9xIEfPx0WNo7EeXKg=; b=owJ4nJvAy8zAJbYltPXv6rsCXxhPqyUxZL7/c1D+/YWV3ude8c44uo171kVreYnc4A9ndzgYc 5v1WZ2R7P3SUcrCIMbFICumyDLnkf+bto62iA0xh+xh5rAygQxh4OIUgImUhDIy/OkTW7nm6/x5 1+NvPnzWVc+QrPBm6t+rbz7kn9jLVvuo14uRYXtA04SNf9iNs+V+fn4mfn3LJqP/D0ptNn9M092 1Lc5uBxsA3YtVpw== X-Developer-Key: i=abdurrahman@nexthop.ai; a=openpgp; fpr=9CE24FEC86888658B05CC23FB45585FDABDD10F4 X-Endpoint-Received: by B4 Relay for abdurrahman@nexthop.ai/default with auth_id=756 X-Original-From: Abdurrahman Hussain Reply-To: abdurrahman@nexthop.ai From: Abdurrahman Hussain At the end of a SMBus block read the BNB handler force-set tx_msg->len =3D 1 to push xiic_tx_space() to zero so the STATE_DONE branch would fire. Two problems: 1. tx_msg and rx_msg alias the same i2c_msg struct during a receive (see xiic_start_recv), so overwriting tx_msg->len also changes rx_msg->len. The i2c core's i2c_smbus_check_pec() then reads the PEC from the wrong offset -- buf[0] instead of buf[rxmsg_len + 1] -- and either mis-validates or returns -EBADMSG. 2. xiic_start_recv sets tx_pos =3D msg->len (typically 2 when PEC is enabled). xiic_tx_space() is unsigned msg->len - tx_pos, so setting msg->len =3D 1 with tx_pos =3D 2 underflows to 0xFFFFFFFF and xiic_tx_space() never compares equal to 0 -- the STATE_DONE check falls through to STATE_ERROR, giving -EIO. Instead, advance tx_pos up to msg->len. That drives tx_space to 0 without touching msg->len, preserving the buffer length that xiic_smbus_block_read_setup() already grew to cover the length byte, the payload and the optional PEC byte. Signed-off-by: Abdurrahman Hussain Acked-by: Michal Simek Reviewed-by: Shubhrajyoti Datta --- drivers/i2c/busses/i2c-xiic.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 946e3ed2d760..27715646a9fb 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c @@ -864,8 +864,11 @@ static irqreturn_t xiic_process(int irq, void *dev_id) =20 if (i2c->tx_msg && i2c->smbus_block_read) { i2c->smbus_block_read =3D false; - /* Set requested message len=3D1 to indicate STATE_DONE */ - i2c->tx_msg->len =3D 1; + /* + * Drive xiic_tx_space() to 0 to signal STATE_DONE + * without truncating the rx_msg length. + */ + i2c->tx_pos =3D i2c->tx_msg->len; } =20 if (!i2c->tx_msg) --=20 2.53.0