diff mbox series

drm/i915: Drain freed object after suspend display

Message ID 20220629134721.48375-1-jose.souza@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Drain freed object after suspend display | expand

Commit Message

Souza, Jose June 29, 2022, 1:47 p.m. UTC
Display is turned off by i915_drm_suspend() during the suspend
procedure, removing the last reference of some gem objects that were
used by display.

The issue is that those objects are only actually freed when
mm.free_work executed and that can happen very late in the suspend
process causing issues.
So here draining all freed objects released by display fixing suspend
issues.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/i915/i915_driver.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Matt Atwood June 29, 2022, 10:11 p.m. UTC | #1
On Wed, Jun 29, 2022 at 06:47:21AM -0700, José Roberto de Souza wrote:
> Display is turned off by i915_drm_suspend() during the suspend
> procedure, removing the last reference of some gem objects that were
> used by display.
> 
> The issue is that those objects are only actually freed when
> mm.free_work executed and that can happen very late in the suspend
> process causing issues.
> So here draining all freed objects released by display fixing suspend
> issues.
> 
Reviewed-by: Matt Atwood <matthew.s.atwood@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_driver.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index 6e5849c1086f6..aa2a5ea30c7bb 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -1186,6 +1186,8 @@ static int i915_drm_suspend(struct drm_device *dev)
>  
>  	enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
>  
> +	i915_gem_drain_freed_objects(dev_priv);
> +
>  	return 0;
>  }
>  
> -- 
> 2.37.0
>
Andrzej Hajda June 30, 2022, 2:26 p.m. UTC | #2
On 29.06.2022 15:47, José Roberto de Souza wrote:
> Display is turned off by i915_drm_suspend() during the suspend
> procedure, removing the last reference of some gem objects that were
> used by display.
> 
> The issue is that those objects are only actually freed when
> mm.free_work executed and that can happen very late in the suspend
> process causing issues.
> So here draining all freed objects released by display fixing suspend
> issues.

Describing the issues would be helpful, alternatively bug tracker 
reference if any.

> 
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Anyway:
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej


> ---
>   drivers/gpu/drm/i915/i915_driver.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index 6e5849c1086f6..aa2a5ea30c7bb 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -1186,6 +1186,8 @@ static int i915_drm_suspend(struct drm_device *dev)
>   
>   	enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
>   
> +	i915_gem_drain_freed_objects(dev_priv);
> +
>   	return 0;
>   }
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index 6e5849c1086f6..aa2a5ea30c7bb 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -1186,6 +1186,8 @@  static int i915_drm_suspend(struct drm_device *dev)
 
 	enable_rpm_wakeref_asserts(&dev_priv->runtime_pm);
 
+	i915_gem_drain_freed_objects(dev_priv);
+
 	return 0;
 }