If GPU is during a resetting cycle, writing to GPU can cause unpredictable protection fault. Disallow using kfd debugfs hang_hws to hang hws if GPU is resetting. Signed-off-by: Oak Zeng <Oak.Zeng@xxxxxxx> --- drivers/gpu/drm/amd/amdkfd/kfd_device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index 9e4a05e..c380be9 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c @@ -1390,6 +1390,11 @@ int kfd_debugfs_hang_hws(struct kfd_dev *dev) return -EINVAL; } + if (dev->dqm->is_resetting) { + pr_err("HWS is already under resetting, please wait the current reset to finish\n"); + return -EBUSY; + } + r = pm_debugfs_hang_hws(&dev->dqm->packets); if (!r) r = dqm_debugfs_execute_queues(dev->dqm); -- 2.7.4 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx