From: "M, Krishnamoorthi" <krishnamoorthi.m@amd.com>
To: Weibin Liu <liuwb@xiaopeng.com>,
broonie@kernel.org, linux-spi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, zhugl3@xiaopeng.com
Subject: Re: [PATCH] spi: amd: validate FIFO usage before executing message
Date: Wed, 28 Oct 2026 17:52:53 +0530 [thread overview]
Message-ID: <9a6499bf-7a72-4f43-81ab-626e2b83b7e3@amd.com> (raw)
In-Reply-To: <20261027021340.914399-1-liuwb@xiaopeng.com>
Hi,
On 10/27/2026 7:43 AM, Weibin Liu wrote:
> The RX FIFO bound is checked in the drain loop, after
> amd_spi_execute_opcode(). A message whose cumulative RX length exceeds
> AMD_SPI_FIFO_SIZE can therefore issue an SPI transaction before being
> rejected.
>
> Check tx_len + rx_len while walking the message and drop the drain-loop
> check. This validates the complete message before executing the command.
>
> Tested with a user-space replica covering TX, RX and mixed messages at
> the 70/71-byte boundary. Oversized split-RX messages are now rejected
> without executing the command. No AMD SPI hardware was available.
>
> Assisted-by: LLM
> Suggested-by: Krishnamoorthi M <krishnamoorthi.m@amd.com>
> Fixes: e2f4edfc061e ("spi: amd: fix len==0 underflow and FIFO overflow")
> Reviewed-by: Guanglei Zhu <zhugl3@xiaopeng.com>
> Signed-off-by: Weibin Liu <liuwb@xiaopeng.com>
Thanks, patch looks good to me:
Reviewed-by: Krishnamoorthi M <krishnamoorthi.m@amd.com>
Regards,
Krishna
prev parent reply other threads:[~2026-10-28 12:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 2:13 Weibin Liu
2026-10-28 12:22 ` M, Krishnamoorthi [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=9a6499bf-7a72-4f43-81ab-626e2b83b7e3@amd.com \
--to=krishnamoorthi.m@amd.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=liuwb@xiaopeng.com \
--cc=zhugl3@xiaopeng.com \
/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®