public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/ttm: Abort suspend on i915_ttm_backup failure
@ 2022-08-31 16:18 Nirmoy Das
  2022-08-31 19:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/ttm: Abort suspend on i915_ttm_backup failure (rev2) Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Nirmoy Das @ 2022-08-31 16:18 UTC (permalink / raw)
  To: intel-gfx; +Cc: thomas.hellstrom, matthew.auld, dri-devel, chris.p.wilson

On system suspend when system memory is low then i915_gem_obj_copy_ttm()
could fail trying to backup a lmem obj. GEM_WARN_ON() is not enough,
suspend shouldn't continue if i915_ttm_backup() throws an error.

References: https://gitlab.freedesktop.org/drm/intel/-/issues/6529
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Suggested-by: Chris P Wilson <chris.p.wilson@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
index 9aad84059d56..6f5d5c0909b4 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
@@ -79,7 +79,12 @@ static int i915_ttm_backup(struct i915_gem_apply_to_region *apply,
 		goto out_no_populate;
 
 	err = i915_gem_obj_copy_ttm(backup, obj, pm_apply->allow_gpu, false);
-	GEM_WARN_ON(err);
+	if (err) {
+		drm_err(&i915->drm,
+			"Unable to copy from device to system memory, err:%d\n",
+			err);
+		goto out_no_populate;
+	}
 	ttm_bo_wait_ctx(backup_bo, &ctx);
 
 	obj->ttm.backup = backup;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [Intel-gfx] [PATCH] drm/i915/ttm: Abort suspend on i915_ttm_backup failure
@ 2022-08-29 12:04 Nirmoy Das
  2022-08-31 15:50 ` Matthew Auld
  0 siblings, 1 reply; 9+ messages in thread
From: Nirmoy Das @ 2022-08-29 12:04 UTC (permalink / raw)
  To: intel-gfx; +Cc: thomas.hellstrom, matthew.auld, dri-devel, chris.p.wilson

On system suspend when system memory is low then i915_gem_obj_copy_ttm()
could fail trying to backup a lmem obj. GEM_WARN_ON() is not enough,
suspend shouldn't continue if i915_ttm_backup() throws an error.

Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/6529
Suggested-by: Chris P Wilson <chris.p.wilson@intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
index 9aad84059d56..6f5d5c0909b4 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_pm.c
@@ -79,7 +79,12 @@ static int i915_ttm_backup(struct i915_gem_apply_to_region *apply,
 		goto out_no_populate;
 
 	err = i915_gem_obj_copy_ttm(backup, obj, pm_apply->allow_gpu, false);
-	GEM_WARN_ON(err);
+	if (err) {
+		drm_err(&i915->drm,
+			"Unable to copy from device to system memory, err:%d\n",
+			err);
+		goto out_no_populate;
+	}
 	ttm_bo_wait_ctx(backup_bo, &ctx);
 
 	obj->ttm.backup = backup;
-- 
2.35.1


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

end of thread, other threads:[~2022-09-01 17:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-31 16:18 [Intel-gfx] [PATCH] drm/i915/ttm: Abort suspend on i915_ttm_backup failure Nirmoy Das
2022-08-31 19:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/ttm: Abort suspend on i915_ttm_backup failure (rev2) Patchwork
2022-09-01 12:29 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-09-01 14:38   ` Das, Nirmoy
2022-09-01 15:57 ` [Intel-gfx] [PATCH] drm/i915/ttm: Abort suspend on i915_ttm_backup failure Andrzej Hajda
2022-09-01 17:23   ` Das, Nirmoy
  -- strict thread matches above, loose matches on Subject: below --
2022-08-29 12:04 Nirmoy Das
2022-08-31 15:50 ` Matthew Auld
2022-08-31 16:09   ` Das, Nirmoy

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