From: Andi Shyti <andi.shyti@kernel.org>
To: Abdurrahman Hussain <abdurrahman@nexthop.ai>
Cc: Michal Simek <michal.simek@amd.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Raviteja Narayanam <raviteja.narayanam@xilinx.com>,
Wolfram Sang <wsa@kernel.org>,
Manikanta Guntupalli <manikanta.guntupalli@amd.com>,
Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>,
linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH v5 1/3] i2c: xiic: preserve PEC byte length in SMBus block read setup
Date: Wed, 23 Sep 2026 20:04:36 +0200 [thread overview]
Message-ID: <arPW6xckt7QMpt7C@zenone.zhora.eu> (raw)
In-Reply-To: <20260921-i2c-xiic-v5-1-2fca81e810ea@nexthop.ai>
Hi Abdurraham,
On Mon, Sep 21, 2026 at 11:25:36AM -0700, Abdurrahman Hussain wrote:
> xiic_smbus_block_read_setup() recalculates i2c->rx_msg->len based on the
> length byte returned by the device, but historically clobbered the PEC
> byte expectation the SMBus core had baked into msg->len. That dropped
> the PEC byte from the caller's buffer on the normal and chunked
> receive-fifo branches.
...
> Fixes: e4c1ff772e1a ("i2c: xiic: Add smbus_block_read functionality")
yes, I think the Fixes tag was needed here.
> Cc: stable@vger.kernel.org
> Acked-by: Michal Simek <michal.simek@amd.com>
> Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai>
...
> + /*
> + * 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
> +
> /* this is the last part of the message */
> i2c->rx_msg = NULL;
next prev parent reply other threads:[~2026-09-23 18:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-21 18:25 [PATCH v5 0/3] i2c: xiic: fix SMBus block read and PEC support Abdurrahman Hussain
2026-09-21 18:25 ` [PATCH v5 1/3] i2c: xiic: preserve PEC byte length in SMBus block read setup Abdurrahman Hussain
2026-09-23 18:04 ` Andi Shyti [this message]
2026-09-24 1:44 ` Abdurrahman Hussain
2026-09-21 18:25 ` [PATCH v5 2/3] i2c: xiic: defer RX_FULL until all trailing bytes are in FIFO Abdurrahman Hussain
2026-09-21 18:25 ` [PATCH v5 3/3] i2c: xiic: don't clobber msg->len to signal block-read completion Abdurrahman Hussain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=arPW6xckt7QMpt7C@zenone.zhora.eu \
--to=andi.shyti@kernel.org \
--cc=abdurrahman@nexthop.ai \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manikanta.guntupalli@amd.com \
--cc=michal.simek@amd.com \
--cc=raviteja.narayanam@xilinx.com \
--cc=shubhrajyoti.datta@amd.com \
--cc=stable@vger.kernel.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox