From: Jocelyn Falempe <jfalempe@redhat.com>
To: Murad Masimov <m.masimov@maxima.ru>, Dave Airlie <airlied@redhat.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Mathieu Larouche <mathieu.larouche@matrox.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
lvc-project@linuxtesting.org
Subject: Re: [PATCH v3] drm/mgag200: Apply upper limit for clock variable
Date: Fri, 15 Nov 2024 15:35:51 +0100 [thread overview]
Message-ID: <4a6d4704-27a2-457a-8b7b-3b306539bc6d@redhat.com> (raw)
In-Reply-To: <20241115141449.709-1-m.masimov@maxima.ru>
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@redhat.com>
>
> Fixes: e829d7ef9f17 ("drm/mgag200: Add support for a new rev of G200e")
> Signed-off-by: Murad Masimov <m.masimov@maxima.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
>
prev parent reply other threads:[~2024-11-15 14:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-15 14:14 Murad Masimov
2024-11-15 14:35 ` Jocelyn Falempe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4a6d4704-27a2-457a-8b7b-3b306539bc6d@redhat.com \
--to=jfalempe@redhat.com \
--cc=airlied@gmail.com \
--cc=airlied@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=m.masimov@maxima.ru \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mathieu.larouche@matrox.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®