diff mbox series

spi: spi-loopback-test: Allow skipping delays

Message ID 20230103152211.3034779-1-vincent.whitchurch@axis.com (mailing list archive)
State Accepted
Commit 392af84bddcc96f1546a1ca4ffa71bccce95b897
Headers show
Series spi: spi-loopback-test: Allow skipping delays | expand

Commit Message

Vincent Whitchurch Jan. 3, 2023, 3:22 p.m. UTC
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>
---
 drivers/spi/spi-loopback-test.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Mark Brown Jan. 3, 2023, 5:01 p.m. UTC | #1
On Tue, 03 Jan 2023 16:22:10 +0100, Vincent Whitchurch wrote:
> 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.
> 
> 

Applied to

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

Thanks!

[1/1] spi: spi-loopback-test: Allow skipping delays
      commit: 392af84bddcc96f1546a1ca4ffa71bccce95b897

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
diff mbox series

Patch

diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c
index dd7de8fa37d0..313106eb8d40 100644
--- a/drivers/spi/spi-loopback-test.c
+++ b/drivers/spi/spi-loopback-test.c
@@ -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();
 	}