From: Chunming Zhou <David1.Zhou-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Chunming Zhou <David1.Zhou-5C7GfCeVMHo@public.gmane.org>
Subject: [PATCH 01/11] drm/amdgpu: hw ring should be empty when gpu reset
Date: Tue, 2 Aug 2016 15:51:32 +0800 [thread overview]
Message-ID: <1470124302-23615-2-git-send-email-David1.Zhou@amd.com> (raw)
In-Reply-To: <1470124302-23615-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
Change-Id: I08ca5a805f590cc7aad0e9ccd91bd5925bb216e2
Signed-off-by: Chunming Zhou <David1.Zhou@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
---
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 +
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 11 +++++++++++
3 files changed, 13 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index c0e4164..a0dea0d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1253,6 +1253,7 @@ int amdgpu_ib_ring_tests(struct amdgpu_device *adev);
int amdgpu_ring_alloc(struct amdgpu_ring *ring, unsigned ndw);
void amdgpu_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count);
void amdgpu_ring_generic_pad_ib(struct amdgpu_ring *ring, struct amdgpu_ib *ib);
+void amdgpu_ring_reset(struct amdgpu_ring *ring);
void amdgpu_ring_commit(struct amdgpu_ring *ring);
void amdgpu_ring_undo(struct amdgpu_ring *ring);
int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 5e984cf..b470e5a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2117,6 +2117,7 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)
continue;
kthread_park(ring->sched.thread);
amd_sched_hw_job_reset(&ring->sched);
+ amdgpu_ring_reset(ring);
}
/* after all hw jobs are reset, hw fence is meaningless, so force_completion */
amdgpu_fence_driver_force_completion(adev);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 9989e25..75e1da6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -110,6 +110,17 @@ void amdgpu_ring_generic_pad_ib(struct amdgpu_ring *ring, struct amdgpu_ib *ib)
ib->ptr[ib->length_dw++] = ring->nop;
}
+void amdgpu_ring_reset(struct amdgpu_ring *ring)
+{
+ u32 rptr = amdgpu_ring_get_rptr(ring);
+
+ ring->wptr = rptr;
+ ring->wptr &= ring->ptr_mask;
+
+ mb();
+ amdgpu_ring_set_wptr(ring);
+}
+
/**
* amdgpu_ring_commit - tell the GPU to execute the new
* commands on the ring buffer
--
1.9.1
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2016-08-02 7:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-02 7:51 [PATCH 00/11] add recovery entity and run queue Chunming Zhou
[not found] ` <1470124302-23615-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2016-08-02 7:51 ` Chunming Zhou [this message]
2016-08-02 7:51 ` [PATCH 02/11] drm/amdgpu: specify entity to amdgpu_copy_buffer Chunming Zhou
2016-08-02 7:51 ` [PATCH 03/11] drm/amd: add recover run queue for scheduler Chunming Zhou
2016-08-02 7:51 ` [PATCH 04/11] drm/amdgpu: fix vm init error path Chunming Zhou
2016-08-02 7:51 ` [PATCH 05/11] drm/amdgpu: add vm recover entity Chunming Zhou
2016-08-02 7:51 ` [PATCH 06/11] drm/amdgpu: use all pte rings to recover page table Chunming Zhou
2016-08-02 7:51 ` [PATCH 07/11] drm/amd: add recover entity for every scheduler Chunming Zhou
2016-08-02 7:51 ` [PATCH 08/11] drm/amd: use scheduler to recover hw jobs Chunming Zhou
2016-08-02 7:51 ` [PATCH 09/11] drm/amd: hw job list should be exact Chunming Zhou
2016-08-02 7:51 ` [PATCH 10/11] drm/amd: reset jobs to recover entity Chunming Zhou
2016-08-02 7:51 ` [PATCH 11/11] drm/amdgpu: no need fence wait every time Chunming Zhou
2016-08-03 12:16 ` [PATCH 00/11] add recovery entity and run queue Edward O'Callaghan
[not found] ` <88bda920-4da2-7115-a82c-c0b1f581603e-dczkZgxz+BNUPWh3PAxdjQ@public.gmane.org>
2016-08-04 2:44 ` zhoucm1
[not found] ` <57A2AC23.7090709-5C7GfCeVMHo@public.gmane.org>
2016-08-05 10:16 ` Edward O'Callaghan
-- strict thread matches above, loose matches on Subject: below --
2016-07-28 10:13 [PATCH 00/11] add recovery entity Chunming Zhou
[not found] ` <1469700828-25650-1-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2016-07-28 10:13 ` [PATCH 01/11] drm/amdgpu: hw ring should be empty when gpu reset Chunming Zhou
[not found] ` <1469700828-25650-2-git-send-email-David1.Zhou-5C7GfCeVMHo@public.gmane.org>
2016-07-30 3:53 ` Edward O'Callaghan
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=1470124302-23615-2-git-send-email-David1.Zhou@amd.com \
--to=david1.zhou-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
/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.