[PATCH v3 0/2] mfd/spi: sprd: fix ADI transfer length handling

From: Weibin Liu

Date: Mon Oct 26 2026 - 11:39:26 EST


Thanks to Sashiko for reviewing v2.

v3 only rate-limits the two new invalid-length error messages in
patch 2. The exact transfer length checks and the SC27xx caller fix
are unchanged.

The separate, pre-existing issue about writing back an uninitialized
value after a failed ADI read is intentionally not included here. It
is independent of the transfer length fix and can be handled in a
separate patch.

The series was rebuilt with W=1 and retested in QEMU (aarch64 virt).
The length matrix and SC27xx software path remain unchanged. A burst
of 32 invalid reads and 32 invalid writes emitted only 10 messages at
each new driver call site. QEMU has no model of this hardware, and no
Spreadtrum hardware was available.

v2: https://lore.kernel.org/r/20261015-spi-sprd-adi-exactlen-v2-0-13203b6aef7e@xxxxxxxxxxxx

Changes in v3:
- Rate-limit invalid-length errors as suggested by Sashiko's review.

Signed-off-by: Weibin Liu <liuwb@xxxxxxxxxxxx>
---
drivers/mfd/sprd-sc27xx-spi.c | 2 +-
drivers/spi/spi-sprd-adi.c | 14 ++++++++++++++
2 files changed, 15 insertions(+), 1 deletion(-)