Skip to content

Commit 619bc6e

Browse files
committed
firmware: arm_scmi: Populate fastchannel info only if set operations are allowed
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. Link: https://lore.kernel.org/r/20231113143252.37160-1-sudeep.holla@arm.com Reviewed-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
1 parent 189df98 commit 619bc6e

1 file changed

Lines changed: 17 additions & 10 deletions

File tree

  • drivers/firmware/arm_scmi

drivers/firmware/arm_scmi/perf.c

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -762,29 +762,36 @@ static void scmi_perf_domain_init_fc(const struct scmi_protocol_handle *ph,
762762
u32 domain, struct scmi_fc_info **p_fc)
763763
{
764764
struct scmi_fc_info *fc;
765+
struct perf_dom_info *dom;
766+
767+
dom = scmi_perf_domain_lookup(ph, domain);
768+
if (IS_ERR(dom))
769+
return;
765770

766771
fc = devm_kcalloc(ph->dev, PERF_FC_MAX, sizeof(*fc), GFP_KERNEL);
767772
if (!fc)
768773
return;
769774

770-
ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
771-
PERF_LEVEL_SET, 4, domain,
772-
&fc[PERF_FC_LEVEL].set_addr,
773-
&fc[PERF_FC_LEVEL].set_db);
774-
775775
ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
776776
PERF_LEVEL_GET, 4, domain,
777777
&fc[PERF_FC_LEVEL].get_addr, NULL);
778778

779-
ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
780-
PERF_LIMITS_SET, 8, domain,
781-
&fc[PERF_FC_LIMIT].set_addr,
782-
&fc[PERF_FC_LIMIT].set_db);
783-
784779
ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
785780
PERF_LIMITS_GET, 8, domain,
786781
&fc[PERF_FC_LIMIT].get_addr, NULL);
787782

783+
if (dom->info.set_perf)
784+
ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
785+
PERF_LEVEL_SET, 4, domain,
786+
&fc[PERF_FC_LEVEL].set_addr,
787+
&fc[PERF_FC_LEVEL].set_db);
788+
789+
if (dom->set_limits)
790+
ph->hops->fastchannel_init(ph, PERF_DESCRIBE_FASTCHANNEL,
791+
PERF_LIMITS_SET, 8, domain,
792+
&fc[PERF_FC_LIMIT].set_addr,
793+
&fc[PERF_FC_LIMIT].set_db);
794+
788795
*p_fc = fc;
789796
}
790797

0 commit comments

Comments
 (0)