Skip to contentSkip to conversation

Revert "drm/i915: Make prepare_plane_fb fully interruptible."

PATCH In review [email protected] 4 participants 8 messages Oct 30, 2015 – Nov 18, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "drm/i915: Make prepare_plane_fb fully interruptible."

From: Ville Syrjälä <[email protected]>

This reverts commit b26a6b35581c84124bd78b68cc02d171fbd572c9.

commit b26a6b35581c ("drm/i915: Make prepare_plane_fb fully interruptible.") breaks GPU reset on gen3/4 machines. Go back to to non-interruptible.

Cc Maarten Lankhorst <[email protected]>
Cc Ander Conselvan de Oliveira <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_display.c +6 -5
index 7687708..2b70151 100644
@@ -2386,10 +2386,11 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
 	 */
 	intel_runtime_pm_get(dev_priv);
 
+	dev_priv->mm.interruptible = false;
 	ret = i915_gem_object_pin_to_display_plane(obj, alignment, pipelined,
 						   pipelined_request, &view);
 	if (ret)
-		goto err_pm;
+		goto err_interruptible;
 
 	/* Install a fence for tiled scan-out. Pre-i965 always needs a
 	 * fence, whereas 965+ only requires a fence if using
@@ -2413,12 +2414,14 @@ intel_pin_and_fence_fb_obj(struct drm_plane *plane,
 
 	i915_gem_object_pin_fence(obj);
 
+	dev_priv->mm.interruptible = true;
 	intel_runtime_pm_put(dev_priv);
 	return 0;
 
 err_unpin:
 	i915_gem_object_unpin_from_display_plane(obj, &view);
-err_pm:
+err_interruptible:
+	dev_priv->mm.interruptible = true;
 	intel_runtime_pm_put(dev_priv);
 	return ret;
 }
@@ -13487,9 +13490,7 @@ intel_prepare_plane_fb(struct drm_plane *plane,
 	if (!obj && !old_obj)
 		return 0;
 
-	ret = i915_mutex_lock_interruptible(dev);
-	if (ret)
-		return ret;
+	mutex_lock(&dev->struct_mutex);
 
 	if (!obj) {
 		ret = 0;
Signature · 6 lines
2.4.10

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

Hey,

Op 30-10-15 om 22:06 schreef [email protected]:

Quoted 6 lines

From: Ville Syrjälä <[email protected]>

This reverts commit b26a6b35581c84124bd78b68cc02d171fbd572c9.

commit b26a6b35581c ("drm/i915: Make prepare_plane_fb fully interruptible.") breaks GPU reset on gen3/4 machines. Go back to to non-interruptible.

More context please? I don't think reverting is the way to go here.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to [email protected]

Hey,

Op 30-10-15 om 22:06 schreef [email protected]:

Quoted 7 lines

From: Ville Syrjälä <[email protected]>

This reverts commit b26a6b35581c84124bd78b68cc02d171fbd572c9.

commit b26a6b35581c ("drm/i915: Make prepare_plane_fb fully interruptible.") breaks GPU reset on gen3/4 machines. Go back to to non-interruptible.

I've done some digging and by forcing an unconditional modeset during reset I was able to trigger it on my system. It should be fixed by applying the rest of the interruptible series so we can mask EIO, followed by replacing i915_mutex_lock_interruptible with mutex_lock_interruptible so there will be no waiting for gpu reset. This is what's causing the deadlock here. :)

~Maarten

drivers/gpu/drm/i915/intel_display.c +9 -2
index 22c0f8a54053..df6dbbc85855 100644
@@ -3207,9 +3207,11 @@ void intel_prepare_reset(struct drm_device *dev)
 	if (IS_GEN2(dev))
 		return;
 
+#if 0
 	/* reset doesn't touch the display */
 	if (INTEL_INFO(dev)->gen >= 5 || IS_G4X(dev))
 		return;
+#endif
 
 	drm_modeset_lock_all(dev);
 	/*
@@ -3245,7 +3247,12 @@ void intel_finish_reset(struct drm_device *dev)
 		 * FIXME: Atomic will make this obsolete since we won't schedule
 		 * CS-based flips (which might get lost in gpu resets) any more.
 		 */
+#if 0
 		intel_update_primary_planes(dev);
+#else
+		intel_display_resume(dev);
+		drm_modeset_unlock_all(dev);
+#endif
 		return;
 	}
 
@@ -13174,12 +13181,12 @@ static int intel_atomic_prepare_commit(struct drm_device *dev,
 			flush_workqueue(dev_priv->wq);
 	}
 
-	ret = i915_mutex_lock_interruptible(dev);
+	ret = mutex_lock_interruptible(&dev->struct_mutex);
 	if (ret)
 		return ret;
 
 	ret = drm_atomic_helper_prepare_planes(dev, state);
-	if (!ret && !async) {
+	if (!ret && !async && !i915_reset_in_progress(&dev_priv->gpu_error)) {
 		u32 reset_counter;
 
 		reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
Quoted 11 lines · Maarten Lankhorst

Hey,

Op 30-10-15 om 22:06 schreef [email protected]:

Quoted 7 lines

From: Ville Syrjälä <[email protected]>

This reverts commit b26a6b35581c84124bd78b68cc02d171fbd572c9.

commit b26a6b35581c ("drm/i915: Make prepare_plane_fb fully interruptible.") breaks GPU reset on gen3/4 machines. Go back to to non-interruptible.

I've done some digging and by forcing an unconditional modeset during reset I was able to trigger it on my system.

Hmm, maybe we should add some kind of debug knob to do just that. That way we could test most of the gen3/4 reset path with gen5+.

I thought we already had that for load detection, but I may have imagined it considering that load detection seems to have been broken now for a while.

Quoted 50 lines

It should be fixed by applying the rest of the interruptible
series so we can mask EIO, followed by replacing i915_mutex_lock_interruptible with mutex_lock_interruptible so there will be no waiting for gpu reset. This is what's causing the deadlock here. :)

~Maarten

drivers/gpu/drm/i915/intel_display.c +9 -2
index 22c0f8a54053..df6dbbc85855 100644
@@ -3207,9 +3207,11 @@ void intel_prepare_reset(struct drm_device *dev)
 	if (IS_GEN2(dev))
 		return;
 
+#if 0
 	/* reset doesn't touch the display */
 	if (INTEL_INFO(dev)->gen >= 5 || IS_G4X(dev))
 		return;
+#endif
 
 	drm_modeset_lock_all(dev);
 	/*
@@ -3245,7 +3247,12 @@ void intel_finish_reset(struct drm_device *dev)
 		 * FIXME: Atomic will make this obsolete since we won't schedule
 		 * CS-based flips (which might get lost in gpu resets) any more.
 		 */
+#if 0
 		intel_update_primary_planes(dev);
+#else
+		intel_display_resume(dev);
+		drm_modeset_unlock_all(dev);
+#endif
 		return;
 	}
 
@@ -13174,12 +13181,12 @@ static int intel_atomic_prepare_commit(struct drm_device *dev,
 			flush_workqueue(dev_priv->wq);
 	}
 
-	ret = i915_mutex_lock_interruptible(dev);
+	ret = mutex_lock_interruptible(&dev->struct_mutex);
 	if (ret)
 		return ret;
 
 	ret = drm_atomic_helper_prepare_planes(dev, state);
-	if (!ret && !async) {
+	if (!ret && !async && !i915_reset_in_progress(&dev_priv->gpu_error)) {
 		u32 reset_counter;
 
 		reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 11 lines · Ville Syrjälä
Quoted 10 lines · Maarten Lankhorst

Hey,

Op 30-10-15 om 22:06 schreef [email protected]:

Quoted 7 lines

From: Ville Syrjälä <[email protected]>

This reverts commit b26a6b35581c84124bd78b68cc02d171fbd572c9.

commit b26a6b35581c ("drm/i915: Make prepare_plane_fb fully interruptible.") breaks GPU reset on gen3/4 machines. Go back to to non-interruptible.

Quoted 8 lines
Quoted 1 line

I've done some digging and by forcing an unconditional modeset during reset I was able to trigger it on my system.

Hmm, maybe we should add some kind of debug knob to do just that. That way we could test most of the gen3/4 reset path with gen5+.

I thought we already had that for load detection, but I may have imagined it considering that load detection seems to have been broken now for a while.

We still have it for load detect, including an igt. No one looks at igt results though :(

Maarten, can you please take care of both of these before pushing more atomic work? And I guess that means that we should apply the revert first. So Acked-by: Daniel Vetter <[email protected]> on the revert.

Cheers, Daniel

Quoted 59 lines
Quoted 51 lines

It should be fixed by applying the rest of the interruptible
series so we can mask EIO, followed by replacing i915_mutex_lock_interruptible with mutex_lock_interruptible so there will be no waiting for gpu reset. This is what's causing the deadlock here. :)

~Maarten

drivers/gpu/drm/i915/intel_display.c +9 -2
index 22c0f8a54053..df6dbbc85855 100644
@@ -3207,9 +3207,11 @@ void intel_prepare_reset(struct drm_device *dev)
 	if (IS_GEN2(dev))
 		return;
 
+#if 0
 	/* reset doesn't touch the display */
 	if (INTEL_INFO(dev)->gen >= 5 || IS_G4X(dev))
 		return;
+#endif
 
 	drm_modeset_lock_all(dev);
 	/*
@@ -3245,7 +3247,12 @@ void intel_finish_reset(struct drm_device *dev)
 		 * FIXME: Atomic will make this obsolete since we won't schedule
 		 * CS-based flips (which might get lost in gpu resets) any more.
 		 */
+#if 0
 		intel_update_primary_planes(dev);
+#else
+		intel_display_resume(dev);
+		drm_modeset_unlock_all(dev);
+#endif
 		return;
 	}
 
@@ -13174,12 +13181,12 @@ static int intel_atomic_prepare_commit(struct drm_device *dev,
 			flush_workqueue(dev_priv->wq);
 	}
 
-	ret = i915_mutex_lock_interruptible(dev);
+	ret = mutex_lock_interruptible(&dev->struct_mutex);
 	if (ret)
 		return ret;
 
 	ret = drm_atomic_helper_prepare_planes(dev, state);
-	if (!ret && !async) {
+	if (!ret && !async && !i915_reset_in_progress(&dev_priv->gpu_error)) {
 		u32 reset_counter;
 
 		reset_counter = atomic_read(&dev_priv->gpu_error.reset_counter);
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

Op 17-11-15 om 18:44 schreef Daniel Vetter:

Quoted 19 lines · Ville Syrjälä
Quoted 11 lines · Maarten Lankhorst
Quoted 10 lines

Hey,

Op 30-10-15 om 22:06 schreef [email protected]:

Quoted 7 lines

From: Ville Syrjälä <[email protected]>

This reverts commit b26a6b35581c84124bd78b68cc02d171fbd572c9.

commit b26a6b35581c ("drm/i915: Make prepare_plane_fb fully interruptible.") breaks GPU reset on gen3/4 machines. Go back to to non-interruptible.

Quoted 7 lines
Quoted 1 line

I've done some digging and by forcing an unconditional modeset during reset I was able to trigger it on my system.

Hmm, maybe we should add some kind of debug knob to do just that. That way we could test most of the gen3/4 reset path with gen5+.

I thought we already had that for load detection, but I may have imagined it considering that load detection seems to have been broken now for a while.

Quoted 9 lines

We still have it for load detect, including an igt. No one looks at igt results though :(

Maarten, can you please take care of both of these before pushing more atomic work? And I guess that means that we should apply the revert first. So Acked-by: Daniel Vetter <[email protected]> on the revert.

Cheers, Daniel

Reset is already fixed upstream so reverting wont help.

What igt is used for load detection then?
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw
Quoted 23 lines · Maarten Lankhorst

Op 17-11-15 om 18:44 schreef Daniel Vetter:

Quoted 22 lines · Ville Syrjälä
Quoted 11 lines · Maarten Lankhorst
Quoted 10 lines

Hey,

Op 30-10-15 om 22:06 schreef [email protected]:

Quoted 7 lines

From: Ville Syrjälä <[email protected]>

This reverts commit b26a6b35581c84124bd78b68cc02d171fbd572c9.

commit b26a6b35581c ("drm/i915: Make prepare_plane_fb fully interruptible.") breaks GPU reset on gen3/4 machines. Go back to to non-interruptible.

Quoted 7 lines
Quoted 1 line

I've done some digging and by forcing an unconditional modeset during reset I was able to trigger it on my system.

Hmm, maybe we should add some kind of debug knob to do just that. That way we could test most of the gen3/4 reset path with gen5+.

I thought we already had that for load detection, but I may have imagined it considering that load detection seems to have been broken now for a while.

We still have it for load detect, including an igt. No one looks at igt results though :(

Quoted 7 lines
Quoted 6 lines

Maarten, can you please take care of both of these before pushing more atomic work? And I guess that means that we should apply the revert first. So Acked-by: Daniel Vetter <[email protected]> on the revert.

Cheers, Daniel

Reset is already fixed upstream so reverting wont help.

Sorry, I missed that the patch landed already.

Quoted 1 line

What igt is used for load detection then?

We're missing it it seems. Iirc Ander was working on it, but only the debugfs part to force-enable load-detect logic was merged into the kernel. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw
Quoted 33 lines · Daniel Vetter
Quoted 32 lines · Maarten Lankhorst

Op 17-11-15 om 18:44 schreef Daniel Vetter:

Quoted 31 lines · Ville Syrjälä
Quoted 13 lines · Maarten Lankhorst
Quoted 12 lines

Hey,

Op 30-10-15 om 22:06 schreef [email protected]:

Quoted 9 lines

From: Ville Syrjälä <[email protected]>

This reverts commit b26a6b35581c84124bd78b68cc02d171fbd572c9.

commit b26a6b35581c ("drm/i915: Make prepare_plane_fb fully interruptible.")
breaks GPU reset on gen3/4 machines. Go back to to non -interruptible.

Quoted 8 lines
Quoted 2 lines

I've done some digging and by forcing an unconditional modeset during reset I was able to trigger it on my system.

Hmm, maybe we should add some kind of debug knob to do just that. That way we could test most of the gen3/4 reset path with gen5+.

I thought we already had that for load detection, but I may have imagined it considering that load detection seems to have been broken now for a while.

We still have it for load detect, including an igt. No one looks at igt results though :(

Maarten, can you please take care of both of these before pushing more atomic work? And I guess that means that we should apply the revert first. So Acked-by: Daniel Vetter <[email protected]> on the revert.

Cheers, Daniel

Quoted 8 lines
Quoted 1 line

Reset is already fixed upstream so reverting wont help.

Sorry, I missed that the patch landed already.

Quoted 1 line

What igt is used for load detection then?

We're missing it it seems. Iirc Ander was working on it, but only the debugfs part to force-enable load-detect logic was merged into the kernel.

That wasn't me. Perhaps it was Matt?

Ander
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx