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 1747FC46467 for ; Wed, 11 Jan 2023 21:31:49 +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=3jjxVP7SGS9MkiWXaw6tWcbwtBqSgckGaZKLEaoUgf0=; b=FgiHu+0USi3O/X xZ0wyvx0FB9YJ7VYHUyT1+T6lRvru6Uetd2Jh3zLXQT5LPf/zUiRwB3bXMG6aExk9+9Ey/WNEalx/ nOaPO1mNoo8G12istsxXzim/Y5vf6e5O72mp46AgJZq8znjwgxiYWMxbK9e4ioRz9pvB0a5OwyUoe j4KYPQ0odraKPMpcgsyM+nLvSkLpo3zjwE33cpr2h+NA9JpENCoASu3GZIWdZT4bZLZGGu8uhE/6p 3Yo34xai6BWOrSrRTp+1IMOTC/I4ee5tFvlQB05PQnaGf/wpqNMKt50Y+5IX+F9NrsAmptCPE+nUZ 68rgUqg2iIR6QtbMGt7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pFigK-00D04j-OZ; Wed, 11 Jan 2023 21:30:48 +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 1pFigG-00D02z-4o for linux-arm-kernel@lists.infradead.org; Wed, 11 Jan 2023 21:30:46 +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 33A48FEC; Wed, 11 Jan 2023 13:31:20 -0800 (PST) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3D7843F71A; Wed, 11 Jan 2023 13:30:36 -0800 (PST) Date: Wed, 11 Jan 2023 21:30:34 +0000 From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, wleavitt@marvell.com, peter.hilber@opensynergy.com, nicola.mazzucato@arm.com, tarek.el-sherbiny@arm.com, quic_kshivnan@quicinc.com Subject: Re: [PATCH v6 17/17] firmware: arm_scmi: Add per-channel Raw injection support Message-ID: References: <20221229182253.948175-1-cristian.marussi@arm.com> <20221229182253.948175-18-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221229182253.948175-18-cristian.marussi@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230111_133044_297587_E1A4A3E4 X-CRM114-Status: GOOD ( 23.59 ) 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 Thu, Dec 29, 2022 at 06:22:53PM +0000, Cristian Marussi wrote: > On a system configured with multiple transport channels, expose a few > additional debugfs per-channel entries to allow a user to explicitly select > which transport channel to use for the SCMI message injection. > > Signed-off-by: Cristian Marussi > --- > Documentation/ABI/testing/debugfs-scmi-raw | 43 +++++++ > drivers/firmware/arm_scmi/driver.c | 30 ++++- > drivers/firmware/arm_scmi/protocols.h | 3 + > drivers/firmware/arm_scmi/raw_mode.c | 142 ++++++++++++++++++--- > drivers/firmware/arm_scmi/raw_mode.h | 3 +- > 5 files changed, 201 insertions(+), 20 deletions(-) > > diff --git a/Documentation/ABI/testing/debugfs-scmi-raw b/Documentation/ABI/testing/debugfs-scmi-raw > index 45817d465b1f..5468ec08c084 100644 > --- a/Documentation/ABI/testing/debugfs-scmi-raw > +++ b/Documentation/ABI/testing/debugfs-scmi-raw > @@ -64,3 +64,46 @@ Description: SCMI Raw stack reset facility; writing a value to this entry > Can be used to reset and clean the SCMI Raw stack between to > different test-run. > Users: Debugging, any userspace test suite > + > +What: /sys/kernel/debug/scmi//raw/channels//message > +Date: March 2023 > +KernelVersion: 6.3 > +Contact: cristian.marussi@arm.com > +Description: SCMI Raw synchronous message injection/snooping facility; write > + a complete SCMI synchronous command message (header included) > + in little-endian binary format to have it sent to the configured > + backend SCMI server for instance through the transport > + channel. > + Any subsequently received response can be read from this same > + entry if it arrived on channel within the configured > + timeout. > + Each write to the entry causes one command request to be built > + and sent while the replies are read back one message at time > + (receiving an EOF at each message boundary). > + Note that these per-channel entries rooted at <..>/channels > + exist only if the transport is configured to have more than > + one channel. > +Users: Debugging, any userspace test suite > + > +What: /sys/kernel/debug/scmi//raw/channels//message_async > +Date: March 2023 > +KernelVersion: 6.3 > +Contact: cristian.marussi@arm.com > +Description: SCMI Raw asynchronous message injection/snooping facility; write > + a complete SCMI asynchronous command message (header included) > + in little-endian binary format to have it sent to the configured > + backend SCMI server for instance through the transport > + channel. > + Any subsequently received response can be read from this same > + entry if it arrived on channel within the configured > + timeout. > + Any additional delayed response received afterwards can be read > + from this same entry too if it arrived within the configured > + timeout. > + Each write to the entry causes one command request to be built > + and sent while the replies are read back one message at time > + (receiving an EOF at each message boundary). > + Note that these per-channel entries rooted at <..>/channels > + exist only if the transport is configured to have more than > + one channel. > +Users: Debugging, any userspace test suite > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c > index da60f218aed9..2d7e669d6dc4 100644 > --- a/drivers/firmware/arm_scmi/driver.c > +++ b/drivers/firmware/arm_scmi/driver.c > @@ -42,6 +42,8 @@ > #define CREATE_TRACE_POINTS > #include > > +#define SCMI_MAX_CHANNELS 256 > + > static DEFINE_IDA(scmi_id); > > static DEFINE_IDR(scmi_protocols); > @@ -127,6 +129,8 @@ struct scmi_debug_info { > * @handle: Instance of SCMI handle to send to clients > * @tx_minfo: Universal Transmit Message management info > * @rx_minfo: Universal Receive Message management info > + * @channels: The list of configured channels. > + * @num_chans: Number of channels described in @channels > * @tx_idr: IDR object to map protocol id to Tx channel info pointer > * @rx_idr: IDR object to map protocol id to Rx channel info pointer > * @protocols: IDR for protocols' instance descriptors initialized for > @@ -162,6 +166,8 @@ struct scmi_info { > struct scmi_handle handle; > struct scmi_xfers_info tx_minfo; > struct scmi_xfers_info rx_minfo; > + unsigned int channels[SCMI_MAX_CHANNELS]; > + int num_chans; I have a small rework for V7 to get rid of these channels/num_chans additional fields that are un-needed and can be retrieved dynamically when raw mode is initialized. Thanks, Cristian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel