Linux SPI subsystem development
 help / color / mirror / Atom feed
From: Joseph CT Chan <jctchan@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, David Lechner <dlechner@baylibre.com>,
	Bart Van Assche <bvanassche@acm.org>,
	Joseph CT Chan <josephctchan@google.com>
Subject: [PATCH v2 0/2] spi: spi-ti-qspi: finalize message on transfer error
Date: Tue,  3 Nov 2026 22:51:14 +0000	[thread overview]
Message-ID: <20261103225116.3624270-1-jctchan@gmail.com> (raw)

From: Joseph CT Chan <josephctchan@google.com>

Hi Mark,

When a transfer fails in ti_qspi_start_transfer_one(), for example on a
write completion timeout, the driver returns without finalizing the
message and without writing QSPI_INVAL to end the frame. A queued
caller then waits forever, and a spi_sync() that took the no-queue path
gets -EINPROGRESS instead of the error. Patch 1 sends the error through
the existing exit path, which ends the frame, sets the status and
finalizes the message. Patch 2 adds a KUnit test that emulates the
controller registers with logic_iomem on ARCH=um.

Tested with KUnit on ARCH=um: ti_qspi_test passes with patch 1 and
fails without it. Not tested on hardware.

Changes in v2:
- Split out of the v1 14-patch series, as David suggested.
- Patch 2: trimmed the comments in the test.
- Moved the AI assistance note from an Assisted-by tag into the commit message.

v1: https://lore.kernel.org/all/20261102163023.2574632-1-jctchan@gmail.com/

This series depends on the SPI core series ("spi: unoptimize message
when queuing it fails" v2), which adds drivers/spi/tests/.kunitconfig
and the KUnit Makefile lines that patch 2 extends. Patch 1 applies on
its own.

SPI core series v2: https://lore.kernel.org/linux-spi/20261103224753.3610049-1-jctchan@gmail.com/

Please consider this patch series for the next merge window.

Thanks,
Joseph

Joseph CT Chan (2):
  spi: spi-ti-qspi: finalize message on transfer error
  spi: spi-ti-qspi: add KUnit tests for transfer error finalization

 drivers/spi/Kconfig                   |  12 ++
 drivers/spi/Makefile                  |   1 +
 drivers/spi/spi-ti-qspi.c             |   4 +-
 drivers/spi/tests/.kunitconfig        |   4 +
 drivers/spi/tests/Makefile            |   1 +
 drivers/spi/tests/spi-ti-qspi-kunit.c | 188 ++++++++++++++++++++++++++
 6 files changed, 208 insertions(+), 2 deletions(-)
 create mode 100644 drivers/spi/tests/spi-ti-qspi-kunit.c


base-commit: c339f4010dea8b0d754f84ace70cd1b089878ef8
prerequisite-patch-id: 6999a3baa2d32de8fa42f2626a845fe3cb63b0b2
prerequisite-patch-id: 686a62b9223209bf1e83740a0874e20d7607f69a
-- 
2.56.0.385.gac671c819a-goog


             reply	other threads:[~2026-11-03 22:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-03 22:51 Joseph CT Chan [this message]
2026-11-03 22:51 ` [PATCH v2 1/2] spi: spi-ti-qspi: finalize message on transfer error Joseph CT Chan
2026-11-03 22:51 ` [PATCH v2 2/2] spi: spi-ti-qspi: add KUnit tests for transfer error finalization Joseph CT Chan

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=20261103225116.3624270-1-jctchan@gmail.com \
    --to=jctchan@gmail.com \
    --cc=broonie@kernel.org \
    --cc=bvanassche@acm.org \
    --cc=dlechner@baylibre.com \
    --cc=josephctchan@google.com \
    --cc=linux-spi@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