Skip to content
Unverified Commit d8e4ebf8 authored by Miquel Raynal's avatar Miquel Raynal Committed by Mark Brown
Browse files

spi: Create a helper to derive adaptive timeouts



Big transfers might take a bit of time, too constraining timeouts might
lead to false positives. In order to simplify the drivers work and with
the goal of factorizing code in mind, let's add a helper that can be
used by any spi controller driver to derive a relevant per-transfer
timeout value.

The logic is simple: we know how much time it would take to transfer a
byte, we can easily derive the total theoretical amount of time involved
for each transfer. We multiply it by two to have a bit of margin and
enforce a minimum of 500ms.

Suggested-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/Message-Id

: <20230622090634.3411468-2-miquel.raynal@bootlin.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent e6afe033
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment