From: Michal Simek <michal.simek@amd.com>
To: Shubhrajyoti Datta <shubhrajyoti.datta@gmail.com>, siddarth@nexthop.ai
Cc: Andi Shyti <andi.shyti@kernel.org>,
linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] i2c: xiic: don't fail a read whose data is already in the RX FIFO
Date: Mon, 2 Nov 2026 08:16:45 +0100 [thread overview]
Message-ID: <b61a304e-8fc9-44c0-ae6d-2e60af7be1fe@amd.com> (raw)
In-Reply-To: <CAKfKVtG4oCxJEvsQEDMxZSLbjSgzTxwMQ8Ky2Q9FtN3=6F+_rg@mail.gmail.com>
On 11/2/26 06:13, Shubhrajyoti Datta wrote:
> On Tue, Oct 6, 2026 at 12:21 AM Siddarth Chilukuri via B4 Relay
> <devnull+siddarth.nexthop.ai@kernel.org> wrote:
>>
>> From: Siddarth Chilukuri <siddarth@nexthop.ai>
>>
>> When the controller is the master receiver, TX_ERROR is set once the
>> core has NACKed the last byte ("transmit complete" in PG090). We have
>> seen xiic_process() run with TX_ERROR set but RX_FULL not yet set,
>> while the RX FIFO already holds all of the remaining bytes of the
>> message.
>>
>> xiic_process() treats TX_ERROR without RX_FULL as an error, so in this
>> case it reinitializes the core, the data in the FIFO is lost, and the
>> read returns -EIO even though it finished on the bus. The next read on
>> the same adapter can also return stale data without reporting an error.
>>
>> Fix this by checking the RX FIFO in the error path. If the message is
>> a read, there was no arbitration loss, and the FIFO has all of the
>> remaining bytes, handle it the same way as RX_FULL and complete the
>> message. Since IISR is toggle-on-write, only clear RX_FULL if it was
>> actually set.
>>
>> We found this on a system with several AXI IIC controllers in one PCIe
>> FPGA that share an interrupt. It only happens when at least two
>> controllers are busy at the same time. With 12 QSFP-DD modules being
>> read in parallel for 480 seconds, the failures went from 2083 -EIO and
>> 1158 reads with wrong data (out of 11.2M reads) to none.
>>
>> Fixes: e1d5b6598cdc ("i2c: Add support for Xilinx XPS IIC Bus Interface")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Siddarth Chilukuri <siddarth@nexthop.ai>
>> ---
> Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Thanks,
Michal
prev parent reply other threads:[~2026-11-02 7:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 18:50 Siddarth Chilukuri via B4 Relay
2026-10-20 18:41 ` Siddarth Chilukuri
2026-10-30 14:25 ` Michal Simek
2026-11-02 5:13 ` Shubhrajyoti Datta
2026-11-02 7:16 ` Michal Simek [this message]
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=b61a304e-8fc9-44c0-ae6d-2e60af7be1fe@amd.com \
--to=michal.simek@amd.com \
--cc=andi.shyti@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shubhrajyoti.datta@gmail.com \
--cc=siddarth@nexthop.ai \
--cc=stable@vger.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
all inboxes | Powered by JetHome®