[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4a6d4704-27a2-457a-8b7b-3b306539bc6d@redhat.com>
Date: Fri, 15 Nov 2024 15:35:51 +0100
From: Jocelyn Falempe <jfalempe@...hat.com>
To: Murad Masimov <m.masimov@...ima.ru>, Dave Airlie <airlied@...hat.com>
Cc: Thomas Zimmermann <tzimmermann@...e.de>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, David Airlie <airlied@...il.com>,
Simona Vetter <simona@...ll.ch>,
Mathieu Larouche <mathieu.larouche@...rox.com>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
lvc-project@...uxtesting.org
Subject: Re: [PATCH v3] drm/mgag200: Apply upper limit for clock variable
On 15/11/2024 15:14, Murad Masimov wrote:
> If the value of the clock variable is higher than 800000, the value of the
> variable m, which is used as a divisor, will remain zero, because
> (clock * testp) will be higher than vcomax in every loop iteration, which
> leads to skipping every iteration and leaving variable m unmodified.
>
> Return -EINVAL just after the loop, if m is still 0.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
Thanks for this patch.
Reviewed-by: Jocelyn Falempe <jfalempe@...hat.com>
>
> Fixes: e829d7ef9f17 ("drm/mgag200: Add support for a new rev of G200e")
> Signed-off-by: Murad Masimov <m.masimov@...ima.ru>
> ---
> drivers/gpu/drm/mgag200/mgag200_g200se.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/mgag200/mgag200_g200se.c b/drivers/gpu/drm/mgag200/mgag200_g200se.c
> index 7a32d3b1d226..4d65ead63d66 100644
> --- a/drivers/gpu/drm/mgag200/mgag200_g200se.c
> +++ b/drivers/gpu/drm/mgag200/mgag200_g200se.c
> @@ -249,6 +249,9 @@ static int mgag200_g200se_04_pixpllc_atomic_check(struct drm_crtc *crtc,
> }
> }
>
> + if (m == 0)
> + return -EINVAL;
> +
> fvv = pllreffreq * n / m;
> fvv = (fvv - 800000) / 50000;
> if (fvv > 15)
> --
> 2.39.2
>
Powered by blists - more mailing lists