From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 528F0C00144 for ; Mon, 1 Aug 2022 06:56:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=cYZkwJrlBIVlGXoQTWWReTJv/x3m4q+zViIC5BFR4ts=; b=fCuu2rE3Z/AI/o u+VZrIgRC/r891Cb5CXkth0vhr6Qd2fh1wC85bpvct9BA2sW1dctDeV4IbeChJiOXXMcdUbwDqdFz 8SNDgJcdWwUZTY5Bp4dF2983jDGTy8tn/vhanT8yS1PqIw1QHoNdVQvqAvGEW+rcJMEZVLDGg9onw vuIN/Mu5chXxDWDTg108V6VZM4GtIfjV4g9sPM4JDqYcNG5wvAn7eD+BQtsTZsG4f8VbEElgCQqml 2J5PiLWCtmTzivVtQMqKZQYzx/STNo+YHrArb+ArDay+T2h0HMW8DZeymCmfC/7rakyACtqVbSkPY EFKFqLzg7jvvGdpe1Hag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIPKW-003AnF-VO; Mon, 01 Aug 2022 06:55:09 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oIPKS-003Ajv-RE for linux-arm-kernel@lists.infradead.org; Mon, 01 Aug 2022 06:55:06 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A1FBA1515; Sun, 31 Jul 2022 23:55:02 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 861FB3F73B; Sun, 31 Jul 2022 23:55:00 -0700 (PDT) Date: Mon, 1 Aug 2022 07:54:58 +0100 From: Cristian Marussi To: Arun KS Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@huawei.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, peter.hilber@opensynergy.com, Arun KS Subject: Re: [RFC PATCH 15/16] selftests: arm64: Add initial SCMI testcases Message-ID: References: <20220227205608.30812-1-cristian.marussi@arm.com> <20220227205608.30812-16-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220731_235505_000256_2E1C1ED8 X-CRM114-Status: GOOD ( 18.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Aug 01, 2022 at 10:22:19AM +0530, Arun KS wrote: > Hi Cristian, > Hi Arun, [snip] > > +setup_scmi_test_env() > > +{ > > + local scmi_info_dir="${SCMI_DEBUGFS_TOPDIR}/info/" > > + > > + export SCMI_VENDOR="$(cat ${scmi_info_dir}/vendor_id)" > > + export SCMI_SUB_VENDOR="$(cat ${scmi_info_dir}/sub_vendor_id)" > > + export SCMI_VERS_MAJ="$(cat ${scmi_info_dir}/major_ver)" > > + export SCMI_VERS_MIN="$(cat ${scmi_info_dir}/minor_ver)" > > + export SCMI_VERS_IMPL="$(cat ${scmi_info_dir}/impl_ver)" > > + > > + ksft_log "Found stack: $SCMI_VENDOR/$SCMI_SUB_VENDOR ${SCMI_VERS_MAJ}.${SCMI_VERS_MAJ} - $SCMI_VERS_IMPL" > > + > > + SCMI_TEST_PROTOS="" > > + for p in ${SCMI_DEBUGFS_TOPDIR}/protocol_*; do > > + SCMI_TEST_PROTOS="${SCMI_TEST_PROTOS} $(basename $p)" > > + done > > + > > + ksft_log "Found testing protocols: $SCMI_TEST_PROTOS" > > + > > + export SCMI_TEST_PROTOS > > + SCMI_TRANSPORT_IS_ATOMIC="N" > > + [ -d "${SCMI_DEBUGFS_TOPDIR}/transport" ] && > > + SCMI_TRANSPORT_IS_ATOMIC=$(cat "${SCMI_DEBUGFS_TOPDIR}/transport/is_atomic") > > + export SCMI_TRANSPORT_IS_ATOMIC > > +} > > + > > +# Setup > > +check_root_privs > > + > > +check_scmi_testing_stack > > + > > +setup_scmi_test_env > > + > > +# Main > > +# Run all available tests for the found protocols > > +# > > +for proto_dir in $SCMI_TEST_PROTOS; do > > + [ ! -d $proto_dir ] && ksft_log "$proto_dir tests NOT supported." && continue > > + export TST_PROTO_DIR="${SCMI_DEBUGFS_TOPDIR}/${proto_dir}" > > + TST_PROTO_VERSION=$(cat ${TST_PROTO_DIR}/version) > > + ksft_log "Running tests for SCMI $proto_dir ver:$TST_PROTO_VERSION" > > + for tst in $proto_dir/*; do > > + ksft_scmi_run_one $tst > > + done > > +done > > + > > +ksft_results > > diff --git a/tools/testing/selftests/arm64/scmi/testcases/protocol_0x14/clock_enable.sh b/tools/testing/selftests/arm64/scmi/testcases/protocol_0x14/clock_enable.sh > > new file mode 100755 > > index 000000000000..4cdf3a097ba7 > > --- /dev/null > > +++ b/tools/testing/selftests/arm64/scmi/testcases/protocol_0x14/clock_enable.sh > > @@ -0,0 +1,33 @@ > > +#!/bin/bash > > +# SPDX-License-Identifier: GPL-2.0 > > + > > +. ./kselftest_scmi_lib.sh > > + > > +supported_fw="EMU-SCMI-VM:userland" > > +ksft_scmi_check_fw_version $supported_fw > > what is the necessity of this check? Won't it limits the use of this > common test script across multiple platforms? > Yes, indeed the basic idea here was to showcase in this RFC series that the testcases could be written so as to be run only on a restricted set of platforms: the crux of the matter is that some of the SCMI tests by their own nature can be very invasive and disruptive, but for the sake of testing the Kernel stack some of those are worth to be run and, with this 'version-bsed' approach, you could run it safely as long as you deploy them against some sort of special emulated SCMI-server which is is instead safe to be tested in any way (since no real clocks are in fact involved...) For this same reason, this kind of test tailored at a very special SCMI server wouldn't be probably upstreamed unless you fw-emulation backend is upstream in the open too, so I posted this test more to showcase the version based mechanism than the test itself... Thanks, Cristian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel