2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 09:13:55 +08:00

spi: spi-loopback-test: Allow skipping delays

A 100 ms delay is inserted between tests by default in order to "detect
the individual tests when using a logic analyzer".  However, such delays
are unnecessary when using this module for automated regression testing,
so allow them to be disabled with a module parameter.

Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com>
Link: https://lore.kernel.org/r/20230103152211.3034779-1-vincent.whitchurch@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Vincent Whitchurch 2023-01-03 16:22:10 +01:00 committed by Mark Brown
parent cb0713e620
commit 392af84bdd
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -71,6 +71,11 @@ module_param(check_ranges, int, 0644);
MODULE_PARM_DESC(check_ranges,
"checks rx_buffer pattern are valid");
static unsigned int delay_ms = 100;
module_param(delay_ms, uint, 0644);
MODULE_PARM_DESC(delay_ms,
"delay between tests, in milliseconds (default: 100)");
/* the actual tests to execute */
static struct spi_test spi_tests[] = {
{
@ -1098,7 +1103,8 @@ int spi_test_run_tests(struct spi_device *spi,
* detect the individual tests when using a logic analyzer
* we also add scheduling to avoid potential spi_timeouts...
*/
mdelay(100);
if (delay_ms)
mdelay(delay_ms);
schedule();
}