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: 38492 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4677474wrt; Tue, 3 Jan 2023 07:28:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXtG8UqvlJT8Cb9rOCdi+2DHEDyeGsqmEu3rbDYxyIJwPlDncTpC/Jp8hs7m/rmXJ4xNSbxu X-Received: by 2002:a17:90b:1891:b0:226:280:9a40 with SMTP id mn17-20020a17090b189100b0022602809a40mr27487971pjb.30.1672759687877; Tue, 03 Jan 2023 07:28:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672759687; cv=none; d=google.com; s=arc-20160816; b=U/A06KTNlhFTVR+PAhBuS8lPNtQhnPa5B+GMNkCjHENhBr9b4yb+WrnSLO8Rtdpa2I lJKxfQuWwVHn9O9GrxPECgMjXwcTpoxOSMcGOzGdtdiJLDYdK0aQA/qV3bpJtZVjA2NG wSuSb4mOCglfpeLAz7py7YstqHVF5NatyvUbxtz4efFsMpp9Bn+a3g/7NetR6wRII144 tFniYJ1O0cNZCGTuFlBeLp9P82C/w9iIA28zLELjgYNmlLxLYt0KH54d23cu62+nQfKp evSJeax53IjXxr+YK/BKHN9XNmK6BkSArI2QmafmA8Y8j4JRjpbbCilaHHn22ThBHCFy j2MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=nEIJiYZMrbyuP65czJYAOsZx1ZHYrqm7oFjfuWZFZZg=; b=Nx8mcwCnFtEnBTeahWtlDTFt8MDn/g574tpdoR/Ped4ZVCiHv7fDndoPC6sVq1y5gM cYgUNfplqKh8w4U2OGNACLRl3E3ehUPV1E0gG3ZXq6+/SrCk6ea5ASFW/XOWhuwGb+TP H4WxsUcVEd9NarZoq6njpwjIEHv2cv1oslPBSxv2UgXZNKrLGkO1zGZreD/XqjyhcMpJ aZzBQ14qqzIGiCZDBP/mkFuONKdBcw5zygLL8PGGs7VgMSVBOFv5TG1qmg6PmY7IwBeb GsWvVnnNHKBEhUfOXV5516NedwM7xFolCnLJkQpD87/3HMXGLSqJE4LSC1XM1ZZAGvxP QcyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=SgEEPSk0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a631c51000000b00477b64d8df4si32658530pgm.77.2023.01.03.07.27.54; Tue, 03 Jan 2023 07:28:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=SgEEPSk0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233455AbjACPW4 (ORCPT + 99 others); Tue, 3 Jan 2023 10:22:56 -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 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754015662460579572?= X-GMAIL-MSGID: =?utf-8?q?1754015662460579572?= 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(); }