Skip to content
Commit a886c310 authored by Sivaram Nair's avatar Sivaram Nair Committed by Thierry Reding
Browse files

clk: tegra: bpmp: Clamp clock rates on requests



BPMP firmware ABI expects the rate inputs in int64_t. However,
tegra_bpmp_clk_round_rate() and tegra_bpmp_clk_set_rate() functions
directly assign 'unsigned long' inputs to a int64_t value causing
unexpected rounding errors.

Fix this by clipping the input rate to S64_MAX.

Signed-off-by: default avatarSivaram Nair <sivaramn@nvidia.com>
[mperttunen: slight cleanup]
Signed-off-by: default avatarMikko Perttunen <mperttunen@nvidia.com>
Reviewed-by: default avatarSivaram Nair <sivaramn@nvidia.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 6160aca4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment