spi: spi-loopback-test: Allow skipping delays
authorVincent Whitchurch <vincent.whitchurch@axis.com>
Tue, 3 Jan 2023 15:22:10 +0000 (16:22 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 3 Jan 2023 15:25:02 +0000 (15:25 +0000)
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>
drivers/spi/spi-loopback-test.c

index dd7de8f..313106e 100644 (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();
        }