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 7D73AC2BB3F for ; Wed, 15 Nov 2023 15:27:24 +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=xn1VOqwS6QeCOZK4+M1KbBSoseUh9FpOOCDbcZyuVz8=; b=pXuhMJsvPD9yFz p6bhT5Qp86DblhPCZyG7qX6+kDvpxOLn6cFCBaNuJOtV5sj7tBjc65d4vdimoh4oMwXQWVLQS5kny ONZcZQMLrxEX5NFNgPFKy6LQMWi/dz9jmZT7X5G+KLxOWu4gwyM0RnpZXfJI5Z4WeG9S/tSYTI2Tn A8iwHYR5A76z7JxiIcBTSzLaWO7otBJDiEm9E8iPyfr4y3IixTFLCkJoX6nacj2T6z55TDJn3oXl3 +vqW/JxRflu/XMnufG8cVdKk+cN/V1HZ5JggCHOLTdJ1z65zBRGQn+iUI8MaWzsHUTBJxaTC3caof +gyuLOmFJfM4nyFggunw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3HnA-001Amp-0N; Wed, 15 Nov 2023 15:27:00 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r3Hn7-001All-2V for linux-arm-kernel@lists.infradead.org; Wed, 15 Nov 2023 15:26:59 +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 E85C1C15; Wed, 15 Nov 2023 07:27:39 -0800 (PST) Received: from pluto (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AC9AA3F641; Wed, 15 Nov 2023 07:26:53 -0800 (PST) Date: Wed, 15 Nov 2023 15:26:51 +0000 From: Cristian Marussi To: Sudeep Holla Cc: linux-arm-kernel@lists.infradead.org, xinglong.yang@cixtech.com Subject: Re: [PATCH] firmware: arm_scmi: Populate fastchannel info only if set operations are allowed Message-ID: References: <20231113143252.37160-1-sudeep.holla@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231113143252.37160-1-sudeep.holla@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231115_072657_880039_683DC7CC X-CRM114-Status: GOOD ( 21.49 ) 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, Nov 13, 2023 at 02:32:52PM +0000, Sudeep Holla wrote: > Certain SCMI performance domains may have restrictions on the set level > and/or limits operation. If the SCMI domain supports fastchannel and the > set operations are not allowed, then any attempts to fetch the fastchannel > information for set level and/or limits operation will result in the > SCMI platform returning SCMI_ERR_SUPPORT. However, since this information > about the domain is already known to the agent(OSPM here) obtained via > PERF_DOMAIN_ATTRIBUTES, the agent(OSPM) can avoid calls to the firmware > trying to fetch the fastchannel information for the same. > > Add those checks and skip querying the fastchannel information from the > firmware based on the information collected during the domain enumeration > stage. > LGTM. Reviewed-by: Cristian Marussi Thanks, Cristian > Signed-off-by: Sudeep Holla > --- > drivers/firmware/arm_scmi/perf.c | 27 +++++++++++++++++---------- > 1 file changed, 17 insertions(+), 10 deletions(-) > > diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c > index f5a063b0b1ab..36cdcfaf4324 100644 > --- a/drivers/firmware/arm_scmi/perf.c > +++ b/drivers/firmware/arm_scmi/perf.c > @@ -762,29 +762,36 @@ static void scmi_perf_domain_init_fc(const struct scmi_protocol_handle *ph, > u32 domain, struct scmi_fc_info **p_fc) > { > struct scmi_fc_info *fc; > + struct perf_dom_info *dom; > + > + dom = scmi_perf_domain_lookup(ph, domain); > + if (IS_ERR(dom)) > + return; > > fc = devm_kcalloc(ph->dev, PERF_FC_MAX, sizeof(*fc), GFP_KERNEL); > if (!fc) > return; > > - ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL, > - PERF_LEVEL_SET, 4, domain, > - &fc[PERF_FC_LEVEL].set_addr, > - &fc[PERF_FC_LEVEL].set_db); > - > ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL, > PERF_LEVEL_GET, 4, domain, > &fc[PERF_FC_LEVEL].get_addr, NULL); > > - ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL, > - PERF_LIMITS_SET, 8, domain, > - &fc[PERF_FC_LIMIT].set_addr, > - &fc[PERF_FC_LIMIT].set_db); > - > ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL, > PERF_LIMITS_GET, 8, domain, > &fc[PERF_FC_LIMIT].get_addr, NULL); > > + if (dom->info.set_perf) > + ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL, > + PERF_LEVEL_SET, 4, domain, > + &fc[PERF_FC_LEVEL].set_addr, > + &fc[PERF_FC_LEVEL].set_db); > + > + if (dom->set_limits) > + ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL, > + PERF_LIMITS_SET, 8, domain, > + &fc[PERF_FC_LIMIT].set_addr, > + &fc[PERF_FC_LIMIT].set_db); > + > *p_fc = fc; > } > > -- > 2.42.0 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel