From: "Christian König" <deathsimple@vodafone.de>
To: j.glisse@gmail.com
Cc: Jerome Glisse <jglisse@redhat.com>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/radeon: don't leave fence blocked process on failed GPU reset
Date: Mon, 17 Dec 2012 16:46:11 +0100 [thread overview]
Message-ID: <50CF3E43.6080102@vodafone.de> (raw)
In-Reply-To: <1355758146-7095-1-git-send-email-j.glisse@gmail.com>
On 17.12.2012 16:29, j.glisse@gmail.com wrote:
> From: Jerome Glisse <jglisse@redhat.com>
>
> Force all fence to signal if GPU reset failed so no process get stuck
> on waiting fence.
>
> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Seems to make sense.
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/radeon/radeon.h | 1 +
> drivers/gpu/drm/radeon/radeon_device.c | 1 +
> drivers/gpu/drm/radeon/radeon_fence.c | 19 +++++++++++++++++++
> 3 files changed, 21 insertions(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
> index 5d68346..9c7625c 100644
> --- a/drivers/gpu/drm/radeon/radeon.h
> +++ b/drivers/gpu/drm/radeon/radeon.h
> @@ -225,6 +225,7 @@ struct radeon_fence {
> int radeon_fence_driver_start_ring(struct radeon_device *rdev, int ring);
> int radeon_fence_driver_init(struct radeon_device *rdev);
> void radeon_fence_driver_fini(struct radeon_device *rdev);
> +void radeon_fence_driver_force_completion(struct radeon_device *rdev);
> int radeon_fence_emit(struct radeon_device *rdev, struct radeon_fence **fence, int ring);
> void radeon_fence_process(struct radeon_device *rdev, int ring);
> bool radeon_fence_signaled(struct radeon_fence *fence);
> diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
> index e2f5f88..774fae7 100644
> --- a/drivers/gpu/drm/radeon/radeon_device.c
> +++ b/drivers/gpu/drm/radeon/radeon_device.c
> @@ -1357,6 +1357,7 @@ retry:
> }
> }
> } else {
> + radeon_fence_driver_force_completion(rdev);
> for (i = 0; i < RADEON_NUM_RINGS; ++i) {
> kfree(ring_data[i]);
> }
> diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
> index 22bd6c2..bf7b20e 100644
> --- a/drivers/gpu/drm/radeon/radeon_fence.c
> +++ b/drivers/gpu/drm/radeon/radeon_fence.c
> @@ -868,6 +868,25 @@ void radeon_fence_driver_fini(struct radeon_device *rdev)
> mutex_unlock(&rdev->ring_lock);
> }
>
> +/**
> + * radeon_fence_driver_force_completion - force all fence waiter to complete
> + *
> + * @rdev: radeon device pointer
> + *
> + * In case of GPU reset failure make sure no process keep waiting on fence
> + * that will never complete.
> + */
> +void radeon_fence_driver_force_completion(struct radeon_device *rdev)
> +{
> + int ring;
> +
> + for (ring = 0; ring < RADEON_NUM_RINGS; ring++) {
> + if (!rdev->fence_drv[ring].initialized)
> + continue;
> + radeon_fence_write(rdev, rdev->fence_drv[ring].sync_seq[ring], ring);
> + }
> +}
> +
>
> /*
> * Fence debugfs
next prev parent reply other threads:[~2012-12-17 15:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-17 15:29 [PATCH] drm/radeon: don't leave fence blocked process on failed GPU reset j.glisse
2012-12-17 15:46 ` Christian König [this message]
2012-12-17 21:39 ` Alex Deucher
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=50CF3E43.6080102@vodafone.de \
--to=deathsimple@vodafone.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=j.glisse@gmail.com \
--cc=jglisse@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.