[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_OYYRmDKk1QGSCc+G5JwswycVF4EHcSPV_D0anTZadCjg@mail.gmail.com>
Date: Thu, 30 Nov 2023 12:12:08 -0500
From: Alex Deucher <alexdeucher@...il.com>
To: Nikita Zhandarovich <n.zhandarovich@...tech.ru>
Cc: Alex Deucher <alexander.deucher@....com>,
"Pan, Xinhui" <Xinhui.Pan@....com>, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
Dave Airlie <airlied@...hat.com>, lvc-project@...uxtesting.org
Subject: Re: [PATCH] drm/radeon: check return value of radeon_ring_lock()
Applied. Thanks!
On Tue, Aug 8, 2023 at 2:08 PM Nikita Zhandarovich
<n.zhandarovich@...tech.ru> wrote:
>
> In the unlikely event of radeon_ring_lock() failing, its errno return
> value should be processed. This patch checks said return value and
> prints a debug message in case of an error.
>
> Found by Linux Verification Center (linuxtesting.org) with static
> analysis tool SVACE.
>
> Fixes: 48c0c902e2e6 ("drm/radeon/kms: add support for CP setup on SI")
> Signed-off-by: Nikita Zhandarovich <n.zhandarovich@...tech.ru>
> ---
> drivers/gpu/drm/radeon/si.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
> index 8d5e4b25609d..df1b2ebc37c2 100644
> --- a/drivers/gpu/drm/radeon/si.c
> +++ b/drivers/gpu/drm/radeon/si.c
> @@ -3611,6 +3611,10 @@ static int si_cp_start(struct radeon_device *rdev)
> for (i = RADEON_RING_TYPE_GFX_INDEX; i <= CAYMAN_RING_TYPE_CP2_INDEX; ++i) {
> ring = &rdev->ring[i];
> r = radeon_ring_lock(rdev, ring, 2);
> + if (r) {
> + DRM_ERROR("radeon: cp failed to lock ring (%d).\n", r);
> + return r;
> + }
>
> /* clear the compute context state */
> radeon_ring_write(ring, PACKET3_COMPUTE(PACKET3_CLEAR_STATE, 0));
> --
> 2.25.1
>
Powered by blists - more mailing lists