[Intel-xe] [PATCH v10 9/9] drm/xe/debugfs: grab mem_access around forcewake

Rodrigo Vivi rodrigo.vivi at kernel.org
Wed May 24 19:32:13 UTC 2023


On Wed, May 24, 2023 at 06:57:01PM +0100, Matthew Auld wrote:
> It looks like we need keep the device awake when holding the forcewake.

or maybe around any mmio operation. But this looks good for now
to close that gap.

> 
> References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/279

Closes: ?

> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi at intel.com>


> ---
>  drivers/gpu/drm/xe/xe_debugfs.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
> index 7827a785b020..047341d5689a 100644
> --- a/drivers/gpu/drm/xe/xe_debugfs.c
> +++ b/drivers/gpu/drm/xe/xe_debugfs.c
> @@ -70,6 +70,8 @@ static int forcewake_open(struct inode *inode, struct file *file)
>  	struct xe_gt *gt;
>  	u8 id;
>  
> +	xe_device_mem_access_get(xe);
> +
>  	for_each_gt(gt, xe, id)
>  		XE_WARN_ON(xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL));
>  
> @@ -85,6 +87,8 @@ static int forcewake_release(struct inode *inode, struct file *file)
>  	for_each_gt(gt, xe, id)
>  		XE_WARN_ON(xe_force_wake_put(gt_to_fw(gt), XE_FORCEWAKE_ALL));
>  
> +	xe_device_mem_access_put(xe);
> +
>  	return 0;
>  }
>  
> -- 
> 2.40.1
> 


More information about the Intel-xe mailing list