diff options
author | Miquel Raynal <[email protected]> | 2023-06-22 11:06:32 +0200 |
---|---|---|
committer | Mark Brown <[email protected]> | 2023-06-22 15:03:18 +0100 |
commit | d8e4ebf87018736c0c29e2eb4afe3915156483cd (patch) | |
tree | 30908475d53e3628c426a06a18c805fd7050970c /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | e6afe03351ac81fbc4f2b93bf3b356f7b662939d (diff) |
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: Mark Brown <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/r/Message-Id: <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions