diff mbox

drm/radeon: update lockup tracking when scheduling in empty ring

Message ID 1371650548-1896-1-git-send-email-j.glisse@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jerome Glisse June 19, 2013, 2:02 p.m. UTC
From: Jerome Glisse <jglisse@redhat.com>

There might be issue with lockup detection when scheduling on an
empty ring that have been sitting idle for a while. Thus update
the lockup tracking data when scheduling new work in an empty ring.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Tested-by: Andy Lutomirski <luto@amacapital.net>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/radeon/radeon_ring.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Christian König June 19, 2013, 2:56 p.m. UTC | #1
Am 19.06.2013 16:02, schrieb j.glisse@gmail.com:
> From: Jerome Glisse <jglisse@redhat.com>
>
> There might be issue with lockup detection when scheduling on an
> empty ring that have been sitting idle for a while. Thus update
> the lockup tracking data when scheduling new work in an empty ring.
>
> Signed-off-by: Jerome Glisse <jglisse@redhat.com>
> Tested-by: Andy Lutomirski <luto@amacapital.net>
> Cc: stable@vger.kernel.org

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/radeon/radeon_ring.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
> index e17faa7..82434018 100644
> --- a/drivers/gpu/drm/radeon/radeon_ring.c
> +++ b/drivers/gpu/drm/radeon/radeon_ring.c
> @@ -402,6 +402,13 @@ int radeon_ring_alloc(struct radeon_device *rdev, struct radeon_ring *ring, unsi
>   		return -ENOMEM;
>   	/* Align requested size with padding so unlock_commit can
>   	 * pad safely */
> +	radeon_ring_free_size(rdev, ring);
> +	if (ring->ring_free_dw == (ring->ring_size / 4)) {
> +		/* This is an empty ring update lockup info to avoid
> +		 * false positive.
> +		 */
> +		radeon_ring_lockup_update(ring);
> +	}
>   	ndw = (ndw + ring->align_mask) & ~ring->align_mask;
>   	while (ndw > (ring->ring_free_dw - 1)) {
>   		radeon_ring_free_size(rdev, ring);
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_ring.c b/drivers/gpu/drm/radeon/radeon_ring.c
index e17faa7..82434018 100644
--- a/drivers/gpu/drm/radeon/radeon_ring.c
+++ b/drivers/gpu/drm/radeon/radeon_ring.c
@@ -402,6 +402,13 @@  int radeon_ring_alloc(struct radeon_device *rdev, struct radeon_ring *ring, unsi
 		return -ENOMEM;
 	/* Align requested size with padding so unlock_commit can
 	 * pad safely */
+	radeon_ring_free_size(rdev, ring);
+	if (ring->ring_free_dw == (ring->ring_size / 4)) {
+		/* This is an empty ring update lockup info to avoid
+		 * false positive.
+		 */
+		radeon_ring_lockup_update(ring);
+	}
 	ndw = (ndw + ring->align_mask) & ~ring->align_mask;
 	while (ndw > (ring->ring_free_dw - 1)) {
 		radeon_ring_free_size(rdev, ring);