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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 13 Jun 2022 at 15:48, Maxime Ripard <maxime@xxxxxxxxxx> 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@xxxxxxxxxx>

Reviewed-by: Dave Stevenson <dave.stevenson@xxxxxxxxxxxxxxx>

> ---
>  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
>



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux