Skip to contentSkip to conversation

drm/i915/dp: Poll for DDI Idle status to be 0 after enabling DDI Buf

PATCH In review Manasi Navare 3 participants 7 messages Jun 16, 2020

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

PATCH 1/1 drm/i915/dp: Poll for DDI Idle status to be 0 after enabling DDI Buf

The Bspec sequence expects us to poll for DDI Idle status to be 0 (not idle) with a timeout of 600usecs after enabling the DDI BUF CTL. But currently in the driver we just wait for 600usecs without polling so add that.

Cc Ville Syrjälä <[email protected]>
Cc Imre Deak <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_ddi.c +5 -1
index ca7bb2294d2b..de7e15de0bc5 100644
@@ -4023,7 +4023,11 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
 	intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP);
 	intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
 
-	udelay(600);
+	if (wait_for_us(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
+			  DDI_BUF_IS_IDLE),
+			600))
+		drm_err(&dev_priv->drm, "DDI port:%c buffer idle\n",
+			port_name(port));
 }
 
 static void intel_ddi_set_link_train(struct intel_dp *intel_dp,
Signature · 6 lines
2.19.1

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

The Bspec sequence expects us to poll for DDI Idle status to be 0 (not idle) with a timeout of 600usecs after enabling the DDI BUF CTL.

It only says that for newer platforms. We need to either keep the fixed delay before starting to poll, or someone needs confirm how the idle bit really behaves on the older platforms.

Quoted 29 lines

But currently in the driver we just wait for 600usecs without polling so add that.

Cc Ville Syrjälä <[email protected]>
Cc Imre Deak <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_ddi.c +5 -1
index ca7bb2294d2b..de7e15de0bc5 100644
@@ -4023,7 +4023,11 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
 	intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP);
 	intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
 
-	udelay(600);
+	if (wait_for_us(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
+			  DDI_BUF_IS_IDLE),
+			600))
+		drm_err(&dev_priv->drm, "DDI port:%c buffer idle\n",
+			port_name(port));
 }
 
 static void intel_ddi_set_link_train(struct intel_dp *intel_dp,
Signature · 1 line
2.19.1
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 8 lines · Ville Syrjälä
Quoted 3 lines · Manasi Navare

The Bspec sequence expects us to poll for DDI Idle status to be 0 (not idle) with a timeout of 600usecs after enabling the DDI BUF CTL.

It only says that for newer platforms. We need to either keep the fixed delay before starting to poll, or someone needs confirm how the idle bit really behaves on the older platforms.

In fact it says not to use this bit at all on BXT. So even our disable sequence is potentially borked on BXT. Unfortunately the spec doesn't say which way the bit is broken, so not clear if that's the case or not.

Quoted 38 lines
Quoted 30 lines

But currently in the driver we just wait for 600usecs without polling so add that.

Cc Ville Syrjälä <[email protected]>
Cc Imre Deak <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_ddi.c +5 -1
index ca7bb2294d2b..de7e15de0bc5 100644
@@ -4023,7 +4023,11 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
 	intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP);
 	intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
 
-	udelay(600);
+	if (wait_for_us(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
+			  DDI_BUF_IS_IDLE),
+			600))
+		drm_err(&dev_priv->drm, "DDI port:%c buffer idle\n",
+			port_name(port));
 }
 
 static void intel_ddi_set_link_train(struct intel_dp *intel_dp,
Signature · 1 line
2.19.1
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
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
#3 lore raw
Quoted 6 lines · Ville Syrjälä
Quoted 5 lines · Ville Syrjälä
Quoted 3 lines · Manasi Navare

The Bspec sequence expects us to poll for DDI Idle status to be 0 (not idle) with a timeout of 600usecs after enabling the DDI BUF CTL.

Quoted 9 lines
Quoted 3 lines

It only says that for newer platforms. We need to either keep the fixed delay before starting to poll, or someone needs confirm how the idle bit really behaves on the older platforms.

In fact it says not to use this bit at all on BXT. So even our disable sequence is potentially borked on BXT. Unfortunately the spec doesn't say which way the bit is broken, so not clear if that's the case or not.

I double checked on Gen 9, it is > 518 usecs timeout and Gen 10+ it is 500usecs and then gen 12, it is 600 usecs timeout.

Should we add this max timeout for Gen >=10, we def need this for platforms starting Gen 10+

Manasi

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines

But currently in the driver we just wait for 600usecs without polling so add that.

Cc Ville Syrjälä <[email protected]>
Cc Imre Deak <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_ddi.c +5 -1
index ca7bb2294d2b..de7e15de0bc5 100644
@@ -4023,7 +4023,11 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
 	intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP);
 	intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
 
-	udelay(600);
+	if (wait_for_us(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
+			  DDI_BUF_IS_IDLE),
+			600))
+		drm_err(&dev_priv->drm, "DDI port:%c buffer idle\n",
+			port_name(port));
 }
 
Quoted 15 lines
Quoted 11 lines
Quoted 3 lines
drivers/gpu/drm/i915/display/intel_ddi.c +0 -0
 static void intel_ddi_set_link_train(struct intel_dp *intel_dp,
Signature · 1 line
2.19.1
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä
Intel

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

#4 lore raw
In reply to Manasi Navare
Quoted 17 lines · Manasi Navare

The Bspec sequence expects us to poll for DDI Idle status to be 0 (not idle) with a timeout of 600usecs after enabling the DDI BUF CTL. But currently in the driver we just wait for 600usecs without polling so add that.

Cc Ville Syrjälä <[email protected]>
Cc Imre Deak <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_ddi.c +0 -0
index ca7bb2294d2b..de7e15de0bc5 100644

drivers/gpu/drm/i915/display/intel_ddi.c static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp) · line 4030

Quoted 9 lines
drivers/gpu/drm/i915/display/intel_ddi.c +5 -1
@@ -4023,7 +4023,11 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
 	intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP);
 	intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
 
-	udelay(600);
+	if (wait_for_us(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
+			  DDI_BUF_IS_IDLE),
+			600))
+		drm_err(&dev_priv->drm, "DDI port:%c buffer idle\n",
+			port_name(port));

Another thing I just noticed is that icl+ need this for HDMI as well. The slightly odd thing is that glk is documented to need this for DP but not HDMI. But I'm thinking doing it also for glk HDMI should be fine.

So I guess to line up with the spec we should:
- fixed >518us enable delay for pre-glk (not sure if polling would be ok for hsw/bdw/skl)
- poll for enable on glk+
- fixed 16us disable delay for bxt
- poll for disable on !bxt

And do it for both DP and HDMI for consistency.

Quoted 5 lines
drivers/gpu/drm/i915/display/intel_ddi.c +0 -0
 }
 
 static void intel_ddi_set_link_train(struct intel_dp *intel_dp,
Signature · 1 line
2.19.1
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw
Quoted 33 lines · Ville Syrjälä
Quoted 17 lines · Manasi Navare

The Bspec sequence expects us to poll for DDI Idle status to be 0 (not idle) with a timeout of 600usecs after enabling the DDI BUF CTL. But currently in the driver we just wait for 600usecs without polling so add that.

Cc Ville Syrjälä <[email protected]>
Cc Imre Deak <[email protected]>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/display/intel_ddi.c +0 -0
index ca7bb2294d2b..de7e15de0bc5 100644

drivers/gpu/drm/i915/display/intel_ddi.c static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp) · line 4030

Quoted 9 lines
drivers/gpu/drm/i915/display/intel_ddi.c +5 -1
@@ -4023,7 +4023,11 @@ static void intel_ddi_prepare_link_retrain(struct intel_dp *intel_dp)
 	intel_de_write(dev_priv, DDI_BUF_CTL(port), intel_dp->DP);
 	intel_de_posting_read(dev_priv, DDI_BUF_CTL(port));
 
-	udelay(600);
+	if (wait_for_us(!(intel_de_read(dev_priv, DDI_BUF_CTL(port)) &
+			  DDI_BUF_IS_IDLE),
+			600))
+		drm_err(&dev_priv->drm, "DDI port:%c buffer idle\n",
+			port_name(port));

Another thing I just noticed is that icl+ need this for HDMI as well. The slightly odd thing is that glk is documented to need this for DP but not HDMI. But I'm thinking doing it also for glk HDMI should be fine.

Quoted 8 lines

So I guess to line up with the spec we should:
- fixed >518us enable delay for pre-glk (not sure if polling would be ok for hsw/bdw/skl)
- poll for enable on glk+
- fixed 16us disable delay for bxt
- poll for disable on !bxt

And do it for both DP and HDMI for consistency.

So since its different one each platform, should we create a per platform hook like wait_for_non_idle_status or something per platform?

Manasi

Quoted 11 lines
Quoted 7 lines
drivers/gpu/drm/i915/display/intel_ddi.c +0 -0
 }
 
 static void intel_ddi_set_link_train(struct intel_dp *intel_dp,
Signature · 1 line
2.19.1
Signature · 2 lines
Ville Syrjälä
Intel

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

#6 lore raw

[Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/dp: Poll for DDI Idle status to be 0 after enabling DDI Buf

In reply to Manasi Navare
== Series Details ==

== Series Details ==

Series: drm/i915/dp: Poll for DDI Idle status to be 0 after enabling DDI Buf
URL : https://patchwork.freedesktop.org/series/78435/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8636 -> Patchwork_17970
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17970/index.html

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

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

### IGT changes ###

#### Issues hit ####

* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-bsw-kefka: [PASS][1] -> [DMESG-WARN][2] ([i915#1982])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8636/fi-bsw-kefka/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17970/fi-bsw-kefka/igt@[email protected]

* igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1:
- fi-icl-u2: [PASS][3] -> [DMESG-WARN][4] ([i915#1982]) +1 similar issue
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8636/fi-icl-u2/igt@kms_flip@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17970/fi-icl-u2/igt@kms_flip@[email protected]

#### Possible fixes ####

* igt@i915_pm_rpm@module-reload:
- fi-glk-dsi: [DMESG-WARN][5] ([i915#1982]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8636/fi-glk-dsi/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17970/fi-glk-dsi/igt@[email protected]

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][7] ([i915#227]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8636/fi-kbl-7500u/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17970/fi-kbl-7500u/igt@[email protected]

* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- fi-icl-u2: [DMESG-WARN][9] ([i915#1982]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8636/fi-icl-u2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17970/fi-icl-u2/igt@[email protected]

#### Warnings ####

* igt@gem_exec_suspend@basic-s0:
- fi-kbl-x1275: [DMESG-WARN][11] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][12] ([i915#1982] / [i915#62] / [i915#92] / [i915#95])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8636/fi-kbl-x1275/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17970/fi-kbl-x1275/igt@[email protected]

* igt@gem_exec_suspend@basic-s3:
- fi-kbl-x1275: [DMESG-WARN][13] ([i915#62] / [i915#92]) -> [DMESG-WARN][14] ([i915#62] / [i915#92] / [i915#95])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8636/fi-kbl-x1275/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17970/fi-kbl-x1275/igt@[email protected]

* igt@i915_pm_rpm@basic-rte:
- fi-kbl-guc: [FAIL][15] ([i915#665] / [i915#704]) -> [SKIP][16] ([fdo#109271])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8636/fi-kbl-guc/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17970/fi-kbl-guc/igt@[email protected]

* igt@kms_flip@basic-flip-vs-modeset@a-dp1:
- fi-kbl-x1275: [DMESG-WARN][17] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][18] ([i915#62] / [i915#92]) +4 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8636/fi-kbl-x1275/igt@kms_flip@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17970/fi-kbl-x1275/igt@kms_flip@[email protected]

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

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[i915#1569]: https://gitlab.freedesktop.org/drm/intel/issues/1569
[i915#192]: https://gitlab.freedesktop.org/drm/intel/issues/192
[i915#193]: https://gitlab.freedesktop.org/drm/intel/issues/193
[i915#194]: https://gitlab.freedesktop.org/drm/intel/issues/194
[i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
[i915#2029]: https://gitlab.freedesktop.org/drm/intel/issues/2029
[i915#227]: https://gitlab.freedesktop.org/drm/intel/issues/227
[i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
[i915#665]: https://gitlab.freedesktop.org/drm/intel/issues/665
[i915#704]: https://gitlab.freedesktop.org/drm/intel/issues/704
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95

Participating hosts (47 -> 40)
------------------------------

Missing (7): fi-ilk-m540 fi-byt-j1900 fi-byt-squawks fi-bsw-cyan fi-cfl-guc fi-byt-clapper fi-bdw-samus

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

* Linux: CI_DRM_8636 -> Patchwork_17970

CI-20190529: 20190529
CI_DRM_8636: dd73f1f0cf1ea35520ff8267e59159be8c884e23 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5711: 90611a0c90afa4a46496c78a4faf9638a1538ac3 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_17970: 56786c7f15db8d8f1ad41d0e56de30044599d33a @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

56786c7f15db drm/i915/dp: Poll for DDI Idle status to be 0 after enabling DDI Buf

== Logs ==

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