From patchwork Wed May 4 09:36:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 12837589 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 AF77EC433EF for ; Wed, 4 May 2022 09:52: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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LCCIyQ2Bwy64zMYlIDPWcvz0tu5G8GkjpUp1twWhZ7Y=; b=2b4CJKkortSOuw IpaxVbNgK9NZtE8BrDunF/z45QiuwOFZwxXhzq8C741uhgKK/4+JoptM5OtdelqlQCDHiN7+Nbja8 /f4wNWQCepTmzUm3tk8K8Iz69OhjDDZ9J0EwHOY/lRCMwrSkT3VCQ67ayIo4LhhmqZDa9Ze2U5lNg UmtmujL66kVZQAkufbYQ3C9MN6RVpdPsKJDA2j4iOxSi2Wu8m5i+IiIE/DV4aArg/eZ1VRniiIQzp D4M/KA842X5xHi93KpQ+Nrc6R5MjaasThMabMeAapw0NXNxpu+tCXHiIiP69eCY2WUSNb37RAUS2y +t1gSj80JcR4uOEx9BVw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nmBfa-00A3p0-QK; Wed, 04 May 2022 09:51:42 +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 1nmBRC-009wAn-Iw for linux-arm-kernel@lists.infradead.org; Wed, 04 May 2022 09:36:52 +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 BDC9C152B; Wed, 4 May 2022 02:36:49 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 30C543FA50; Wed, 4 May 2022 02:36:48 -0700 (PDT) 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, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, tarek.el-sherbiny@arm.com, adrian.slatineanu@arm.com, souvik.chakravarty@arm.com, Cristian Marussi Subject: [PATCH 5/7] firmware: arm_scmi: Make use of FastChannels configurable Date: Wed, 4 May 2022 10:36:07 +0100 Message-Id: <20220504093609.3077646-6-cristian.marussi@arm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220504093609.3077646-1-cristian.marussi@arm.com> References: <20220504093609.3077646-1-cristian.marussi@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220504_023650_757058_9C363D91 X-CRM114-Status: GOOD ( 12.27 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a Kernel configuration entry used to optionally disable the usage of SCMI FastChannels even on platforms where they are available. Make such option default-yes to preserve the original SCMI system behaviour of using any available FC. Signed-off-by: Cristian Marussi --- drivers/firmware/arm_scmi/Kconfig | 13 +++++++++++++ drivers/firmware/arm_scmi/perf.c | 3 ++- drivers/firmware/arm_scmi/powercap.c | 3 ++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_scmi/Kconfig b/drivers/firmware/arm_scmi/Kconfig index 1e7b7fec97d9..624f32b61825 100644 --- a/drivers/firmware/arm_scmi/Kconfig +++ b/drivers/firmware/arm_scmi/Kconfig @@ -42,6 +42,19 @@ config ARM_SCMI_HAVE_MSG This declares whether a message passing based transport for SCMI is available. +config ARM_SCMI_USE_FASTCHANNELS + bool "Use SCMI FastChannels when available" + default y + help + Use SCMI FastChannels when advertised as available by the platform. + + On systems where the SCMI platform advertises the availability of + FastChannels, supported SCMI commands can be issued triggering a + one-way FastChannel request, much more quicker than using a + regular SCMI message transfer. + When set to N forces the OSPM to use instead regular SCMI message + transfers even if FastChannels are available. If unsure say Y. + config ARM_SCMI_TRANSPORT_MAILBOX bool "SCMI transport based on Mailbox" depends on MAILBOX diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c index da7fe3561217..0852087c06e1 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c @@ -820,7 +820,8 @@ static int scmi_perf_protocol_init(const struct scmi_protocol_handle *ph) scmi_perf_domain_attributes_get(ph, domain, dom, version); scmi_perf_describe_levels_get(ph, domain, dom); - if (dom->perf_fastchannels) + if (dom->perf_fastchannels && + IS_ENABLED(CONFIG_ARM_SCMI_USE_FASTCHANNELS)) scmi_perf_domain_init_fc(ph, domain, &dom->fc_info); } diff --git a/drivers/firmware/arm_scmi/powercap.c b/drivers/firmware/arm_scmi/powercap.c index 314c89bbd3d6..874a851a1f6c 100644 --- a/drivers/firmware/arm_scmi/powercap.c +++ b/drivers/firmware/arm_scmi/powercap.c @@ -781,7 +781,8 @@ scmi_powercap_protocol_init(const struct scmi_protocol_handle *ph) if (ret) return ret; - if (pinfo->powercaps[domain].fastchannels) + if (pinfo->powercaps[domain].fastchannels && + IS_ENABLED(CONFIG_ARM_SCMI_USE_FASTCHANNELS)) scmi_powercap_domain_init_fc(ph, domain, &pinfo->powercaps[domain].fc_info); }