You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
firmware: arm_scmi: Fix sorting of retrieved clock rates
[ Upstream commit23274739a5] During SCMI Clock protocol initialization, after having retrieved from the SCMI platform all the available discrete rates for a specific clock, the clock rates array is sorted, unfortunately using a pointer to its end as a base instead of its start, so that sorting does not work. Fix invocation of sort() passing as base a pointer to the start of the retrieved clock rates array. Link: https://lore.kernel.org/r/20220318092813.49283-1-cristian.marussi@arm.com Fixes:dccec73de9("firmware: arm_scmi: Keep the discrete clock rates sorted") Signed-off-by: Cristian Marussi <cristian.marussi@arm.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
16c628b0c6
commit
5637129712
@@ -202,7 +202,8 @@ scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
|
||||
|
||||
if (rate_discrete && rate) {
|
||||
clk->list.num_rates = tot_rate_cnt;
|
||||
sort(rate, tot_rate_cnt, sizeof(*rate), rate_cmp_func, NULL);
|
||||
sort(clk->list.rates, tot_rate_cnt, sizeof(*rate),
|
||||
rate_cmp_func, NULL);
|
||||
}
|
||||
|
||||
clk->rate_discrete = rate_discrete;
|
||||
|
||||
Reference in New Issue
Block a user