All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Move atomic state free from out of fence release
@ 2017-01-23 21:29 Chris Wilson
  2017-01-23 21:54 ` ✓ Fi.CI.BAT: success for " Patchwork
  2017-01-24  8:39 ` [PATCH] " Joonas Lahtinen
  0 siblings, 2 replies; 5+ messages in thread
From: Chris Wilson @ 2017-01-23 21:29 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter

Fences are required to support being released from under an atomic context.
The drm_atomic_state struct may take a mutex when being released and so
we cannot drop a reference to the drm_atomic_state from the fence release
path directly, and so we need to defer that unreference to a worker.

[  326.576697] WARNING: CPU: 2 PID: 366 at kernel/sched/core.c:7737 __might_sleep+0x5d/0x80
[  326.576816] do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffffc0359549>] intel_breadcrumbs_signaler+0x59/0x270 [i915]
[  326.576818] Modules linked in: rfcomm fuse snd_hda_codec_hdmi bnep snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device snd_timer input_leds led_class snd punit_atom_debug btusb btrtl btbcm btintel intel_rapl bluetooth i915 drm_kms_helper syscopyarea sysfillrect iwlwifi sysimgblt soundcore fb_sys_fops mei_txe cfg80211 drm pwm_lpss_platform pwm_lpss pinctrl_cherryview fjes acpi_pad parport_pc ppdev parport autofs4
[  326.576899] CPU: 2 PID: 366 Comm: i915/signal:0 Tainted: G     U          4.10.0-rc3-patser+ #5030
[  326.576902] Hardware name:                  /NUC5PPYB, BIOS PYBSWCEL.86A.0031.2015.0601.1712 06/01/2015
[  326.576905] Call Trace:
[  326.576920]  dump_stack+0x4d/0x6d
[  326.576926]  __warn+0xc0/0xe0
[  326.576931]  warn_slowpath_fmt+0x5a/0x80
[  326.577004]  ? intel_breadcrumbs_signaler+0x59/0x270 [i915]
[  326.577075]  ? intel_breadcrumbs_signaler+0x59/0x270 [i915]
[  326.577079]  __might_sleep+0x5d/0x80
[  326.577087]  mutex_lock+0x1b/0x40
[  326.577133]  drm_property_free_blob+0x1e/0x80 [drm]
[  326.577167]  ? drm_property_destroy+0xe0/0xe0 [drm]
[  326.577200]  drm_mode_object_unreference+0x5c/0x70 [drm]
[  326.577233]  drm_property_unreference_blob+0xe/0x10 [drm]
[  326.577260]  __drm_atomic_helper_crtc_destroy_state+0x14/0x40 [drm_kms_helper]
[  326.577278]  drm_atomic_helper_crtc_destroy_state+0x10/0x20 [drm_kms_helper]
[  326.577352]  intel_crtc_destroy_state+0x9/0x10 [i915]
[  326.577388]  drm_atomic_state_default_clear+0xea/0x1d0 [drm]
[  326.577462]  intel_atomic_state_clear+0xd/0x20 [i915]
[  326.577497]  drm_atomic_state_clear+0x1a/0x30 [drm]
[  326.577532]  __drm_atomic_state_free+0x13/0x60 [drm]
[  326.577607]  intel_atomic_commit_ready+0x6f/0x78 [i915]
[  326.577670]  i915_sw_fence_release+0x3a/0x50 [i915]
[  326.577733]  dma_i915_sw_fence_wake+0x39/0x80 [i915]
[  326.577741]  dma_fence_signal+0xda/0x120
[  326.577812]  ? intel_breadcrumbs_signaler+0x59/0x270 [i915]
[  326.577884]  intel_breadcrumbs_signaler+0xb1/0x270 [i915]
[  326.577889]  kthread+0x127/0x130
[  326.577961]  ? intel_engine_remove_wait+0x1a0/0x1a0 [i915]
[  326.577964]  ? kthread_stop+0x120/0x120
[  326.577970]  ret_from_fork+0x22/0x30

Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_drv.h      |  5 +++++
 drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++++++++++++++++--
 drivers/gpu/drm/i915/intel_drv.h     |  2 ++
 3 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index bf67884c61fa..67b09e26b464 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2279,6 +2279,11 @@ struct drm_i915_private {
 
 	struct i915_frontbuffer_tracking fb_tracking;
 
+	struct intel_atomic_helper {
+		struct llist_head free_list;
+		struct work_struct free_work;
+	} atomic_helper;
+
 	u16 orig_clock;
 
 	bool mchbar_need_disable;
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 66080aa8fb1b..5f695ba1de47 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14770,8 +14770,14 @@ intel_atomic_commit_ready(struct i915_sw_fence *fence,
 		break;
 
 	case FENCE_FREE:
-		drm_atomic_state_put(&state->base);
-		break;
+		{
+			struct intel_atomic_helper *helper =
+				&to_i915(state->base.dev)->atomic_helper;
+
+			if (llist_add(&state->freed, &helper->free_list))
+				schedule_work(&helper->free_work);
+			break;
+		}
 	}
 
 	return NOTIFY_DONE;
@@ -16653,6 +16659,18 @@ static void sanitize_watermarks(struct drm_device *dev)
 	drm_modeset_acquire_fini(&ctx);
 }
 
+static void intel_atomic_helper_free_state(struct work_struct *work)
+{
+	struct drm_i915_private *dev_priv =
+		container_of(work, typeof(*dev_priv), atomic_helper.free_work);
+	struct intel_atomic_state *state, *next;
+	struct llist_node *freed;
+
+	freed = llist_del_all(&dev_priv->atomic_helper.free_list);
+	llist_for_each_entry_safe(state, next, freed, freed)
+		drm_atomic_state_put(&state->base);
+}
+
 int intel_modeset_init(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = to_i915(dev);
@@ -16672,6 +16690,9 @@ int intel_modeset_init(struct drm_device *dev)
 
 	dev->mode_config.funcs = &intel_mode_funcs;
 
+	INIT_WORK(&dev_priv->atomic_helper.free_work,
+		  intel_atomic_helper_free_state);
+
 	intel_init_quirks(dev);
 
 	intel_init_pm(dev_priv);
@@ -17329,6 +17350,9 @@ void intel_modeset_cleanup(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = to_i915(dev);
 
+	flush_work(&dev_priv->atomic_helper.free_work);
+	WARN_ON(!llist_empty(&dev_priv->atomic_helper.free_list));
+
 	intel_disable_gt_powersave(dev_priv);
 
 	/*
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index d5d790a5e0a5..cc6740de2b73 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -371,6 +371,8 @@ struct intel_atomic_state {
 	struct skl_wm_values wm_results;
 
 	struct i915_sw_fence commit_ready;
+
+	struct llist_node freed;
 };
 
 struct intel_plane_state {
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for drm/i915: Move atomic state free from out of fence release
  2017-01-23 21:29 [PATCH] drm/i915: Move atomic state free from out of fence release Chris Wilson
@ 2017-01-23 21:54 ` Patchwork
  2017-01-24  8:39 ` [PATCH] " Joonas Lahtinen
  1 sibling, 0 replies; 5+ messages in thread
From: Patchwork @ 2017-01-23 21:54 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Move atomic state free from out of fence release
URL   : https://patchwork.freedesktop.org/series/18431/
State : success

== Summary ==

Series 18431v1 drm/i915: Move atomic state free from out of fence release
https://patchwork.freedesktop.org/api/1.0/series/18431/revisions/1/mbox/

Test kms_force_connector_basic:
        Subgroup force-connector-state:
                dmesg-warn -> PASS       (fi-snb-2520m)
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-c:
                dmesg-warn -> PASS       (fi-skl-6700hq)

fi-bdw-5557u     total:246  pass:232  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:246  pass:207  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:246  pass:224  dwarn:0   dfail:0   fail:0   skip:22 
fi-bxt-t5700     total:79   pass:66   dwarn:0   dfail:0   fail:0   skip:12 
fi-byt-j1900     total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:246  pass:227  dwarn:0   dfail:0   fail:0   skip:19 
fi-ivb-3520m     total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:246  pass:225  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u     total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:246  pass:226  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:246  pass:222  dwarn:3   dfail:0   fail:0   skip:21 
fi-skl-6770hq    total:246  pass:233  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:246  pass:215  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:246  pass:214  dwarn:0   dfail:0   fail:0   skip:32 

c34072a82a390d575f7f0394fcf92437898d75d3 drm-tip: 2017y-01m-23d-15h-54m-20s UTC integration manifest
355c84f drm/i915: Move atomic state free from out of fence release

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3586/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Move atomic state free from out of fence release
  2017-01-23 21:29 [PATCH] drm/i915: Move atomic state free from out of fence release Chris Wilson
  2017-01-23 21:54 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2017-01-24  8:39 ` Joonas Lahtinen
  2017-01-24  9:21   ` Chris Wilson
  2017-01-24 17:32   ` Chris Wilson
  1 sibling, 2 replies; 5+ messages in thread
From: Joonas Lahtinen @ 2017-01-24  8:39 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: Daniel Vetter

On ma, 2017-01-23 at 21:29 +0000, Chris Wilson wrote:
> Fences are required to support being released from under an atomic context.
> The drm_atomic_state struct may take a mutex when being released and so
> we cannot drop a reference to the drm_atomic_state from the fence release
> path directly, and so we need to defer that unreference to a worker.
> 
> [  326.576697] WARNING: CPU: 2 PID: 366 at kernel/sched/core.c:7737 __might_sleep+0x5d/0x80
> [  326.576816] do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffffc0359549>] intel_breadcrumbs_signaler+0x59/0x270 [i915]
> [  326.576818] Modules linked in: rfcomm fuse snd_hda_codec_hdmi bnep snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device snd_timer input_leds led_class snd punit_atom_debug btusb btrtl btbcm btintel intel_rapl bluetooth i915 drm_kms_helper syscopyarea sysfillrect iwlwifi sysimgblt soundcore fb_sys_fops mei_txe cfg80211 drm pwm_lpss_platform pwm_lpss pinctrl_cherryview fjes acpi_pad parport_pc ppdev parport autofs4
> [  326.576899] CPU: 2 PID: 366 Comm: i915/signal:0 Tainted: G     U          4.10.0-rc3-patser+ #5030
> [  326.576902] Hardware name:                  /NUC5PPYB, BIOS PYBSWCEL.86A.0031.2015.0601.1712 06/01/2015
> [  326.576905] Call Trace:
> [  326.576920]  dump_stack+0x4d/0x6d
> [  326.576926]  __warn+0xc0/0xe0
> [  326.576931]  warn_slowpath_fmt+0x5a/0x80
> [  326.577004]  ? intel_breadcrumbs_signaler+0x59/0x270 [i915]
> [  326.577075]  ? intel_breadcrumbs_signaler+0x59/0x270 [i915]
> [  326.577079]  __might_sleep+0x5d/0x80
> [  326.577087]  mutex_lock+0x1b/0x40
> [  326.577133]  drm_property_free_blob+0x1e/0x80 [drm]
> [  326.577167]  ? drm_property_destroy+0xe0/0xe0 [drm]
> [  326.577200]  drm_mode_object_unreference+0x5c/0x70 [drm]
> [  326.577233]  drm_property_unreference_blob+0xe/0x10 [drm]
> [  326.577260]  __drm_atomic_helper_crtc_destroy_state+0x14/0x40 [drm_kms_helper]
> [  326.577278]  drm_atomic_helper_crtc_destroy_state+0x10/0x20 [drm_kms_helper]
> [  326.577352]  intel_crtc_destroy_state+0x9/0x10 [i915]
> [  326.577388]  drm_atomic_state_default_clear+0xea/0x1d0 [drm]
> [  326.577462]  intel_atomic_state_clear+0xd/0x20 [i915]
> [  326.577497]  drm_atomic_state_clear+0x1a/0x30 [drm]
> [  326.577532]  __drm_atomic_state_free+0x13/0x60 [drm]
> [  326.577607]  intel_atomic_commit_ready+0x6f/0x78 [i915]
> [  326.577670]  i915_sw_fence_release+0x3a/0x50 [i915]
> [  326.577733]  dma_i915_sw_fence_wake+0x39/0x80 [i915]
> [  326.577741]  dma_fence_signal+0xda/0x120
> [  326.577812]  ? intel_breadcrumbs_signaler+0x59/0x270 [i915]
> [  326.577884]  intel_breadcrumbs_signaler+0xb1/0x270 [i915]
> [  326.577889]  kthread+0x127/0x130
> [  326.577961]  ? intel_engine_remove_wait+0x1a0/0x1a0 [i915]
> [  326.577964]  ? kthread_stop+0x120/0x120
> [  326.577970]  ret_from_fork+0x22/0x30
> 
> Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>

<SNIP>

> @@ -17329,6 +17350,9 @@ void intel_modeset_cleanup(struct drm_device *dev)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(dev);
>  
> +	flush_work(&dev_priv->atomic_helper.free_work);
> +	WARN_ON(!llist_empty(&dev_priv->atomic_helper.free_list));

Maybe make this while(!llist_empty) flush_work() to begin with? There's
exactly no locking in place to prevent that from happening?

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Move atomic state free from out of fence release
  2017-01-24  8:39 ` [PATCH] " Joonas Lahtinen
@ 2017-01-24  9:21   ` Chris Wilson
  2017-01-24 17:32   ` Chris Wilson
  1 sibling, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2017-01-24  9:21 UTC (permalink / raw)
  To: Joonas Lahtinen; +Cc: Daniel Vetter, intel-gfx

On Tue, Jan 24, 2017 at 10:39:44AM +0200, Joonas Lahtinen wrote:
> On ma, 2017-01-23 at 21:29 +0000, Chris Wilson wrote:
> > Fences are required to support being released from under an atomic context.
> > The drm_atomic_state struct may take a mutex when being released and so
> > we cannot drop a reference to the drm_atomic_state from the fence release
> > path directly, and so we need to defer that unreference to a worker.
> > 
> > [  326.576697] WARNING: CPU: 2 PID: 366 at kernel/sched/core.c:7737 __might_sleep+0x5d/0x80
> > [  326.576816] do not call blocking ops when !TASK_RUNNING; state=1 set at [<ffffffffc0359549>] intel_breadcrumbs_signaler+0x59/0x270 [i915]
> > [  326.576818] Modules linked in: rfcomm fuse snd_hda_codec_hdmi bnep snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device snd_timer input_leds led_class snd punit_atom_debug btusb btrtl btbcm btintel intel_rapl bluetooth i915 drm_kms_helper syscopyarea sysfillrect iwlwifi sysimgblt soundcore fb_sys_fops mei_txe cfg80211 drm pwm_lpss_platform pwm_lpss pinctrl_cherryview fjes acpi_pad parport_pc ppdev parport autofs4
> > [  326.576899] CPU: 2 PID: 366 Comm: i915/signal:0 Tainted: G     U          4.10.0-rc3-patser+ #5030
> > [  326.576902] Hardware name:                  /NUC5PPYB, BIOS PYBSWCEL.86A.0031.2015.0601.1712 06/01/2015
> > [  326.576905] Call Trace:
> > [  326.576920]  dump_stack+0x4d/0x6d
> > [  326.576926]  __warn+0xc0/0xe0
> > [  326.576931]  warn_slowpath_fmt+0x5a/0x80
> > [  326.577004]  ? intel_breadcrumbs_signaler+0x59/0x270 [i915]
> > [  326.577075]  ? intel_breadcrumbs_signaler+0x59/0x270 [i915]
> > [  326.577079]  __might_sleep+0x5d/0x80
> > [  326.577087]  mutex_lock+0x1b/0x40
> > [  326.577133]  drm_property_free_blob+0x1e/0x80 [drm]
> > [  326.577167]  ? drm_property_destroy+0xe0/0xe0 [drm]
> > [  326.577200]  drm_mode_object_unreference+0x5c/0x70 [drm]
> > [  326.577233]  drm_property_unreference_blob+0xe/0x10 [drm]
> > [  326.577260]  __drm_atomic_helper_crtc_destroy_state+0x14/0x40 [drm_kms_helper]
> > [  326.577278]  drm_atomic_helper_crtc_destroy_state+0x10/0x20 [drm_kms_helper]
> > [  326.577352]  intel_crtc_destroy_state+0x9/0x10 [i915]
> > [  326.577388]  drm_atomic_state_default_clear+0xea/0x1d0 [drm]
> > [  326.577462]  intel_atomic_state_clear+0xd/0x20 [i915]
> > [  326.577497]  drm_atomic_state_clear+0x1a/0x30 [drm]
> > [  326.577532]  __drm_atomic_state_free+0x13/0x60 [drm]
> > [  326.577607]  intel_atomic_commit_ready+0x6f/0x78 [i915]
> > [  326.577670]  i915_sw_fence_release+0x3a/0x50 [i915]
> > [  326.577733]  dma_i915_sw_fence_wake+0x39/0x80 [i915]
> > [  326.577741]  dma_fence_signal+0xda/0x120
> > [  326.577812]  ? intel_breadcrumbs_signaler+0x59/0x270 [i915]
> > [  326.577884]  intel_breadcrumbs_signaler+0xb1/0x270 [i915]
> > [  326.577889]  kthread+0x127/0x130
> > [  326.577961]  ? intel_engine_remove_wait+0x1a0/0x1a0 [i915]
> > [  326.577964]  ? kthread_stop+0x120/0x120
> > [  326.577970]  ret_from_fork+0x22/0x30
> > 
> > Reported-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> <SNIP>
> 
> > @@ -17329,6 +17350,9 @@ void intel_modeset_cleanup(struct drm_device *dev)
> >  {
> >  	struct drm_i915_private *dev_priv = to_i915(dev);
> >  
> > +	flush_work(&dev_priv->atomic_helper.free_work);
> > +	WARN_ON(!llist_empty(&dev_priv->atomic_helper.free_list));
> 
> Maybe make this while(!llist_empty) flush_work() to begin with? There's
> exactly no locking in place to prevent that from happening?

Right, there's no locking. But before modeset can be cleaned up, it must
have completed its final modeset to disable all crtc. That should be
sufficient to ensure that all pending atomic state have been flushed. If
not we need some wait_for(atomic_commits_finished()) ; first. Given
that, there's no expectation that the free_list is self-arming, nor do
we have a RCU grace period to worry about, so a while is currently
misleading.

Now I'm not totally convinced that all the atomic workers are
necessarily complete before we flush the freed work/list.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915: Move atomic state free from out of fence release
  2017-01-24  8:39 ` [PATCH] " Joonas Lahtinen
  2017-01-24  9:21   ` Chris Wilson
@ 2017-01-24 17:32   ` Chris Wilson
  1 sibling, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2017-01-24 17:32 UTC (permalink / raw)
  To: Joonas Lahtinen; +Cc: Daniel Vetter, intel-gfx

On Tue, Jan 24, 2017 at 10:39:44AM +0200, Joonas Lahtinen wrote:
> On ma, 2017-01-23 at 21:29 +0000, Chris Wilson wrote:
> > @@ -17329,6 +17350,9 @@ void intel_modeset_cleanup(struct drm_device *dev)
> >  {
> >  	struct drm_i915_private *dev_priv = to_i915(dev);
> >  
> > +	flush_work(&dev_priv->atomic_helper.free_work);
> > +	WARN_ON(!llist_empty(&dev_priv->atomic_helper.free_list));
> 
> Maybe make this while(!llist_empty) flush_work() to begin with? There's
> exactly no locking in place to prevent that from happening?

Stuck with it since it is adequate for now, and I think should be
correct for a long time. Spent a long time checking reload to see if I
could catch an issue with a missed worker, and found none.
 
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Added 
Fixes: c004a90b7263 ("drm/i915: Restore nonblocking awaits for modesetting")
for good measure since although it has only turned up now, that seems
like it could just be a concidence.

Thanks for the review and catching the bug.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2017-01-24 17:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-23 21:29 [PATCH] drm/i915: Move atomic state free from out of fence release Chris Wilson
2017-01-23 21:54 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-01-24  8:39 ` [PATCH] " Joonas Lahtinen
2017-01-24  9:21   ` Chris Wilson
2017-01-24 17:32   ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.