[PATCH v2 0/3] spi: Better specification for rx-sample-delay-ns and core parsing

Frieder Schrempf posted 3 patches 3 days, 8 hours ago
.../devicetree/bindings/spi/spi-peripheral-props.yaml       |  8 ++++++++
drivers/spi/spi-dw-core.c                                   | 13 +++++++------
drivers/spi/spi.c                                           |  9 +++++++++
include/linux/spi/spi.h                                     |  9 +++++++++
4 files changed, 33 insertions(+), 6 deletions(-)
[PATCH v2 0/3] spi: Better specification for rx-sample-delay-ns and core parsing
Posted by Frieder Schrempf 3 days, 8 hours ago
"rx-sample-delay-ns" has been a generic SPI peripheral property since it
was moved to spi-peripheral-props.yaml, but the core has never looked at
it, and what it is meant to describe has become blurred along the way.

It was introduced in 2015 for Rockchip, to compensate "boards with
high-capacitance SPI lines". The wording now in the generic schema came
later, from a description of a DesignWare register, and lost its
controller-specific qualifier on the way. It says what the value does to
the controller, but not what a board should measure to arrive at it.

Patch 1 says what the property describes. Patch 2 parses it in the core,
so that a controller driver can act on it without open-coding the
property name, and patch 3 converts spi-dw, its only user that reads it
from the peripheral node as the binding intends.

Deliberately not converted: spi-rockchip and spi-mtk-snfi read
"rx-sample-delay-ns" from the *controller* node rather than the
peripheral node, which contradicts the binding but is what their device
trees rely on. Converting them would break those boards, so they keep
their private parsing. The controller-wide default that spi-dw reads
from its own node is left in place for the same reason - it lives in a
different node, which is not what the core parses when it looks at a
peripheral.

This is groundwork for letting SPI devices declare their datasheet
clock-to-output-valid time so that controllers can move their sampling
point instead of forcing a lower spi-max-frequency, posted as an RFC at

  https://lore.kernel.org/r/20260303-fsl-qspi-rx-sampling-delay-v1-0-9326bbc492d6@kontron.de

Nothing in that work is needed to read this series, and nothing here
depends on it: the chip side is a separate quantity that composes with
this one, which is why patch 1 spends a paragraph on keeping them apart.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
---
Changes in v2:
- Fix the bindings patch subject prefix
- Improve commit message for patch 3
- Link to v1: https://patch.msgid.link/20260917-spi-sample-delay-cleanup-v1-0-0e4eddbfb1ce@kontron.de

---
Frieder Schrempf (3):
      spi: dt-bindings: Clarify what rx-sample-delay-ns describes
      spi: Parse the rx-sample-delay-ns peripheral property in the core
      spi: dw: Use the rx-sample-delay-ns value parsed by the core

 .../devicetree/bindings/spi/spi-peripheral-props.yaml       |  8 ++++++++
 drivers/spi/spi-dw-core.c                                   | 13 +++++++------
 drivers/spi/spi.c                                           |  9 +++++++++
 include/linux/spi/spi.h                                     |  9 +++++++++
 4 files changed, 33 insertions(+), 6 deletions(-)
---
base-commit: 238650ef6c7c7cca08e032527329424c9fbd70e5
change-id: 20260917-spi-sample-delay-cleanup-ab1d03ae02fa

Best regards,
--  
Frieder Schrempf <frieder.schrempf@kontron.de>
Re: [PATCH v2 0/3] spi: Better specification for rx-sample-delay-ns and core parsing
Posted by Mark Brown 3 days, 6 hours ago
On Mon, 21 Sep 2026 12:16:43 +0200, Frieder Schrempf wrote:
> spi: Better specification for rx-sample-delay-ns and core parsing
> 
> "rx-sample-delay-ns" has been a generic SPI peripheral property since it
> was moved to spi-peripheral-props.yaml, but the core has never looked at
> it, and what it is meant to describe has become blurred along the way.
> 
> It was introduced in 2015 for Rockchip, to compensate "boards with
> high-capacitance SPI lines". The wording now in the generic schema came
> later, from a description of a DesignWare register, and lost its
> controller-specific qualifier on the way. It says what the value does to
> the controller, but not what a board should measure to arrive at it.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.4

Thanks!

[1/3] spi: dt-bindings: Clarify what rx-sample-delay-ns describes
      https://git.kernel.org/broonie/spi/c/2c68b2403acd
[2/3] spi: Parse the rx-sample-delay-ns peripheral property in the core
      https://git.kernel.org/broonie/spi/c/631a56336381
[3/3] spi: dw: Use the rx-sample-delay-ns value parsed by the core
      https://git.kernel.org/broonie/spi/c/38d4b42e4a2a

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark