Skip to contentSkip to conversation

firmware: arm_scmi: Refrain set operations of perf

PATCH Applied xinglong.yang 2 participants 2 messages Nov 9, 2023 – Nov 16, 2023 System control & power/management interface (SCPI/SCMI) Message Protocol drivers

lore
Share & tools
lore
#0 lore raw

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.

---
 drivers/firmware/arm_scmi/perf.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/firmware/arm_scmi/perf.c +6 -0
index c2435be0ae1b..f5a063b0b1ab 100644
@@ -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
Applied
#1 lore raw
Quoted 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