Skip to contentSkip to conversation

drm/i915: Wait one vblank before sending hotplug event to userspace

PATCH In review Mika Kahola 4 participants 8 messages Dec 4, 2018 – Dec 5, 2018

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

PATCH 1/1 drm/i915: Wait one vblank before sending hotplug event to userspace

Occasionally, we get the following error in our CI runs

[853.132830] Workqueue: events i915_hotplug_work_func [i915]
[853.132844] RIP: 0010:drm_wait_one_vblank+0x19b/0x1b0
[853.132852] Code: fe ff ff e8 b7 4e a6 ff 48 89 e6 4c 89 ff e8 6c 5f ab ff 45 85 ed 0f 85
15 ff ff ff 89 ee 48 c7 c7 e8 03 10 82 e8 b5 4b a6 ff <0f> 0b e9 00 ff ff ff 0f 1f 40 00 66
2e 0f 1f 84 00 00 00 00 00 8b
[853.132859] RSP: 0018:ffffc9000146bca0 EFLAGS: 00010286
[853.132866] RAX: 0000000000000000 RBX: ffff88849ef00000 RCX: 0000000000000000
[853.132873] RDX: 0000000000000007 RSI: ffffffff820c6f58 RDI: 00000000ffffffff
[853.132879] RBP: 0000000000000000 R08: 000000007ffc637a R09: 0000000000000000
[853.132884] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[853.132890] R13: 0000000000000000 R14: 000000000000d0c2 R15: ffff8884a491e680
[853.132897] FS:  0000000000000000(0000) GS:ffff8884afe80000(0000) knlGS:0000000000000000
[853.132904] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[853.132910] CR2: 00007f63bf0df000 CR3: 0000000005210006 CR4: 0000000000760ee0
[853.132916] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[853.132922] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[853.132927] PKRU: 55555554
[853.132932] Call Trace:
[853.132949]  ? wait_woken+0xa0/0xa0
[853.133068]  intel_dp_retrain_link+0x130/0x190 [i915]
[853.133176]  intel_ddi_hotplug+0x54/0x2e0 [i915]
[853.133298]  i915_hotplug_work_func+0x1a9/0x240 [i915]
[853.133324]  process_one_work+0x262/0x630
[853.133349]  worker_thread+0x37/0x380
[853.133365]  ? process_one_work+0x630/0x630
[853.133373]  kthread+0x119/0x130
[853.133383]  ? kthread_park+0x80/0x80
[853.133400]  ret_from_fork+0x3a/0x50
[853.133433] irq event stamp: 1426928

I suspect that this is caused by a racy condition when retraining the DisplayPort link. My proposal is to wait for one additional vblank event before we send out a hotplug event to userspace for reprobing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108835

---
 drivers/gpu/drm/i915/intel_dp.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +27 -0
index a6907a1761ab..6ce7d54e49af 100644
@@ -6746,6 +6746,10 @@ static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
 {
 	struct intel_connector *intel_connector;
 	struct drm_connector *connector;
+	struct drm_connector_state *conn_state;
+	struct drm_i915_private *dev_priv;
+	struct intel_crtc *crtc;
+	struct intel_crtc_state *crtc_state;
 
 	intel_connector = container_of(work, typeof(*intel_connector),
 				       modeset_retry_work);
@@ -6753,6 +6757,14 @@ static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
 	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
 		      connector->name);
 
+	dev_priv = to_i915(connector->dev);
+	conn_state = intel_connector->base.state;
+
+	crtc = to_intel_crtc(conn_state->crtc);
+	crtc_state = to_intel_crtc_state(crtc->base.state);
+
+	WARN_ON(!intel_crtc_has_dp_encoder(crtc_state));
+
 	/* Grab the locks before changing connector property*/
 	mutex_lock(&connector->dev->mode_config.mutex);
 	/* Set connector link status to BAD and send a Uevent to notify
@@ -6761,6 +6773,21 @@ static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
 	drm_connector_set_link_status_property(connector,
 					       DRM_MODE_LINK_STATUS_BAD);
 	mutex_unlock(&connector->dev->mode_config.mutex);
+
+	/* Suppress underruns caused by re-training */
+	intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, false);
+	if (crtc_state->has_pch_encoder)
+		intel_set_pch_fifo_underrun_reporting(dev_priv,
+						      intel_crtc_pch_transcoder(crtc), false);
+
+	/* Keep underrun reporting disabled until things are stable */
+	intel_wait_for_vblank(dev_priv, crtc->pipe);
+
+	intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, true);
+	if (crtc_state->has_pch_encoder)
+		intel_set_pch_fifo_underrun_reporting(dev_priv,
+						      intel_crtc_pch_transcoder(crtc), true);
+
 	/* Send Hotplug uevent so userspace can reprobe */
 	drm_kms_helper_hotplug_event(connector->dev);
 }
Signature · 6 lines
2.17.1

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

Quoting Mika Kahola (2018-12-04 09:46:39)

Quoted 1 line

Occasionally, we get the following error in our CI runs

What's the actual warn here? This looks to be trimmed too much.

Quoted 4 lines
[853.132830] Workqueue: events i915_hotplug_work_func [i915]
[853.132844] RIP: 0010:drm_wait_one_vblank+0x19b/0x1b0

15 ff ff ff 89 ee 48 c7 c7 e8 03 10 82 e8 b5 4b a6 ff <0f> 0b e9 00 ff ff ff 0f 1f 40 00 66 2e 0f 1f 84 00 00 00 00 00 8b

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

#2 lore raw

✓ Fi.CI.BAT: success for drm/i915: Wait one vblank before sending hotplug event to userspace

In reply to Mika Kahola
== Series Details ==

== Series Details ==

Series: drm/i915: Wait one vblank before sending hotplug event to userspace
URL : https://patchwork.freedesktop.org/series/53463/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_5250 -> Patchwork_11008
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/53463/revisions/1/mbox/

Known issues
------------

Here are the changes found in Patchwork_11008 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@kms_frontbuffer_tracking@basic:
- fi-hsw-peppy: PASS -> DMESG-WARN [fdo#102614]

#### Possible fixes ####

* igt@gem_mmap_gtt@basic-small-copy-xy:
- fi-glk-dsi: INCOMPLETE [fdo#103359] / [k.org#198133] -> PASS

[fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133

Participating hosts (47 -> 42)
------------------------------

Missing (5): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600

Build changes
-------------

* Linux: CI_DRM_5250 -> Patchwork_11008

CI_DRM_5250: 1e4e49c57969d1b53dea913c92e1d23ec23aee31 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4736: 285ebfb3b7adc56586031afa5150c4e5ad40c229 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11008: 98288ac1a8d45f7d59a1b0d2e1b16441305ce070 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

98288ac1a8d4 drm/i915: Wait one vblank before sending hotplug event to userspace

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_11008/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw
In reply to Mika Kahola

Quoting Mika Kahola (2018-12-04 09:46:39)

Quoted 32 lines

Occasionally, we get the following error in our CI runs

[853.132830] Workqueue: events i915_hotplug_work_func [i915]
[853.132844] RIP: 0010:drm_wait_one_vblank+0x19b/0x1b0
[853.132852] Code: fe ff ff e8 b7 4e a6 ff 48 89 e6 4c 89 ff e8 6c 5f ab ff 45 85 ed 0f 85
15 ff ff ff 89 ee 48 c7 c7 e8 03 10 82 e8 b5 4b a6 ff <0f> 0b e9 00 ff ff ff 0f 1f 40 00 66
2e 0f 1f 84 00 00 00 00 00 8b
[853.132859] RSP: 0018:ffffc9000146bca0 EFLAGS: 00010286
[853.132866] RAX: 0000000000000000 RBX: ffff88849ef00000 RCX: 0000000000000000
[853.132873] RDX: 0000000000000007 RSI: ffffffff820c6f58 RDI: 00000000ffffffff
[853.132879] RBP: 0000000000000000 R08: 000000007ffc637a R09: 0000000000000000
[853.132884] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[853.132890] R13: 0000000000000000 R14: 000000000000d0c2 R15: ffff8884a491e680
[853.132897] FS:  0000000000000000(0000) GS:ffff8884afe80000(0000) knlGS:0000000000000000
[853.132904] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[853.132910] CR2: 00007f63bf0df000 CR3: 0000000005210006 CR4: 0000000000760ee0
[853.132916] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[853.132922] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[853.132927] PKRU: 55555554
[853.132932] Call Trace:
[853.132949]  ? wait_woken+0xa0/0xa0
[853.133068]  intel_dp_retrain_link+0x130/0x190 [i915]
[853.133176]  intel_ddi_hotplug+0x54/0x2e0 [i915]
[853.133298]  i915_hotplug_work_func+0x1a9/0x240 [i915]
[853.133324]  process_one_work+0x262/0x630
[853.133349]  worker_thread+0x37/0x380
[853.133365]  ? process_one_work+0x630/0x630
[853.133373]  kthread+0x119/0x130
[853.133383]  ? kthread_park+0x80/0x80
[853.133400]  ret_from_fork+0x3a/0x50
[853.133433] irq event stamp: 1426928
Quoted 3 lines

I suspect that this is caused by a racy condition when retraining the DisplayPort link. My proposal is to wait for one additional vblank event before we send out a hotplug event to userspace for reprobing.

Problem is just by waiting for the next vblank doesn't rule out hitting the same race with another/delayed retraining. If you want serialisation, please do add some -- and it may be sensible for the hotplug to wait for the vblank after any ongoing work has finished. -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 50 lines · Chris Wilson

Quoting Mika Kahola (2018-12-04 09:46:39)

Quoted 43 lines

Occasionally, we get the following error in our CI runs

[853.132830] Workqueue: events i915_hotplug_work_func [i915]
[853.132844] RIP: 0010:drm_wait_one_vblank+0x19b/0x1b0
[853.132852] Code: fe ff ff e8 b7 4e a6 ff 48 89 e6 4c 89 ff e8 6c

5f ab ff 45 85 ed 0f 85
15 ff ff ff 89 ee 48 c7 c7 e8 03 10 82 e8 b5 4b a6 ff <0f> 0b e9 00 ff ff ff 0f 1f 40 00 66
2e 0f 1f 84 00 00 00 00 00 8b

[853.132859] RSP: 0018:ffffc9000146bca0 EFLAGS: 00010286
[853.132866] RAX: 0000000000000000 RBX: ffff88849ef00000 RCX:
0000000000000000
[853.132873] RDX: 0000000000000007 RSI: ffffffff820c6f58 RDI:
00000000ffffffff
[853.132879] RBP: 0000000000000000 R08: 000000007ffc637a R09:
0000000000000000
[853.132884] R10: 0000000000000000 R11: 0000000000000000 R12:
0000000000000000
[853.132890] R13: 0000000000000000 R14: 000000000000d0c2 R15:
ffff8884a491e680
[853.132897] FS:  0000000000000000(0000) GS:ffff8884afe80000(0000)
knlGS:0000000000000000
[853.132904] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[853.132910] CR2: 00007f63bf0df000 CR3: 0000000005210006 CR4:
0000000000760ee0
[853.132916] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[853.132922] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7:
0000000000000400
[853.132927] PKRU: 55555554
[853.132932] Call Trace:
[853.132949]  ? wait_woken+0xa0/0xa0
[853.133068]  intel_dp_retrain_link+0x130/0x190 [i915]
[853.133176]  intel_ddi_hotplug+0x54/0x2e0 [i915]
[853.133298]  i915_hotplug_work_func+0x1a9/0x240 [i915]
[853.133324]  process_one_work+0x262/0x630
[853.133349]  worker_thread+0x37/0x380
[853.133365]  ? process_one_work+0x630/0x630
[853.133373]  kthread+0x119/0x130
[853.133383]  ? kthread_park+0x80/0x80
[853.133400]  ret_from_fork+0x3a/0x50
[853.133433] irq event stamp: 1426928
Quoted 5 lines

I suspect that this is caused by a racy condition when retraining the
DisplayPort link. My proposal is to wait for one additional vblank event before we send out a hotplug event to userspace for reprobing.

Quoted 5 lines

Problem is just by waiting for the next vblank doesn't rule out hitting
the same race with another/delayed retraining. If you want serialisation, please do add some -- and it may be sensible for the hotplug to wait for the vblank after any ongoing work has finished.

This bug rarely happens so that's why I suspected some racy condition. Maybe link retraining just takes too much time so we sometimes hit vblank timeout? Would it be simple enough solution to wait for one vblank between the link retrainings?

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

#5 lore raw

✗ Fi.CI.IGT: failure for drm/i915: Wait one vblank before sending hotplug event to userspace

In reply to Mika Kahola
== Series Details ==

== Series Details ==

Series: drm/i915: Wait one vblank before sending hotplug event to userspace
URL : https://patchwork.freedesktop.org/series/53463/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_5250_full -> Patchwork_11008_full
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_11008_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_11008_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_11008_full:

### IGT changes ###

#### Possible regressions ####

* igt@kms_frontbuffer_tracking@fbc-1p-rte:
- shard-apl: PASS -> DMESG-WARN

* {igt@runner@aborted}:
- shard-apl: NOTRUN -> ( 6 FAIL )

#### Warnings ####

* igt@pm_rc6_residency@rc6-accuracy:
- shard-snb: PASS -> SKIP

Known issues
------------

Here are the changes found in Patchwork_11008_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_ctx_isolation@bcs0-s3:
- shard-skl: PASS -> INCOMPLETE [fdo#104108] / [fdo#107773]

* igt@gem_ppgtt@blt-vs-render-ctxn:
- shard-kbl: PASS -> INCOMPLETE [fdo#103665] / [fdo#106023] / [fdo#106887]

* igt@gem_render_linear_blits@basic:
- shard-kbl: PASS -> INCOMPLETE [fdo#103665] / [fdo#108761]

* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
- shard-hsw: PASS -> DMESG-WARN [fdo#107956]

* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a:
- shard-glk: PASS -> DMESG-WARN [fdo#107956]

* igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-c:
- shard-skl: NOTRUN -> DMESG-WARN [fdo#107956]

* igt@kms_cursor_crc@cursor-256x256-onscreen:
- shard-glk: PASS -> FAIL [fdo#103232]

* igt@kms_cursor_crc@cursor-256x256-suspend:
- shard-apl: PASS -> FAIL [fdo#103191] / [fdo#103232]

* igt@kms_cursor_crc@cursor-64x64-random:
- shard-skl: PASS -> FAIL [fdo#103232]

* igt@kms_cursor_crc@cursor-size-change:
- shard-apl: PASS -> FAIL [fdo#103232]

* igt@kms_flip@busy-flip-interruptible:
- shard-apl: PASS -> INCOMPLETE [fdo#103927]

* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-onoff:
- shard-glk: PASS -> FAIL [fdo#103167]

* igt@kms_frontbuffer_tracking@fbcpsr-stridechange:
- shard-skl: NOTRUN -> FAIL [fdo#105683]

* igt@kms_plane@pixel-format-pipe-a-planes:
- shard-skl: NOTRUN -> DMESG-WARN [fdo#106885]

* igt@kms_plane@plane-panning-bottom-right-pipe-c-planes:
- shard-kbl: PASS -> DMESG-WARN [fdo#103313] / [fdo#105345]

* igt@kms_plane@plane-position-covered-pipe-b-planes:
- shard-glk: PASS -> FAIL [fdo#103166] +1

* igt@kms_plane_alpha_blend@pipe-a-alpha-basic:
- shard-skl: NOTRUN -> FAIL [fdo#107815] / [fdo#108145]

* igt@kms_plane_alpha_blend@pipe-a-alpha-transparant-fb:
- shard-skl: NOTRUN -> FAIL [fdo#108145] +2

* igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl: PASS -> FAIL [fdo#107815]

* igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
- shard-apl: PASS -> FAIL [fdo#103166]

* igt@kms_properties@connector-properties-atomic:
- shard-skl: NOTRUN -> FAIL [fdo#108642]

* igt@pm_backlight@fade_with_suspend:
- shard-skl: NOTRUN -> FAIL [fdo#107847]

* igt@pm_rpm@basic-rte:
- shard-skl: NOTRUN -> INCOMPLETE [fdo#107807]

* igt@pm_rpm@modeset-lpsp-stress:
- shard-skl: PASS -> INCOMPLETE [fdo#107807]

#### Possible fixes ####

* igt@gem_eio@reset-stress:
- shard-glk: FAIL [fdo#107799] -> PASS

* igt@kms_color@pipe-c-legacy-gamma:
- shard-apl: FAIL [fdo#104782] -> PASS

* igt@kms_cursor_crc@cursor-256x256-random:
- shard-apl: FAIL [fdo#103232] -> PASS +1

* igt@kms_cursor_crc@cursor-64x64-suspend:
- shard-skl: INCOMPLETE [fdo#104108] -> PASS +1

* igt@kms_draw_crc@draw-method-xrgb2101010-mmap-cpu-untiled:
- shard-skl: FAIL [fdo#103184] -> PASS

* igt@kms_flip@2x-flip-vs-expired-vblank:
- shard-hsw: FAIL [fdo#102887] -> PASS

* igt@kms_flip@flip-vs-expired-vblank:
- shard-skl: FAIL [fdo#105363] -> PASS

* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-blt:
- shard-glk: FAIL [fdo#103167] -> PASS +3

* igt@kms_plane@plane-position-covered-pipe-b-planes:
- shard-apl: FAIL [fdo#103166] -> PASS

* igt@pm_rpm@cursor-dpms:
- shard-skl: INCOMPLETE [fdo#107807] -> PASS

* igt@pm_rpm@gem-execbuf-stress-extra-wait:
- shard-skl: INCOMPLETE [fdo#107803] / [fdo#107807] -> PASS

* igt@pm_rpm@reg-read-ioctl:
- {shard-iclb}: DMESG-WARN [fdo#107724] -> PASS

#### Warnings ####

* igt@i915_suspend@shrink:
- shard-skl: INCOMPLETE [fdo#106886] -> DMESG-WARN [fdo#108784]

* {igt@runner@aborted}:
- {shard-iclb}: ( 35 FAIL ) [fdo#105702] / [fdo#108924] / [fdo#108928] -> ( 33 FAIL ) [fdo#105702] / [fdo#108924] / [fdo#108928]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#102887]: https://bugs.freedesktop.org/show_bug.cgi?id=102887
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103184]: https://bugs.freedesktop.org/show_bug.cgi?id=103184
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103313]: https://bugs.freedesktop.org/show_bug.cgi?id=103313
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#104782]: https://bugs.freedesktop.org/show_bug.cgi?id=104782
[fdo#105345]: https://bugs.freedesktop.org/show_bug.cgi?id=105345
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105683]: https://bugs.freedesktop.org/show_bug.cgi?id=105683
[fdo#105702]: https://bugs.freedesktop.org/show_bug.cgi?id=105702
[fdo#106023]: https://bugs.freedesktop.org/show_bug.cgi?id=106023
[fdo#106885]: https://bugs.freedesktop.org/show_bug.cgi?id=106885
[fdo#106886]: https://bugs.freedesktop.org/show_bug.cgi?id=106886
[fdo#106887]: https://bugs.freedesktop.org/show_bug.cgi?id=106887
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#107773]: https://bugs.freedesktop.org/show_bug.cgi?id=107773
[fdo#107799]: https://bugs.freedesktop.org/show_bug.cgi?id=107799
[fdo#107803]: https://bugs.freedesktop.org/show_bug.cgi?id=107803
[fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
[fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
[fdo#107847]: https://bugs.freedesktop.org/show_bug.cgi?id=107847
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108642]: https://bugs.freedesktop.org/show_bug.cgi?id=108642
[fdo#108761]: https://bugs.freedesktop.org/show_bug.cgi?id=108761
[fdo#108784]: https://bugs.freedesktop.org/show_bug.cgi?id=108784
[fdo#108924]: https://bugs.freedesktop.org/show_bug.cgi?id=108924
[fdo#108928]: https://bugs.freedesktop.org/show_bug.cgi?id=108928

Participating hosts (7 -> 7)
------------------------------

No changes in participating hosts

Build changes
-------------

* Linux: CI_DRM_5250 -> Patchwork_11008

CI_DRM_5250: 1e4e49c57969d1b53dea913c92e1d23ec23aee31 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4736: 285ebfb3b7adc56586031afa5150c4e5ad40c229 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_11008: 98288ac1a8d45f7d59a1b0d2e1b16441305ce070 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_11008/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw
In reply to Mika Kahola
Quoted 32 lines · Mika Kahola

Occasionally, we get the following error in our CI runs

[853.132830] Workqueue: events i915_hotplug_work_func [i915]
[853.132844] RIP: 0010:drm_wait_one_vblank+0x19b/0x1b0
[853.132852] Code: fe ff ff e8 b7 4e a6 ff 48 89 e6 4c 89 ff e8 6c 5f ab ff 45 85 ed 0f 85
15 ff ff ff 89 ee 48 c7 c7 e8 03 10 82 e8 b5 4b a6 ff <0f> 0b e9 00 ff ff ff 0f 1f 40 00 66
2e 0f 1f 84 00 00 00 00 00 8b
[853.132859] RSP: 0018:ffffc9000146bca0 EFLAGS: 00010286
[853.132866] RAX: 0000000000000000 RBX: ffff88849ef00000 RCX: 0000000000000000
[853.132873] RDX: 0000000000000007 RSI: ffffffff820c6f58 RDI: 00000000ffffffff
[853.132879] RBP: 0000000000000000 R08: 000000007ffc637a R09: 0000000000000000
[853.132884] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
[853.132890] R13: 0000000000000000 R14: 000000000000d0c2 R15: ffff8884a491e680
[853.132897] FS:  0000000000000000(0000) GS:ffff8884afe80000(0000) knlGS:0000000000000000
[853.132904] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[853.132910] CR2: 00007f63bf0df000 CR3: 0000000005210006 CR4: 0000000000760ee0
[853.132916] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[853.132922] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[853.132927] PKRU: 55555554
[853.132932] Call Trace:
[853.132949]  ? wait_woken+0xa0/0xa0
[853.133068]  intel_dp_retrain_link+0x130/0x190 [i915]
[853.133176]  intel_ddi_hotplug+0x54/0x2e0 [i915]
[853.133298]  i915_hotplug_work_func+0x1a9/0x240 [i915]
[853.133324]  process_one_work+0x262/0x630
[853.133349]  worker_thread+0x37/0x380
[853.133365]  ? process_one_work+0x630/0x630
[853.133373]  kthread+0x119/0x130
[853.133383]  ? kthread_park+0x80/0x80
[853.133400]  ret_from_fork+0x3a/0x50
[853.133433] irq event stamp: 1426928
Quoted 5 lines

I suspect that this is caused by a racy condition when retraining the DisplayPort link. My proposal is to wait for one additional vblank event before we send out a hotplug event to userspace for reprobing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108835

The first problem in the log is
<3> [853.020316] [drm:intel_ddi_prepare_link_retrain [i915]] *ERROR* Timeout waiting for DDI BUF A idle bit That's where one should start.

Some suspects:
- icl_enable/disable_phy_clock_gating()
- intel_ddi_enable/disable_pipe_clock()

Quoted 66 lines
---
 drivers/gpu/drm/i915/intel_dp.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +27 -0
index a6907a1761ab..6ce7d54e49af 100644
@@ -6746,6 +6746,10 @@ static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
 {
 	struct intel_connector *intel_connector;
 	struct drm_connector *connector;
+	struct drm_connector_state *conn_state;
+	struct drm_i915_private *dev_priv;
+	struct intel_crtc *crtc;
+	struct intel_crtc_state *crtc_state;
 
 	intel_connector = container_of(work, typeof(*intel_connector),
 				       modeset_retry_work);
@@ -6753,6 +6757,14 @@ static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
 	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
 		      connector->name);
 
+	dev_priv = to_i915(connector->dev);
+	conn_state = intel_connector->base.state;
+
+	crtc = to_intel_crtc(conn_state->crtc);
+	crtc_state = to_intel_crtc_state(crtc->base.state);
+
+	WARN_ON(!intel_crtc_has_dp_encoder(crtc_state));
+
 	/* Grab the locks before changing connector property*/
 	mutex_lock(&connector->dev->mode_config.mutex);
 	/* Set connector link status to BAD and send a Uevent to notify
@@ -6761,6 +6773,21 @@ static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
 	drm_connector_set_link_status_property(connector,
 					       DRM_MODE_LINK_STATUS_BAD);
 	mutex_unlock(&connector->dev->mode_config.mutex);
+
+	/* Suppress underruns caused by re-training */
+	intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, false);
+	if (crtc_state->has_pch_encoder)
+		intel_set_pch_fifo_underrun_reporting(dev_priv,
+						      intel_crtc_pch_transcoder(crtc), false);
+
+	/* Keep underrun reporting disabled until things are stable */
+	intel_wait_for_vblank(dev_priv, crtc->pipe);
+
+	intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, true);
+	if (crtc_state->has_pch_encoder)
+		intel_set_pch_fifo_underrun_reporting(dev_priv,
+						      intel_crtc_pch_transcoder(crtc), true);
+
 	/* Send Hotplug uevent so userspace can reprobe */
 	drm_kms_helper_hotplug_event(connector->dev);
 }
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw
Quoted 52 lines · Ville Syrjälä
Quoted 43 lines · Mika Kahola

Occasionally, we get the following error in our CI runs

[853.132830] Workqueue: events i915_hotplug_work_func [i915]
[853.132844] RIP: 0010:drm_wait_one_vblank+0x19b/0x1b0
[853.132852] Code: fe ff ff e8 b7 4e a6 ff 48 89 e6 4c 89 ff e8 6c

5f ab ff 45 85 ed 0f 85
15 ff ff ff 89 ee 48 c7 c7 e8 03 10 82 e8 b5 4b a6 ff <0f> 0b e9 00 ff ff ff 0f 1f 40 00 66
2e 0f 1f 84 00 00 00 00 00 8b

[853.132859] RSP: 0018:ffffc9000146bca0 EFLAGS: 00010286
[853.132866] RAX: 0000000000000000 RBX: ffff88849ef00000 RCX:
0000000000000000
[853.132873] RDX: 0000000000000007 RSI: ffffffff820c6f58 RDI:
00000000ffffffff
[853.132879] RBP: 0000000000000000 R08: 000000007ffc637a R09:
0000000000000000
[853.132884] R10: 0000000000000000 R11: 0000000000000000 R12:
0000000000000000
[853.132890] R13: 0000000000000000 R14: 000000000000d0c2 R15:
ffff8884a491e680
[853.132897] FS:  0000000000000000(0000) GS:ffff8884afe80000(0000)
knlGS:0000000000000000
[853.132904] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[853.132910] CR2: 00007f63bf0df000 CR3: 0000000005210006 CR4:
0000000000760ee0
[853.132916] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
0000000000000000
[853.132922] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7:
0000000000000400
[853.132927] PKRU: 55555554
[853.132932] Call Trace:
[853.132949]  ? wait_woken+0xa0/0xa0
[853.133068]  intel_dp_retrain_link+0x130/0x190 [i915]
[853.133176]  intel_ddi_hotplug+0x54/0x2e0 [i915]
[853.133298]  i915_hotplug_work_func+0x1a9/0x240 [i915]
[853.133324]  process_one_work+0x262/0x630
[853.133349]  worker_thread+0x37/0x380
[853.133365]  ? process_one_work+0x630/0x630
[853.133373]  kthread+0x119/0x130
[853.133383]  ? kthread_park+0x80/0x80
[853.133400]  ret_from_fork+0x3a/0x50
[853.133433] irq event stamp: 1426928
Quoted 7 lines

I suspect that this is caused by a racy condition when retraining the
DisplayPort link. My proposal is to wait for one additional vblank event before we send out a hotplug event to userspace for reprobing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108835

Quoted 8 lines

The first problem in the log is
<3> [853.020316] [drm:intel_ddi_prepare_link_retrain [i915]] *ERROR* Timeout waiting for DDI BUF A idle bit
That's where one should start.

Some suspects:
- icl_enable/disable_phy_clock_gating()
- intel_ddi_enable/disable_pipe_clock()

Thanks! I will have a look at those too. On the other hand, this test failure as INCOMPLETE in CI might have caused by jenkins issue

[21/79] ( 873s left) kms_flip (blocking-absolute-wf_vblank- interruptible)
FATAL: command execution failed
java.io.EOFException
at
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.j ava:2681)
at
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStr eam.java:3156)
at
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358) at
hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:49)
at hudson.remoting.Command.readFrom(Command.java:140) at hudson.remoting.Command.readFrom(Command.java:126) at
hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(Abstr actSynchronousByteArrayCommandTransport.java:36)
at
hudson.remoting.SynchronousCommandTransport$ReaderThread.run(Synchronou sCommandTransport.java:63)
Caused: java.io.IOException: Unexpected termination of the channel
at
hudson.remoting.SynchronousCommandTransport$ReaderThread.run(Synchronou sCommandTransport.java:77)
Caused: java.io.IOException: Backing channel 'shard-iclb7' is disconnected.
at
hudson.remoting.RemoteInvocationHandler.channelOrFail(RemoteInvocationH andler.java:214)
at
hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler. java:283)
at com.sun.proxy.$Proxy64.isAlive(Unknown Source)
at
hudson.Launcher$RemoteLauncher$ProcImpl.isAlive(Launcher.java:1144)
at
hudson.Launcher$RemoteLauncher$ProcImpl.join(Launcher.java:1136)
at
hudson.tasks.CommandInterpreter.join(CommandInterpreter.java:155)
at
hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:109)
at
hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at
hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild .java:744)
at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.jav a:504)

	at hudson.model.Run.execute(Run.java:1810)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at

hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)
FATAL: Unable to delete script file /tmp/jenkins9130735500847889838.sh java.io.EOFException
at
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.j ava:2681)
at
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStr eam.java:3156)
at
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:358) at
hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:49)
at hudson.remoting.Command.readFrom(Command.java:140) at hudson.remoting.Command.readFrom(Command.java:126) at
hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(Abstr actSynchronousByteArrayCommandTransport.java:36)
at
hudson.remoting.SynchronousCommandTransport$ReaderThread.run(Synchronou sCommandTransport.java:63)
Caused: java.io.IOException: Unexpected termination of the channel
at
hudson.remoting.SynchronousCommandTransport$ReaderThread.run(Synchronou sCommandTransport.java:77)
Caused: hudson.remoting.ChannelClosedException: Channel "unknown":
Remote call on shard-iclb7 failed. The channel is closing down or has closed down
at hudson.remoting.Channel.call(Channel.java:948)
at hudson.FilePath.act(FilePath.java:1070)
at hudson.FilePath.act(FilePath.java:1059)
at hudson.FilePath.delete(FilePath.java:1563)
at
hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:123)
at
hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
at
hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at
hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild .java:744)
at hudson.model.Build$BuildExecution.build(Build.java:206) at hudson.model.Build$BuildExecution.doRun(Build.java:163) at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.jav a:504)

	at hudson.model.Run.execute(Run.java:1810)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at

hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:429)

Quoted 72 lines
Quoted 72 lines
---
 drivers/gpu/drm/i915/intel_dp.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
drivers/gpu/drm/i915/intel_dp.c +4 -0
index a6907a1761ab..6ce7d54e49af 100644
@@ -6746,6 +6746,10 @@ static void
 intel_dp_modeset_retry_work_fn(struct work_struct *work)
 {
 	struct intel_connector *intel_connector;
 	struct drm_connector *connector;
+	struct drm_connector_state *conn_state;
+	struct drm_i915_private *dev_priv;
+	struct intel_crtc *crtc;
+	struct intel_crtc_state *crtc_state;
 
 	intel_connector = container_of(work, typeof(*intel_connector),
drivers/gpu/drm/i915/intel_dp.c +8 -0
 				       modeset_retry_work);
@@ -6753,6 +6757,14 @@ static void
 intel_dp_modeset_retry_work_fn(struct work_struct *work)
 	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
 		      connector->name);
 
+	dev_priv = to_i915(connector->dev);
+	conn_state = intel_connector->base.state;
+
+	crtc = to_intel_crtc(conn_state->crtc);
+	crtc_state = to_intel_crtc_state(crtc->base.state);
+
+	WARN_ON(!intel_crtc_has_dp_encoder(crtc_state));
+
 	/* Grab the locks before changing connector property*/
 	mutex_lock(&connector->dev->mode_config.mutex);
drivers/gpu/drm/i915/intel_dp.c +6 -0
 	/* Set connector link status to BAD and send a Uevent to notify
@@ -6761,6 +6773,21 @@ static void
 intel_dp_modeset_retry_work_fn(struct work_struct *work)
 	drm_connector_set_link_status_property(connector,
 					       DRM_MODE_LINK_STATUS_BAD
 );
 	mutex_unlock(&connector->dev->mode_config.mutex);
+
+	/* Suppress underruns caused by re-training */
+	intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe,
 false);
+	if (crtc_state->has_pch_encoder)
+		intel_set_pch_fifo_underrun_reporting(dev_priv,
+						      intel_crtc_pch_tr

anscoder(crtc), false);

drivers/gpu/drm/i915/intel_dp.c +5 -0
+
+	/* Keep underrun reporting disabled until things are stable */
+	intel_wait_for_vblank(dev_priv, crtc->pipe);
+
+	intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe,

true);

drivers/gpu/drm/i915/intel_dp.c +3 -0
+	if (crtc_state->has_pch_encoder)
+		intel_set_pch_fifo_underrun_reporting(dev_priv,
+						      intel_crtc_pch_tr

anscoder(crtc), true);

drivers/gpu/drm/i915/intel_dp.c +1 -0
+
 	/* Send Hotplug uevent so userspace can reprobe */
 	drm_kms_helper_hotplug_event(connector->dev);
 }
Signature · 1 line
2.17.1
Quoted 6 lines
Quoted 4 lines

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

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