mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: Check reference clock before use
We use GPU reference clock as a divider. Check before division that reference clock is not zero. Change-Id: Ie453a78b422b2e740daeb7c12ce5b06faa52ba76 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1275743 GVS: Gerrit_Virtual_Submit Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
fef7083e51
commit
2a95a288b2
@@ -439,6 +439,11 @@ static int gk20a_init_clk_setup_sw(struct gk20a *g)
|
||||
|
||||
clk->gpc_pll.id = GK20A_GPC_PLL;
|
||||
clk->gpc_pll.clk_in = ref_rate / KHZ;
|
||||
if (clk->gpc_pll.clk_in == 0) {
|
||||
gk20a_err(dev_from_gk20a(g),
|
||||
"GPCPLL reference clock is zero");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Decide initial frequency */
|
||||
if (!initialized) {
|
||||
|
||||
@@ -1158,6 +1158,11 @@ static int gm20b_init_gpc_pll(struct gk20a *g)
|
||||
|
||||
clk->gpc_pll.id = GK20A_GPC_PLL;
|
||||
clk->gpc_pll.clk_in = clk_get_rate(ref) / KHZ;
|
||||
if (clk->gpc_pll.clk_in == 0) {
|
||||
gk20a_err(dev_from_gk20a(g),
|
||||
"GPCPLL reference clock is zero");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
gm20b_calc_dvfs_safe_max_freq(c);
|
||||
clk->gpc_pll.PL = (dvfs_safe_max_freq == 0) ? 0 :
|
||||
|
||||
Reference in New Issue
Block a user