Skip to contentSkip to conversation

drm/i915: don't update the dri1 breadcrumb with modesetting

PATCH In review Daniel Vetter 4 participants 5 messages Dec 10, 2013 – Dec 11, 2013

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

PATCH 1/1 drm/i915: don't update the dri1 breadcrumb with modesetting

The update is horribly racy since it doesn't protect at all against concurrent closing of the master fd. And it can't really since that requires us to grab a mutex.

Instead of jumping through hoops and offloading this to a worker thread just block this bit of code for the modesetting driver.

---
 drivers/gpu/drm/i915/i915_dma.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/i915_dma.c +3 -0
index 197db0993a24..0a42e2f7bcf8 100644
@@ -83,6 +83,9 @@ void i915_update_dri1_breadcrumb(struct drm_device *dev)
 	drm_i915_private_t *dev_priv = dev->dev_private;
 	struct drm_i915_master_private *master_priv;
 
+	if (drm_core_check_feature(dev, DRIVER_MODESET))
+		return;
+
 	if (dev->primary->master) {
 		master_priv = dev->primary->master->driver_priv;
 		if (master_priv->sarea_priv)
Signature · 1 line
1.8.4.3
#1 lore raw
Quoted 11 lines · Daniel Vetter

The update is horribly racy since it doesn't protect at all against concurrent closing of the master fd. And it can't really since that requires us to grab a mutex.

Instead of jumping through hoops and offloading this to a worker thread just block this bit of code for the modesetting driver.

We should also not be calling update_dri1_breadcrumb unless we have a USER_INTERRUPT. The other updates to the breadcrumb hws index do not appear to be serialised by anything other than polling. -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#2 lore raw
Quoted 8 lines · Chris Wilson
Quoted 7 lines · Daniel Vetter

The update is horribly racy since it doesn't protect at all against concurrent closing of the master fd. And it can't really since that requires us to grab a mutex.

Instead of jumping through hoops and offloading this to a worker thread just block this bit of code for the modesetting driver.

Quoted 8 lines
Quoted 4 lines

We should also not be calling update_dri1_breadcrumb unless we have a USER_INTERRUPT. The other updates to the breadcrumb hws index do not appear to be serialised by anything other than polling.

Well, this is what's been there before and I don't really want to touch dri1/ums code at all. So I think we'll just keep this here until we'll all put it on the big pyre ;-)
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw
Quoted 14 lines · Daniel Vetter
Quoted 13 lines · Chris Wilson
Quoted 11 lines · Daniel Vetter

The update is horribly racy since it doesn't protect at all against concurrent closing of the master fd. And it can't really since that requires us to grab a mutex.

Instead of jumping through hoops and offloading this to a worker thread just block this bit of code for the modesetting driver.

Quoted 7 lines
Quoted 3 lines

We should also not be calling update_dri1_breadcrumb unless we have a USER_INTERRUPT. The other updates to the breadcrumb hws index do not appear to be serialised by anything other than polling.

Well, this is what's been there before and I don't really want to touch dri1/ums code at all. So I think we'll just keep this here until we'll all put it on the big pyre ;-)

Chris and I discusssed the commit message a bit on irc and now the hack also spurts a code comment. Merged to -fixes for now, but I'd still like to get a tested by from Eugene before sending off the pull request. -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#4 lore raw
Quoted 19 lines · Daniel Vetter
Quoted 18 lines · Daniel Vetter
Quoted 16 lines · Chris Wilson
Quoted 11 lines · Daniel Vetter

The update is horribly racy since it doesn't protect at all against concurrent closing of the master fd. And it can't really since that requires us to grab a mutex.

Instead of jumping through hoops and offloading this to a worker thread just block this bit of code for the modesetting driver.

We should also not be calling update_dri1_breadcrumb unless we have a USER_INTERRUPT. The other updates to the breadcrumb hws index do not appear to be serialised by anything other than polling.

Quoted 9 lines
Quoted 3 lines

Well, this is what's been there before and I don't really want to touch dri1/ums code at all. So I think we'll just keep this here until we'll all put it on the big pyre ;-)

Chris and I discusssed the commit message a bit on irc and now the hack also spurts a code comment. Merged to -fixes for now, but I'd still like to get a tested by from Eugene before sending off the pull request. -Daniel

Built 3.10.23 with the fix, tested today. The problem has not shown up so far.

Signature · 2 lines
Eugene Shatokhin, ROSA Laboratory.
www.rosalab.com