]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
spi: spi-fsl-dspi: Report FIFO overflows as errors
authorJames Clark <james.clark@linaro.org>
Tue, 2 Sep 2025 12:44:59 +0000 (13:44 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 3 Sep 2025 13:30:34 +0000 (14:30 +0100)
commit5cc49b5a36b32a2dba41441ea13b93fb5ea21cfd
treead2175bd23a99eb5b4ed1c32359d5cd5fb9aaaba
parent7d9baf1e530930e28b45805e3855a4a465a9e36e
spi: spi-fsl-dspi: Report FIFO overflows as errors

In target mode, the host sending more data than can be consumed would be
a common problem for any message exceeding the FIFO or DMA buffer size.
Cancel the whole message as soon as this condition is hit as the message
will be corrupted.

Only do this for target mode in a DMA transfer, it's not likely these
flags will be set in host mode so it's not worth adding extra checks. In
IRQ and polling modes we use the same transfer functions for hosts and
targets so the error flags always get checked. This is slightly
inconsistent but it's not worth doing the check conditionally because it
may catch some host programming errors in the future.

Signed-off-by: James Clark <james.clark@linaro.org>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Message-ID: <20250902-james-nxp-spi-dma-v6-7-f7aa2c5e56e2@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-fsl-dspi.c