Skip to content

Commit 6d87552

Browse files
rohitner-googlebroonie
authored andcommitted
spi: spi-loopback-test: Add module param for iteration length
SPI test framework is designed to run each test case for a list of lengths. Introduce a module parameter to limit the iterations to a single value among the list of lengths. Signed-off-by: Rohit Ner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 909fac0 commit 6d87552

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/spi/spi-loopback-test.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ module_param(no_cs, int, 0);
5353
MODULE_PARM_DESC(no_cs,
5454
"if set Chip Select (CS) will not be used");
5555

56+
/* run tests only for a specific length */
57+
static int run_only_iter_len = -1;
58+
module_param(run_only_iter_len, int, 0);
59+
MODULE_PARM_DESC(run_only_iter_len,
60+
"only run tests for a length of this number in iterate_len list");
61+
5662
/* run only a specific test */
5763
static int run_only_test = -1;
5864
module_param(run_only_test, int, 0);
@@ -1033,6 +1039,8 @@ int spi_test_run_test(struct spi_device *spi, const struct spi_test *test,
10331039

10341040
for (idx_len = 0; idx_len < SPI_TEST_MAX_ITERATE &&
10351041
(len = test->iterate_len[idx_len]) != -1; idx_len++) {
1042+
if ((run_only_iter_len > -1) && len != run_only_iter_len)
1043+
continue;
10361044
FOR_EACH_ALIGNMENT(tx_align) {
10371045
FOR_EACH_ALIGNMENT(rx_align) {
10381046
/* and run the iteration */

0 commit comments

Comments
 (0)