[PATCH] firmware: arm_scmi: Remove inappropriate error log.

Sudeep Holla sudeep.holla at arm.com
Thu Nov 2 04:16:22 PDT 2023


On Wed, Nov 01, 2023 at 04:17:26PM +0800, xinglong.yang wrote:
> The platform may not support fastchannel, but this is a legal
> operation.
> 
>         -Before this patch, when the platform not support fastchannel,
>         goto err_xfer will print "Failed to ...". This log is misleading.
> 
>         -With this patch, when the fastchannel is not been supported,
>         the "Failed to ..." log will be skipped.
>

In addition to your patch[1], I would just fix this by something like
below patch instead of this patch

Regards,
Sudeep

[1] https://lore.kernel.org/all/20231102075853.1320710-1-xinglong.yang@cixtech.com

-->8

diff --git i/drivers/firmware/arm_scmi/perf.c w/drivers/firmware/arm_scmi/perf.c
index f5a063b0b1ab..36cdcfaf4324 100644
--- i/drivers/firmware/arm_scmi/perf.c
+++ w/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;
 }




More information about the linux-arm-kernel mailing list