linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Cristian Marussi <cristian.marussi@arm.com>
To: Arun KS <arunks.linux@gmail.com>
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 <getarunks@gmail.com>
Subject: Re: [RFC PATCH 15/16] selftests: arm64: Add initial SCMI testcases
Date: Mon, 1 Aug 2022 07:54:58 +0100	[thread overview]
Message-ID: <Yud4re9NC1Tjsoco@e120937-lin> (raw)
In-Reply-To: <CAKZGPAOvys8ddxr36WkfjAshZYBGWG6ecUMa8zGAPWhoEg=GVQ@mail.gmail.com>

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

  reply	other threads:[~2022-08-01  6:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-27 20:55 [RFC PATCH 00/16] Introduce SCMI test driver and related Kselftest Cristian Marussi
2022-02-27 20:55 ` [RFC PATCH 01/16] firmware: arm_scmi: Simplify scmi_devm_notifier_unregister Cristian Marussi
2022-02-27 20:55 ` [RFC PATCH 02/16] firmware: arm_scmi: Make protocols init fail on basic errors Cristian Marussi
2022-02-27 20:55 ` [RFC PATCH 03/16] firmware: arm_scmi: Add multiple protocols registration support Cristian Marussi
2022-02-27 20:55 ` [RFC PATCH 04/16] firmware: arm_scmi: Add .version_get protocol operation Cristian Marussi
2022-02-27 20:55 ` [RFC PATCH 05/16] firmware: arm_scmi: Expose information on configured transport Cristian Marussi
2022-02-27 20:55 ` [RFC PATCH 06/16] firmware: arm_scmi: Define a common SCMI_MAX_PROTOCOLS value Cristian Marussi
2022-02-27 20:55 ` [RFC PATCH 07/16] debugfs: Add signed versions of debugfs_create_u32/64 helpers Cristian Marussi
2022-03-18 13:21   ` Greg Kroah-Hartman
2022-03-18 15:39     ` Cristian Marussi
2022-03-18 15:49       ` Greg Kroah-Hartman
2022-02-27 20:56 ` [RFC PATCH 08/16] firmware: arm_scmi: Add SCMI Testing driver Cristian Marussi
2022-02-27 20:56 ` [RFC PATCH 09/16] firmware: arm_scmi: testing: Add Clock protocol full support Cristian Marussi
2022-02-27 20:56 ` [RFC PATCH 10/16] firmware: arm_scmi: testing: Add Sensor protocol basic support Cristian Marussi
2022-02-27 20:56 ` [RFC PATCH 11/16] firmware: arm_scmi: Add test driver generic notification helpers Cristian Marussi
2022-02-27 20:56 ` [RFC PATCH 12/16] firmware: arm_scmi: Add Sensor notifications testing support Cristian Marussi
2022-02-27 20:56 ` [RFC PATCH 13/16] firmware: arm_scmi: Add testing Power protocol support Cristian Marussi
2022-02-27 20:56 ` [RFC PATCH 14/16] firmware: arm_scmi: Add testing Voltage " Cristian Marussi
2022-08-01  4:47   ` Arun KS
2022-08-01  6:44     ` Cristian Marussi
2022-02-27 20:56 ` [RFC PATCH 15/16] selftests: arm64: Add initial SCMI testcases Cristian Marussi
2022-08-01  4:52   ` Arun KS
2022-08-01  6:54     ` Cristian Marussi [this message]
     [not found]   ` <CAKZGPAMoBPiikbpNE2SjDxsUQQKZC-Yn5cbn60Sx0ZRqGv47jA@mail.gmail.com>
2022-08-01  7:01     ` Cristian Marussi
2022-02-27 20:56 ` [RFC PATCH 16/16] [DEBUG]: firmware: arm_scmi: Add Kconfig to allow SCMI Testing driver coexistence Cristian Marussi

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=Yud4re9NC1Tjsoco@e120937-lin \
    --to=cristian.marussi@arm.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=arunks.linux@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=getarunks@gmail.com \
    --cc=james.quinlan@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.hilber@opensynergy.com \
    --cc=souvik.chakravarty@arm.com \
    --cc=sudeep.holla@arm.com \
    --cc=vincent.guittot@linaro.org \
    /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).