AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdkfd: Restore all process on post reset
@ 2021-07-28 17:31 Eric Huang
  2021-07-30 21:26 ` Felix Kuehling
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Huang @ 2021-07-28 17:31 UTC (permalink / raw)
  To: amd-gfx; +Cc: Eric Huang

It is to fix a bug of gpu_recovery on multiple GPUs,
When one gpu is reset, the application running on other
gpu hangs, because kfd post reset doesn't restore the
running process. And it also fixes a bug in the function
kfd_process_evict_queues, when one gpu hangs, process
running on other gpus can't be evicted.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_device.c  |  2 +-
 drivers/gpu/drm/amd/amdkfd/kfd_process.c | 24 +-----------------------
 2 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
index 24b5e0aa1eac..daf1c19bd799 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
@@ -984,7 +984,7 @@ int kgd2kfd_post_reset(struct kfd_dev *kfd)
 	if (!kfd->init_complete)
 		return 0;
 
-	ret = kfd_resume(kfd);
+	ret = kgd2kfd_resume(kfd, false, true);
 	if (ret)
 		return ret;
 	atomic_dec(&kfd_locked);
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
index 38a9dee40785..9272a12c1db8 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
@@ -1879,36 +1879,14 @@ int kfd_process_evict_queues(struct kfd_process *p)
 {
 	int r = 0;
 	int i;
-	unsigned int n_evicted = 0;
 
 	for (i = 0; i < p->n_pdds; i++) {
 		struct kfd_process_device *pdd = p->pdds[i];
 
 		r = pdd->dev->dqm->ops.evict_process_queues(pdd->dev->dqm,
 							    &pdd->qpd);
-		if (r) {
+		if (r)
 			pr_err("Failed to evict process queues\n");
-			goto fail;
-		}
-		n_evicted++;
-	}
-
-	return r;
-
-fail:
-	/* To keep state consistent, roll back partial eviction by
-	 * restoring queues
-	 */
-	for (i = 0; i < p->n_pdds; i++) {
-		struct kfd_process_device *pdd = p->pdds[i];
-
-		if (n_evicted == 0)
-			break;
-		if (pdd->dev->dqm->ops.restore_process_queues(pdd->dev->dqm,
-							      &pdd->qpd))
-			pr_err("Failed to restore queues\n");
-
-		n_evicted--;
 	}
 
 	return r;
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-03 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-28 17:31 [PATCH] drm/amdkfd: Restore all process on post reset Eric Huang
2021-07-30 21:26 ` Felix Kuehling
2021-08-03 15:02   ` Eric Huang
2021-08-03 15:38     ` Felix Kuehling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox