From: Rohit Ner <rohitner@google.com>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
manugautam@google.com, joychakr@google.com,
Rohit Ner <rohitner@google.com>
Subject: [PATCH v2 1/1] spi: spi-loopback-test: Add module param for iteration length
Date: Wed, 12 Apr 2023 13:20:09 -0700 [thread overview]
Message-ID: <20230412202009.3750955-2-rohitner@google.com> (raw)
In-Reply-To: <20230412202009.3750955-1-rohitner@google.com>
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 <rohitner@google.com>
---
drivers/spi/spi-loopback-test.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/spi/spi-loopback-test.c b/drivers/spi/spi-loopback-test.c
index 313106eb8d40..675a73cf1579 100644
--- a/drivers/spi/spi-loopback-test.c
+++ b/drivers/spi/spi-loopback-test.c
@@ -53,6 +53,12 @@ module_param(no_cs, int, 0);
MODULE_PARM_DESC(no_cs,
"if set Chip Select (CS) will not be used");
+/* run tests only for a specific length */
+static int run_only_iter_len = -1;
+module_param(run_only_iter_len, int, 0);
+MODULE_PARM_DESC(run_only_iter_len,
+ "only run tests for a length of this number in iterate_len list");
+
/* run only a specific test */
static int run_only_test = -1;
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,
for (idx_len = 0; idx_len < SPI_TEST_MAX_ITERATE &&
(len = test->iterate_len[idx_len]) != -1; idx_len++) {
+ if ((run_only_iter_len > -1) && len != run_only_iter_len)
+ continue;
FOR_EACH_ALIGNMENT(tx_align) {
FOR_EACH_ALIGNMENT(rx_align) {
/* and run the iteration */
--
2.40.0.577.gac1e443424-goog
next prev parent reply other threads:[~2023-04-12 20:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-12 20:20 [PATCH v2 0/1] SPI loopback testing framework updates Rohit Ner
2023-04-12 20:20 ` Rohit Ner [this message]
2023-04-12 20:23 ` Mark Brown
2023-04-13 17:52 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230412202009.3750955-2-rohitner@google.com \
--to=rohitner@google.com \
--cc=broonie@kernel.org \
--cc=joychakr@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=manugautam@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).