From patchwork Tue Jan 3 15:22:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Whitchurch X-Patchwork-Id: 13087613 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4E8BC53210 for ; Tue, 3 Jan 2023 15:23:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233540AbjACPWx (ORCPT ); Tue, 3 Jan 2023 10:22:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233348AbjACPWW (ORCPT ); Tue, 3 Jan 2023 10:22:22 -0500 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA303114C; Tue, 3 Jan 2023 07:22:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1672759339; x=1704295339; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=nEIJiYZMrbyuP65czJYAOsZx1ZHYrqm7oFjfuWZFZZg=; b=SgEEPSk0A8+UIzR4KAIKDa9EjvU4vPc3pPn2X/C2vboxk9oGQQyTG+of B1qB3blALxiZ6Q2aBJNBoVONP7Kxgh8V1X6nhhp0LNabAW27oQ79kktXT cqk6C/9lV6UA8FalWbtZZO7eXjwbI7aq/BkNx0Au/GB/wYpADkBa6exKc f96FR0MVUG6mZdVFjPZPinGZLeUOa9l7tuqjAkh0/gSsRym08UJJXwZ1l q+7OOGw7Kg4Ffg7nUT8GX+J+mBedfEkdYZsFZjWakQzGRZWujgVcBSoxJ iDroJqV4Fc9ewObEpjNXZjNNKTHc4fnYjIHWk/nRjxjqQufE31olzuEqX w==; From: Vincent Whitchurch To: Mark Brown CC: , Vincent Whitchurch , , Subject: [PATCH] spi: spi-loopback-test: Allow skipping delays Date: Tue, 3 Jan 2023 16:22:10 +0100 Message-ID: <20230103152211.3034779-1-vincent.whitchurch@axis.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org 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 --- drivers/spi/spi-loopback-test.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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(); }