Skip to content

Commit

Permalink
firmware: arm_scmi: Fixup perf power-cost/microwatt support
Browse files Browse the repository at this point in the history
The perf power scale value would currently be reported as bogowatts if the
platform firmware supports microwatt power scale and meets the perf major
version requirements. Fix this by populating version information in the
driver private data before the call to protocol attributes is made.

CC: Chandra Sekhar Lingutla <quic_lingutla@quicinc.com>
Fixes: 3630cd8 ("firmware: arm_scmi: Add SCMI v3.1 perf power-cost in microwatts")
Signed-off-by: Sibi Sankar <quic_sibis@quicinc.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20230811204818.30928-1-quic_sibis@quicinc.com
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
  • Loading branch information
Sibi Sankar authored and Sudeep Holla committed Sep 11, 2023
1 parent 0bb80ec commit c3638b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/firmware/arm_scmi/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,8 @@ static int scmi_perf_protocol_init(const struct scmi_protocol_handle *ph)
if (!pinfo)
return -ENOMEM;

pinfo->version = version;

ret = scmi_perf_attributes_get(ph, pinfo);
if (ret)
return ret;
Expand All @@ -1104,8 +1106,6 @@ static int scmi_perf_protocol_init(const struct scmi_protocol_handle *ph)
if (ret)
return ret;

pinfo->version = version;

return ph->set_priv(ph, pinfo);
}

Expand Down

0 comments on commit c3638b8

Please sign in to comment.