firmware: arm_scmi: Refrain set operations of perf
PATCH v3 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.
Signed-off-by xinglong.yang <[email protected]>
--- drivers/firmware/arm_scmi/perf.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/firmware/arm_scmi/perf.c +6 -0
@@ -504,6 +504,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 ;
@@ -654,6 +657,9 @@ static int scmi_perf_level_set(const struct scmi_protocol_handle *ph,if (IS_ERR (dom))return PTR_ERR (dom); +if (!dom->info.set_perf) +return -EOPNOTSUPP ; +if (dom->level_indexing_mode) {struct scmi_opp *opp;
Signature · 8 lines
The last patch is not based on the upstream tree. Reposting it based on the upstream tree. 2.42.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sudeep Holla
AppliedQuoted 5 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.
Applied to sudeep.holla/linux (for-next/scmi/updates), thanks!
[1/1] firmware: arm_scmi: Refrain set operations of perf
https://git.kernel.org/sudeep.holla/c/189df98777a3
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel