[PATCH v2 1/2] firmware: arm_scmi: get only min/max clock rates

Sudeep Holla sudeep.holla at arm.com
Mon Dec 9 02:33:37 PST 2024


On Tue, Dec 03, 2024 at 06:39:07PM +0100, Etienne Carriere wrote:
> Remove limitation of 16 clock rates max for discrete clock rates
> description when the SCMI firmware supports SCMI Clock protocol v2.0
> or later.
>
> Driver clk-scmi.c is only interested in the min and max clock rates.
> Get these by querying the first and last discrete rates with SCMI
> clock protocol message ID CLOCK_DESCRIBE_RATES since the SCMI
> specification v2.0 and later states that rates enumerated by this
> command are to be enumerated in "numeric ascending order" [1].
>
> Preserve the implementation that queries all discrete rates (16 rates
> max) to support SCMI firmware built on SCMI specification v1.0 [2]
> where SCMI Clock protocol v1.0 does not explicitly require rates
> described with CLOCK_DESCRIBE_RATES to be in ascending order.
>
> Link: https://developer.arm.com/documentation/den0056 [1]
> Link: https://developer.arm.com/documentation/den0056/a [2]
> Signed-off-by: Etienne Carriere <etienne.carriere at foss.st.com>
> ---

[...]

> +
> +static int scmi_clock_get_rates_bound(const struct scmi_protocol_handle *ph,
> +				      u32 clk_id, struct scmi_clock_info *clk)
> +{

This new function seem to have unwraped the scmi_iterator_ops(namely
prepare_message, update_state and process_response instead of reusing them.
Can you please explain why it wasn't possible to reuse them ?

--
Regards,
Sudeep



More information about the linux-arm-kernel mailing list