Skip to content

Commit

Permalink
drm/vc4: kms: Warn if clk_set_min_rate fails
Browse files Browse the repository at this point in the history
We currently ignore the clk_set_min_rate return code assuming it would
succeed. However, it can fail if we ask for a rate higher than the
current maximum for example.

Since we can't fail in atomic_commit, at least warn on failure.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Link: https://lore.kernel.org/r/20220613144800.326124-3-maxime@cerno.tech
  • Loading branch information
Maxime Ripard committed Jun 28, 2022
1 parent da8e393 commit 7d0648c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/vc4/vc4_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state)
* Do a temporary request on the core clock during the
* modeset.
*/
clk_set_min_rate(hvs->core_clk, core_rate);
WARN_ON(clk_set_min_rate(hvs->core_clk, core_rate));
}

drm_atomic_helper_commit_modeset_disables(dev, state);
Expand Down Expand Up @@ -439,7 +439,7 @@ static void vc4_atomic_commit_tail(struct drm_atomic_state *state)
* Request a clock rate based on the current HVS
* requirements.
*/
clk_set_min_rate(hvs->core_clk, new_hvs_state->core_clock_rate);
WARN_ON(clk_set_min_rate(hvs->core_clk, new_hvs_state->core_clock_rate));

drm_dbg(dev, "Core clock actual rate: %lu Hz\n",
clk_get_rate(hvs->core_clk));
Expand Down

0 comments on commit 7d0648c

Please sign in to comment.