Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2947220iog; Mon, 27 Jun 2022 06:17:54 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uhv9imEoCxNWFHUIzotiOPhiO4d2UnCF0+7S+fZyb3dHolEemh9pltcMKGDzSZVXuMi9C6 X-Received: by 2002:a17:903:230d:b0:16a:73ce:9068 with SMTP id d13-20020a170903230d00b0016a73ce9068mr14490702plh.57.1656335874749; Mon, 27 Jun 2022 06:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656335874; cv=none; d=google.com; s=arc-20160816; b=uCJP+metPI+ahYVVuRJOAvj/y3PEc6dbAXvsmHV4rB12iirPzLQlRAtEPOiDK3Ssui 3Ji7Qd2OibXp8+w/7PpLGXcxwq0a+/oSL9tgUFIzXA5FXdzKIUNhub/gCrjplawH/b3T DIvpqx2ONGAl3PRVHVarfuYLFC5/38qHsB1aSyB8hInM05DrfxWvFHzRgO9ZlvhLpV1P 6k1ejKLqEKOSg3HMnsrMebbgVs8tJ1w9lqdXEbCPqtRLm7IJ5s7kMj1HGtCBcAufxX8K N1xIInwoaMAhPGrnaDa5+VHyyswKLIzflAqaXPMLFhxirVmgTPQHtsM3susE3UEjnTHJ I1wA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=VqoMoDLsBfgl9rgsmhEQzN9wg/ICuMBDD/xl7bW4MWo=; b=RBsjVrd+ShaPWQzk77BgNcn87wBuajzbRLl9Vov9DdI4tyN2tHfzc+7/GjryYir47l OJnlQNwZQ2pnAr+qkz7rN5qulzIMujC/gpfpRdNAHapauqi/J1v99ulhnr5bvVKFMW6r laACZlyejL/4fcf1hjiHLCaY05e35/Cc1KOm7FcNY+X1vpVz+qwbPZemAZMHq78X97ZT gGFqp1x3pVEYma8Z3mDD6r1ysRMi2dKt6ZNXML3R2cIOkl1vmwl8LSDuMyc0GHUB+6c6 a9oiBWqcJAwoN+1eljXCOEs4HmqVPMWywHifIs2KYgpWNk8jwjEIkUwU9jgXQtnyNmS9 lktA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a056a00244300b005256f0bc3a7si15062589pfj.126.2022.06.27.06.17.39; Mon, 27 Jun 2022 06:17:54 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236070AbiF0MbU (ORCPT + 99 others); Mon, 27 Jun 2022 08:31:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235728AbiF0MbE (ORCPT ); Mon, 27 Jun 2022 08:31:04 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CADCE766F for ; Mon, 27 Jun 2022 05:31:03 -0700 (PDT) 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 CF29F176A; Mon, 27 Jun 2022 05:31:03 -0700 (PDT) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B40053F792; Mon, 27 Jun 2022 05:31:01 -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, etienne.carriere@linaro.org, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, tarek.el-sherbiny@arm.com, adrian.slatineanu@arm.com, souvik.chakravarty@arm.com, wleavitt@marvell.com, wbartczak@marvell.com, Cristian Marussi Subject: [PATCH v3 5/9] firmware: arm_scmi: Make use of FastChannels configurable Date: Mon, 27 Jun 2022 13:30:34 +0100 Message-Id: <20220627123038.1427067-6-cristian.marussi@arm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220627123038.1427067-1-cristian.marussi@arm.com> References: <20220627123038.1427067-1-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Add a Kernel configuration entry used to optionally disable, globally, the usage of SCMI FastChannels even on platforms where they are available. Make such option default-no to preserve the original SCMI system behaviour of using any available FC. Signed-off-by: Cristian Marussi --- v2 --> v3 - fixed wording in Kconfig - reverted Kconfig logic _USE_ -> _AVOID_ --- drivers/firmware/arm_scmi/Kconfig | 13 +++++++++++++ drivers/firmware/arm_scmi/driver.c | 6 ++++++ 2 files changed, 19 insertions(+) diff --git a/drivers/firmware/arm_scmi/Kconfig b/drivers/firmware/arm_scmi/Kconfig index 1e7b7fec97d9..3fb34db01014 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_AVOID_FASTCHANNELS + bool "Avoid using SCMI FastChannels even when available" + help + Avoid using SCMI FastChannels even if 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 quickly than using a + regular SCMI message transfer. + When set to Y forces the OSPM to use instead regular SCMI message + transfers even if FastChannels are available. If unsure say N. + config ARM_SCMI_TRANSPORT_MAILBOX bool "SCMI transport based on Mailbox" depends on MAILBOX diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 00b7f2aff4ec..76dc82ba04b3 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -1298,6 +1298,12 @@ scmi_common_fastchannel_init(const struct scmi_protocol_handle *ph, struct scmi_msg_resp_desc_fc *resp; const struct scmi_protocol_instance *pi = ph_to_pi(ph); + if (IS_ENABLED(CONFIG_ARM_SCMI_AVOID_FASTCHANNELS)) { + dev_warn_once(ph->dev, + "FastChannels usage disabled in Kconfig.\n"); + return; + } + if (!p_addr) { ret = -EINVAL; goto err_out; -- 2.32.0