[PATCH] drm/amdkfd: Disallow debugfs to hang hws when GPU is resetting

Russell, Kent Kent.Russell at amd.com
Wed Jul 7 17:13:03 UTC 2021


[AMD Official Use Only]

Some slight grammar 

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Oak Zeng
> Sent: Wednesday, July 7, 2021 12:28 PM
> To: amd-gfx at lists.freedesktop.org
> Cc: Bai, Zoy (zoybai) <Zoy.Bai at amd.com>; Xu, Feifei <Feifei.Xu at amd.com>; Kuehling, Felix
> <Felix.Kuehling at amd.com>; Lazar, Lijo <Lijo.Lazar at amd.com>; Zeng, Oak
> <Oak.Zeng at amd.com>
> Subject: [PATCH] drm/amdkfd: Disallow debugfs to hang hws when GPU is resetting
> 
> 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 at amd.com>
> ---
>  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");

pr_err("HWS is already resetting, please wait for 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 at lists.freedesktop.org
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.or
> g%2Fmailman%2Flistinfo%2Famd-
> gfx&data=04%7C01%7Ckent.russell%40amd.com%7Cc5c011d6af3c424ef09708d941643
> c61%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637612721494784138%7CUnk
> nown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
> CI6Mn0%3D%7C3000&sdata=FnD7q%2BKiU82DCSQqMvgA8D6f%2FPS6hnQIBE7Q8tCh
> h7g%3D&reserved=0


More information about the amd-gfx mailing list