[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_Mzn3FO8vu5TtTLZxbjighaQ6MJ__5AeuNNRsJhTgnuUA@mail.gmail.com>
Date: Mon, 6 Aug 2018 16:29:29 -0400
From: Alex Deucher <alexdeucher@...il.com>
To: Jia-Ju Bai <baijiaju1990@...il.com>
Cc: "Deucher, Alexander" <alexander.deucher@....com>,
Christian Koenig <christian.koenig@....com>,
Chunming Zhou <David1.Zhou@....com>,
Dave Airlie <airlied@...ux.ie>,
Maling list - DRI developers
<dri-devel@...ts.freedesktop.org>,
amd-gfx list <amd-gfx@...ts.freedesktop.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpu: drm: radeon: radeon_test: Replace mdelay() with msleep()
On Fri, Aug 3, 2018 at 8:01 PM, Jia-Ju Bai <baijiaju1990@...il.com> wrote:
> radeon_test_ring_sync() and radeon_test_ring_sync2() are never
> called in atomic context.
> They call mdelay() to busily wait, which is not necessary.
> mdelay() can be replaced with msleep().
>
> This is found by a static analysis tool named DCNS written by myself.
>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@...il.com>
Applied. thanks!
Alex
> ---
> drivers/gpu/drm/radeon/radeon_test.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_test.c b/drivers/gpu/drm/radeon/radeon_test.c
> index f5e9abfadb56..411efa303f54 100644
> --- a/drivers/gpu/drm/radeon/radeon_test.c
> +++ b/drivers/gpu/drm/radeon/radeon_test.c
> @@ -347,7 +347,7 @@ void radeon_test_ring_sync(struct radeon_device *rdev,
> if (r)
> goto out_cleanup;
>
> - mdelay(1000);
> + msleep(1000);
>
> if (radeon_fence_signaled(fence1)) {
> DRM_ERROR("Fence 1 signaled without waiting for semaphore.\n");
> @@ -368,7 +368,7 @@ void radeon_test_ring_sync(struct radeon_device *rdev,
> goto out_cleanup;
> }
>
> - mdelay(1000);
> + msleep(1000);
>
> if (radeon_fence_signaled(fence2)) {
> DRM_ERROR("Fence 2 signaled without waiting for semaphore.\n");
> @@ -441,7 +441,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev,
> if (r)
> goto out_cleanup;
>
> - mdelay(1000);
> + msleep(1000);
>
> if (radeon_fence_signaled(fenceA)) {
> DRM_ERROR("Fence A signaled without waiting for semaphore.\n");
> @@ -461,7 +461,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev,
> radeon_ring_unlock_commit(rdev, ringC, false);
>
> for (i = 0; i < 30; ++i) {
> - mdelay(100);
> + msleep(100);
> sigA = radeon_fence_signaled(fenceA);
> sigB = radeon_fence_signaled(fenceB);
> if (sigA || sigB)
> @@ -486,7 +486,7 @@ static void radeon_test_ring_sync2(struct radeon_device *rdev,
> radeon_semaphore_emit_signal(rdev, ringC->idx, semaphore);
> radeon_ring_unlock_commit(rdev, ringC, false);
>
> - mdelay(1000);
> + msleep(1000);
>
> r = radeon_fence_wait(fenceA, false);
> if (r) {
> --
> 2.17.0
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Powered by blists - more mailing lists