firmware: arm_scmi: Refrain set operations of perf
PATCH v2 1/1 firmware: arm_scmi: Refrain set operations of perf
Refrain from trying to take the SET operation where the set_* operations are not supported, because: (1.) avoid unneeded SCMI exchanges, (2.) avoids to trust the FW reply blindly.
--- drivers/firmware/arm_scmi/perf.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/firmware/arm_scmi/perf.c +6 -0
@@ -377,6 +377,9 @@ static int scmi_perf_limits_set(const struct scmi_protocol_handle *ph,if (IS_ERR (dom))return PTR_ERR (dom); +if (!dom->set_limits) +return -EOPNOTSUPP ; +if (PROTOCOL_REV_MAJOR (pi->version) >=0x3 && !max_perf && !min_perf)return -EINVAL ;
@@ -473,6 +476,9 @@ static int scmi_perf_level_set(const struct scmi_protocol_handle *ph,if (IS_ERR (dom))return PTR_ERR (dom); +if (!dom->set_perf) +return -EOPNOTSUPP ; +if (dom->fc_info && dom->fc_info[PERF_FC_LEVEL ].set_addr) {struct scmi_fc_info *fci = &dom->fc_info[PERF_FC_LEVEL ];
Signature · 7 lines
2.42.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH v2 1/1 firmware: arm_scmi: Refrain set operations of perf
---------- Forwarded message ---------
发件人: xinglong.yang <[email protected]>
Date: 2023年11月2日周四 15:59
Subject: [PATCH v2] firmware: arm_scmi: Refrain set operations of perf
To: <[email protected]>, <[email protected]>, <[email protected]>
Cc: <[email protected]>
Refrain from trying to take the SET operation where the set_* operations are not supported, because: (1.) avoid unneeded SCMI exchanges, (2.) avoids to trust the FW reply blindly.
--- drivers/firmware/arm_scmi/perf.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/firmware/arm_scmi/perf.c +0 -0
@@ -377,6 +377,9 @@ static int scmi_perf_limits_set(const struct
scmi_protocol_handle *ph,
if (IS_ERR(dom))
return PTR_ERR(dom);+ if (!dom->set_limits)
+ return -EOPNOTSUPP;
+
if (PROTOCOL_REV_MAJOR(pi->version) >= 0x3 && !max_perf && !min_perf)
return -EINVAL;@@ -473,6 +476,9 @@ static int scmi_perf_level_set(const struct scmi_protocol_handle *ph,
if (IS_ERR(dom))
return PTR_ERR(dom);+ if (!dom->set_perf)
+ return -EOPNOTSUPP;
+
if (dom->fc_info && dom->fc_info[PERF_FC_LEVEL].set_addr) {
struct scmi_fc_info *fci = &dom->fc_info[PERF_FC_LEVEL];--
2.42.0
Quoted 8 lines · sean yang
---------- Forwarded message ---------
发件人: xinglong.yang <[email protected]>
Date: 2023年11月2日周四 15:59
Subject: [PATCH v2] firmware:arm_scmi: Refrain set operations of perf
To: <[email protected]>, <[email protected]>, <[email protected]>
Cc: <[email protected]>
Why are you forwarding the message multiple times on the list. It is useless. Also please allow a day or 2 if you suspect some mails are not delivered. I have 3 copies of this forwarded message in my inbox now.
Signature · 7 lines
Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 4 lines · xinglong.yang
Refrain from trying to take the SET operation where the set_* operations are not supported, because: (1.) avoid unneeded SCMI exchanges, (2.) avoids to trust the FW reply blindly.
This looks OK, but this is not based on the upstream tree(not even v6.6). set_perf is now move to another structure, so needs rebasing. I will take care of it and repost this patch and the other one[1] next week or at the end of current merge window. You need not repost anything for now.
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel