[PATCH 02/33] drm/vc4: kms: Warn if clk_set_min_rate fails

Dave Stevenson dave.stevenson at raspberrypi.com
Tue Jun 28 11:28:42 UTC 2022


On Mon, 13 Jun 2022 at 15:48, Maxime Ripard <maxime at cerno.tech> wrote:
>
> 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 at cerno.tech>

Reviewed-by: Dave Stevenson <dave.stevenson at raspberrypi.com>

> ---
>  drivers/gpu/drm/vc4/vc4_kms.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c
> index c169bd72e53b..7a7c90d8520b 100644
> --- a/drivers/gpu/drm/vc4/vc4_kms.c
> +++ b/drivers/gpu/drm/vc4/vc4_kms.c
> @@ -405,7 +405,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);
> @@ -438,7 +438,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));
> --
> 2.36.1
>


More information about the dri-devel mailing list