All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/tc: Implement the TC cold exit sequence
@ 2019-10-01  0:55 José Roberto de Souza
  2019-10-01  1:39 ` ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: José Roberto de Souza @ 2019-10-01  0:55 UTC (permalink / raw)
  To: intel-gfx; +Cc: Lucas De Marchi

This is required for legacy/static TC ports as IOM is not aware of
the connection and will not trigger the TC cold exit.

BSpec: 21750
BSpsc: 49294
Cc: Imre Deak <imre.deak@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/i915/display/intel_tc.c | 34 ++++++++++++++++++++-----
 drivers/gpu/drm/i915/i915_reg.h         |  1 +
 2 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c
index 7773169b7331..09b78027bdd5 100644
--- a/drivers/gpu/drm/i915/display/intel_tc.c
+++ b/drivers/gpu/drm/i915/display/intel_tc.c
@@ -7,6 +7,7 @@
 #include "intel_display.h"
 #include "intel_display_types.h"
 #include "intel_dp_mst.h"
+#include "intel_sideband.h"
 #include "intel_tc.h"
 
 static const char *tc_port_mode_name(enum tc_port_mode mode)
@@ -169,6 +170,22 @@ static void tc_port_fixup_legacy_flag(struct intel_digital_port *dig_port,
 	dig_port->tc_legacy_port = !dig_port->tc_legacy_port;
 }
 
+static int tc_cold_exit_request(struct drm_i915_private *dev_priv)
+{
+	int ret;
+
+	do {
+		ret = sandybridge_pcode_write_timeout(dev_priv,
+						      ICL_PCODE_EXIT_TCCOLD, 0,
+						      250, 1);
+
+	} while (ret == -EAGAIN);
+
+	DRM_DEBUG_KMS("tccold exit %s\n", ret == 0 ? "succeeded" : "failed");
+
+	return ret;
+}
+
 static u32 tc_port_live_status_mask(struct intel_digital_port *dig_port)
 {
 	struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
@@ -177,13 +194,21 @@ static u32 tc_port_live_status_mask(struct intel_digital_port *dig_port)
 	u32 mask = 0;
 	u32 val;
 
+	if (intel_uncore_read(uncore, SDEISR) & SDE_TC_HOTPLUG_ICP(tc_port))
+		mask |= BIT(TC_PORT_LEGACY);
+
 	val = intel_uncore_read(uncore,
 				PORT_TX_DFLEXDPSP(dig_port->tc_phy_fia));
 
 	if (val == 0xffffffff) {
-		DRM_DEBUG_KMS("Port %s: PHY in TCCOLD, nothing connected\n",
-			      dig_port->tc_port_name);
-		return mask;
+		if (mask)
+			tc_cold_exit_request(i915);
+
+		if (val == 0xffffffff) {
+			DRM_DEBUG_KMS("Port %s: PHY in TCCOLD, nothing connected\n",
+				      dig_port->tc_port_name);
+			return mask;
+		}
 	}
 
 	if (val & TC_LIVE_STATE_TBT(dig_port->tc_phy_fia_idx))
@@ -191,9 +216,6 @@ static u32 tc_port_live_status_mask(struct intel_digital_port *dig_port)
 	if (val & TC_LIVE_STATE_TC(dig_port->tc_phy_fia_idx))
 		mask |= BIT(TC_PORT_DP_ALT);
 
-	if (intel_uncore_read(uncore, SDEISR) & SDE_TC_HOTPLUG_ICP(tc_port))
-		mask |= BIT(TC_PORT_LEGACY);
-
 	/* The sink can be connected only in a single mode. */
 	if (!WARN_ON(hweight32(mask) > 1))
 		tc_port_fixup_legacy_flag(dig_port, mask);
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 058aa5ca8b73..35c3724b7fef 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -8860,6 +8860,7 @@ enum {
 #define     ICL_PCODE_MEM_SS_READ_QGV_POINT_INFO(point)	(((point) << 16) | (0x1 << 8))
 #define   GEN6_PCODE_READ_D_COMP		0x10
 #define   GEN6_PCODE_WRITE_D_COMP		0x11
+#define   ICL_PCODE_EXIT_TCCOLD			0x12
 #define   HSW_PCODE_DE_WRITE_FREQ_REQ		0x17
 #define   DISPLAY_IPS_CONTROL			0x19
             /* See also IPS_CTL */
-- 
2.23.0

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

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

* ✗ Fi.CI.BAT: failure for drm/i915/tc: Implement the TC cold exit sequence
  2019-10-01  0:55 [PATCH] drm/i915/tc: Implement the TC cold exit sequence José Roberto de Souza
@ 2019-10-01  1:39 ` Patchwork
  2019-10-01  7:56 ` ✓ Fi.CI.BAT: success for drm/i915/tc: Implement the TC cold exit sequence (rev2) Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2019-10-01  1:39 UTC (permalink / raw)
  To: José Roberto de Souza; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/tc: Implement the TC cold exit sequence
URL   : https://patchwork.freedesktop.org/series/67426/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6979 -> Patchwork_14595
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_14595 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_14595, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

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

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

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

### IGT changes ###

#### Possible regressions ####

  * igt@runner@aborted:
    - fi-bsw-n3050:       NOTRUN -> [FAIL][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14595/fi-bsw-n3050/igt@runner@aborted.html

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@gem_sync@basic-store-all:
    - {fi-tgl-u2}:        NOTRUN -> [FAIL][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14595/fi-tgl-u2/igt@gem_sync@basic-store-all.html

  * igt@i915_selftest@live_requests:
    - {fi-tgl-u2}:        NOTRUN -> [DMESG-FAIL][3]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14595/fi-tgl-u2/igt@i915_selftest@live_requests.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live_hangcheck:
    - fi-bsw-n3050:       [PASS][4] -> [INCOMPLETE][5] ([fdo#105876])
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/fi-bsw-n3050/igt@i915_selftest@live_hangcheck.html
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14595/fi-bsw-n3050/igt@i915_selftest@live_hangcheck.html

  
#### Possible fixes ####

  * igt@debugfs_test@read_all_entries:
    - {fi-tgl-u2}:        [DMESG-WARN][6] ([fdo#111600]) -> [PASS][7]
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/fi-tgl-u2/igt@debugfs_test@read_all_entries.html
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14595/fi-tgl-u2/igt@debugfs_test@read_all_entries.html

  * igt@gem_sync@basic-each:
    - {fi-tgl-u2}:        [INCOMPLETE][8] ([fdo#111647]) -> [PASS][9]
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/fi-tgl-u2/igt@gem_sync@basic-each.html
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14595/fi-tgl-u2/igt@gem_sync@basic-each.html

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

  [fdo#105876]: https://bugs.freedesktop.org/show_bug.cgi?id=105876
  [fdo#111600]: https://bugs.freedesktop.org/show_bug.cgi?id=111600
  [fdo#111647]: https://bugs.freedesktop.org/show_bug.cgi?id=111647


Participating hosts (15 -> 43)
------------------------------

  Additional (28): fi-kbl-soraka fi-bdw-gvtdvm fi-icl-u2 fi-apl-guc fi-snb-2520m fi-icl-u3 fi-skl-lmem fi-blb-e6850 fi-icl-guc fi-byt-n2820 fi-skl-6600u fi-hsw-4770r fi-bxt-dsi fi-cml-s fi-glk-dsi fi-bwr-2160 fi-ilk-650 fi-kbl-7500u fi-gdg-551 fi-elk-e7500 fi-skl-6700k2 fi-hsw-peppy fi-cfl-guc fi-whl-u fi-kbl-x1275 fi-cfl-8109u fi-skl-iommu fi-kbl-8809g 


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

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_6979 -> Patchwork_14595

  CI-20190529: 20190529
  CI_DRM_6979: 46637a3b58ef5e2c0fb6e53b7c50bba8f5de3455 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5208: c0131b4f132acf287d9d05b0f5078003d3159e1c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_14595: a6ecce8d8ab2cdeff30b89cc0a8289dc8c414145 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

a6ecce8d8ab2 drm/i915/tc: Implement the TC cold exit sequence

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14595/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.BAT: success for drm/i915/tc: Implement the TC cold exit sequence (rev2)
  2019-10-01  0:55 [PATCH] drm/i915/tc: Implement the TC cold exit sequence José Roberto de Souza
  2019-10-01  1:39 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2019-10-01  7:56 ` Patchwork
  2019-10-01 10:04 ` ✗ Fi.CI.IGT: failure " Patchwork
  2019-10-03 14:50 ` [PATCH] drm/i915/tc: Implement the TC cold exit sequence Imre Deak
  3 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2019-10-01  7:56 UTC (permalink / raw)
  To: José Roberto de Souza; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/tc: Implement the TC cold exit sequence (rev2)
URL   : https://patchwork.freedesktop.org/series/67426/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6979 -> Patchwork_14598
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

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

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

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

### IGT changes ###

#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@gem_sync@basic-all:
    - {fi-tgl-u2}:        [PASS][1] -> [FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/fi-tgl-u2/igt@gem_sync@basic-all.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/fi-tgl-u2/igt@gem_sync@basic-all.html

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



Participating hosts (15 -> 43)
------------------------------

  Additional (28): fi-kbl-soraka fi-bdw-gvtdvm fi-icl-u2 fi-apl-guc fi-snb-2520m fi-icl-u3 fi-skl-lmem fi-blb-e6850 fi-byt-n2820 fi-icl-guc fi-skl-6600u fi-hsw-4770r fi-bxt-dsi fi-cml-s fi-byt-j1900 fi-glk-dsi fi-ilk-650 fi-kbl-7500u fi-gdg-551 fi-elk-e7500 fi-skl-6700k2 fi-hsw-peppy fi-cfl-guc fi-whl-u fi-kbl-x1275 fi-cfl-8109u fi-skl-iommu fi-kbl-8809g 


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

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_6979 -> Patchwork_14598

  CI-20190529: 20190529
  CI_DRM_6979: 46637a3b58ef5e2c0fb6e53b7c50bba8f5de3455 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5208: c0131b4f132acf287d9d05b0f5078003d3159e1c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_14598: 811c4fd9bfd814ea3f9be9f0f8f4cf7c5e6b03d0 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

811c4fd9bfd8 drm/i915/tc: Implement the TC cold exit sequence

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✗ Fi.CI.IGT: failure for drm/i915/tc: Implement the TC cold exit sequence (rev2)
  2019-10-01  0:55 [PATCH] drm/i915/tc: Implement the TC cold exit sequence José Roberto de Souza
  2019-10-01  1:39 ` ✗ Fi.CI.BAT: failure for " Patchwork
  2019-10-01  7:56 ` ✓ Fi.CI.BAT: success for drm/i915/tc: Implement the TC cold exit sequence (rev2) Patchwork
@ 2019-10-01 10:04 ` Patchwork
  2019-10-03 14:50 ` [PATCH] drm/i915/tc: Implement the TC cold exit sequence Imre Deak
  3 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2019-10-01 10:04 UTC (permalink / raw)
  To: José Roberto de Souza; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/tc: Implement the TC cold exit sequence (rev2)
URL   : https://patchwork.freedesktop.org/series/67426/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6979_full -> Patchwork_14598_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_14598_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_14598_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_14598_full:

### IGT changes ###

#### Possible regressions ####

  * igt@gem_pipe_control_store_loop@reused-buffer:
    - shard-skl:          [PASS][1] -> [TIMEOUT][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl5/igt@gem_pipe_control_store_loop@reused-buffer.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl8/igt@gem_pipe_control_store_loop@reused-buffer.html

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

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

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_isolation@bcs0-s3:
    - shard-apl:          [PASS][3] -> [DMESG-WARN][4] ([fdo#108566]) +5 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-apl4/igt@gem_ctx_isolation@bcs0-s3.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-apl1/igt@gem_ctx_isolation@bcs0-s3.html

  * igt@gem_ctx_isolation@vcs0-s3:
    - shard-kbl:          [PASS][5] -> [DMESG-WARN][6] ([fdo#108566])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-kbl1/igt@gem_ctx_isolation@vcs0-s3.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-kbl7/igt@gem_ctx_isolation@vcs0-s3.html

  * igt@gem_ctx_shared@exec-single-timeline-bsd:
    - shard-iclb:         [PASS][7] -> [SKIP][8] ([fdo#110841])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb6/igt@gem_ctx_shared@exec-single-timeline-bsd.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb2/igt@gem_ctx_shared@exec-single-timeline-bsd.html

  * igt@gem_eio@in-flight-contexts-1us:
    - shard-hsw:          [PASS][9] -> [FAIL][10] ([fdo#105957])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-hsw5/igt@gem_eio@in-flight-contexts-1us.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-hsw7/igt@gem_eio@in-flight-contexts-1us.html

  * igt@gem_eio@in-flight-suspend:
    - shard-glk:          [PASS][11] -> [CRASH][12] ([fdo#111559])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-glk6/igt@gem_eio@in-flight-suspend.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-glk8/igt@gem_eio@in-flight-suspend.html

  * igt@gem_exec_async@concurrent-writes-bsd:
    - shard-iclb:         [PASS][13] -> [SKIP][14] ([fdo#111325]) +5 similar issues
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb6/igt@gem_exec_async@concurrent-writes-bsd.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb4/igt@gem_exec_async@concurrent-writes-bsd.html

  * igt@gem_tiled_swapping@non-threaded:
    - shard-kbl:          [PASS][15] -> [DMESG-WARN][16] ([fdo#108686])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-kbl2/igt@gem_tiled_swapping@non-threaded.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-kbl6/igt@gem_tiled_swapping@non-threaded.html

  * igt@gem_userptr_blits@map-fixed-invalidate-busy:
    - shard-glk:          [PASS][17] -> [DMESG-WARN][18] ([fdo#111870]) +1 similar issue
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-glk5/igt@gem_userptr_blits@map-fixed-invalidate-busy.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-glk3/igt@gem_userptr_blits@map-fixed-invalidate-busy.html

  * igt@gem_userptr_blits@map-fixed-invalidate-busy-gup:
    - shard-snb:          [PASS][19] -> [DMESG-WARN][20] ([fdo#111870]) +1 similar issue
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-snb1/igt@gem_userptr_blits@map-fixed-invalidate-busy-gup.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-snb1/igt@gem_userptr_blits@map-fixed-invalidate-busy-gup.html

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy:
    - shard-apl:          [PASS][21] -> [DMESG-WARN][22] ([fdo#109385] / [fdo#111870])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-apl3/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-apl1/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html

  * igt@gem_userptr_blits@sync-unmap:
    - shard-skl:          [PASS][23] -> [DMESG-WARN][24] ([fdo#111870])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl1/igt@gem_userptr_blits@sync-unmap.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl7/igt@gem_userptr_blits@sync-unmap.html

  * igt@i915_suspend@fence-restore-tiled2untiled:
    - shard-skl:          [PASS][25] -> [INCOMPLETE][26] ([fdo#104108])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl10/igt@i915_suspend@fence-restore-tiled2untiled.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl6/igt@i915_suspend@fence-restore-tiled2untiled.html

  * igt@kms_cursor_crc@pipe-b-cursor-128x128-onscreen:
    - shard-skl:          [PASS][27] -> [FAIL][28] ([fdo#103232])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl2/igt@kms_cursor_crc@pipe-b-cursor-128x128-onscreen.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl4/igt@kms_cursor_crc@pipe-b-cursor-128x128-onscreen.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
    - shard-iclb:         [PASS][29] -> [FAIL][30] ([fdo#103167]) +7 similar issues
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb1/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb8/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite.html

  * igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-mmap-cpu:
    - shard-iclb:         [PASS][31] -> [INCOMPLETE][32] ([fdo#106978] / [fdo#107713])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb8/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-mmap-cpu.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb1/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-mmap-cpu.html

  * igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
    - shard-skl:          [PASS][33] -> [FAIL][34] ([fdo#103191])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl2/igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl4/igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence.html

  * igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min:
    - shard-skl:          [PASS][35] -> [FAIL][36] ([fdo#108145])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl2/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl4/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min.html

  * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
    - shard-skl:          [PASS][37] -> [FAIL][38] ([fdo#108145] / [fdo#110403])
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl1/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl7/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html

  * igt@kms_psr@psr2_sprite_plane_move:
    - shard-iclb:         [PASS][39] -> [SKIP][40] ([fdo#109441]) +2 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb5/igt@kms_psr@psr2_sprite_plane_move.html

  * igt@prime_busy@hang-bsd2:
    - shard-iclb:         [PASS][41] -> [SKIP][42] ([fdo#109276]) +21 similar issues
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb4/igt@prime_busy@hang-bsd2.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb5/igt@prime_busy@hang-bsd2.html

  
#### Possible fixes ####

  * igt@gem_close@many-handles-one-vma:
    - shard-snb:          [INCOMPLETE][43] ([fdo#105411]) -> [PASS][44]
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-snb5/igt@gem_close@many-handles-one-vma.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-snb7/igt@gem_close@many-handles-one-vma.html

  * igt@gem_eio@unwedge-stress:
    - shard-snb:          [FAIL][45] ([fdo#109661]) -> [PASS][46]
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-snb4/igt@gem_eio@unwedge-stress.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-snb2/igt@gem_eio@unwedge-stress.html

  * igt@gem_exec_schedule@wide-bsd:
    - shard-iclb:         [SKIP][47] ([fdo#111325]) -> [PASS][48] +4 similar issues
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb2/igt@gem_exec_schedule@wide-bsd.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb5/igt@gem_exec_schedule@wide-bsd.html

  * igt@gem_userptr_blits@dmabuf-sync:
    - shard-skl:          [DMESG-WARN][49] ([fdo#111870]) -> [PASS][50]
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl5/igt@gem_userptr_blits@dmabuf-sync.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl3/igt@gem_userptr_blits@dmabuf-sync.html

  * igt@gem_userptr_blits@dmabuf-unsync:
    - shard-kbl:          [DMESG-WARN][51] ([fdo#111870]) -> [PASS][52]
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-kbl2/igt@gem_userptr_blits@dmabuf-unsync.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-kbl1/igt@gem_userptr_blits@dmabuf-unsync.html

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup:
    - shard-glk:          [DMESG-WARN][53] ([fdo#111870]) -> [PASS][54] +1 similar issue
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-glk4/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-glk5/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup.html

  * igt@gem_userptr_blits@sync-unmap:
    - shard-iclb:         [DMESG-WARN][55] ([fdo#111870]) -> [PASS][56]
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb8/igt@gem_userptr_blits@sync-unmap.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb4/igt@gem_userptr_blits@sync-unmap.html

  * igt@i915_selftest@live_gem_contexts:
    - shard-hsw:          [DMESG-FAIL][57] ([fdo#111692]) -> [PASS][58]
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-hsw4/igt@i915_selftest@live_gem_contexts.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-hsw6/igt@i915_selftest@live_gem_contexts.html

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size:
    - shard-skl:          [FAIL][59] ([fdo#102670]) -> [PASS][60]
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl10/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl1/igt@kms_cursor_legacy@flip-vs-cursor-atomic-transitions-varying-size.html

  * igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-render:
    - shard-iclb:         [INCOMPLETE][61] ([fdo#107713]) -> [PASS][62]
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-render.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-rgb101010-draw-render.html

  * igt@kms_frontbuffer_tracking@fbc-suspend:
    - shard-apl:          [DMESG-WARN][63] ([fdo#108566]) -> [PASS][64] +6 similar issues
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-apl4/igt@kms_frontbuffer_tracking@fbc-suspend.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-apl3/igt@kms_frontbuffer_tracking@fbc-suspend.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render:
    - shard-iclb:         [FAIL][65] ([fdo#103167]) -> [PASS][66] +5 similar issues
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb7/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb7/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render.html

  * igt@kms_frontbuffer_tracking@psr-rgb565-draw-mmap-cpu:
    - shard-skl:          [FAIL][67] ([fdo#103167]) -> [PASS][68]
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl4/igt@kms_frontbuffer_tracking@psr-rgb565-draw-mmap-cpu.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl9/igt@kms_frontbuffer_tracking@psr-rgb565-draw-mmap-cpu.html

  * igt@kms_plane@plane-panning-bottom-right-pipe-a-planes:
    - shard-skl:          [FAIL][69] ([fdo#103166]) -> [PASS][70]
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl4/igt@kms_plane@plane-panning-bottom-right-pipe-a-planes.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl9/igt@kms_plane@plane-panning-bottom-right-pipe-a-planes.html

  * igt@kms_plane_alpha_blend@pipe-a-coverage-7efc:
    - shard-skl:          [FAIL][71] ([fdo#108145]) -> [PASS][72]
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl4/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl9/igt@kms_plane_alpha_blend@pipe-a-coverage-7efc.html

  * igt@kms_plane_lowres@pipe-a-tiling-y:
    - shard-iclb:         [FAIL][73] ([fdo#103166]) -> [PASS][74]
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb6/igt@kms_plane_lowres@pipe-a-tiling-y.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb4/igt@kms_plane_lowres@pipe-a-tiling-y.html

  * igt@kms_psr2_su@frontbuffer:
    - shard-iclb:         [SKIP][75] ([fdo#109642] / [fdo#111068]) -> [PASS][76]
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb6/igt@kms_psr2_su@frontbuffer.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb2/igt@kms_psr2_su@frontbuffer.html

  * igt@kms_psr@psr2_cursor_plane_onoff:
    - shard-iclb:         [SKIP][77] ([fdo#109441]) -> [PASS][78] +2 similar issues
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb8/igt@kms_psr@psr2_cursor_plane_onoff.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb2/igt@kms_psr@psr2_cursor_plane_onoff.html

  * igt@kms_vblank@pipe-b-query-forked-hang:
    - shard-hsw:          [INCOMPLETE][79] ([fdo#103540]) -> [PASS][80]
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-hsw8/igt@kms_vblank@pipe-b-query-forked-hang.html
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-hsw6/igt@kms_vblank@pipe-b-query-forked-hang.html

  * igt@perf@polling:
    - shard-skl:          [FAIL][81] ([fdo#110728]) -> [PASS][82]
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-skl2/igt@perf@polling.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-skl3/igt@perf@polling.html

  * igt@perf@short-reads:
    - shard-kbl:          [FAIL][83] ([fdo#103183]) -> [PASS][84]
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-kbl1/igt@perf@short-reads.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-kbl2/igt@perf@short-reads.html

  * igt@prime_vgem@fence-wait-bsd2:
    - shard-iclb:         [SKIP][85] ([fdo#109276]) -> [PASS][86] +17 similar issues
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb8/igt@prime_vgem@fence-wait-bsd2.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb2/igt@prime_vgem@fence-wait-bsd2.html

  
#### Warnings ####

  * igt@gem_ctx_isolation@vcs1-nonpriv:
    - shard-iclb:         [FAIL][87] ([fdo#111329]) -> [SKIP][88] ([fdo#109276])
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb4/igt@gem_ctx_isolation@vcs1-nonpriv.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb6/igt@gem_ctx_isolation@vcs1-nonpriv.html

  * igt@gem_mocs_settings@mocs-reset-bsd2:
    - shard-iclb:         [FAIL][89] ([fdo#111330]) -> [SKIP][90] ([fdo#109276]) +2 similar issues
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb1/igt@gem_mocs_settings@mocs-reset-bsd2.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb8/igt@gem_mocs_settings@mocs-reset-bsd2.html

  * igt@gem_userptr_blits@map-fixed-invalidate-busy-gup:
    - shard-apl:          [DMESG-WARN][91] ([fdo#109385]) -> [DMESG-WARN][92] ([fdo#109385] / [fdo#111870]) +1 similar issue
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-apl7/igt@gem_userptr_blits@map-fixed-invalidate-busy-gup.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-apl7/igt@gem_userptr_blits@map-fixed-invalidate-busy-gup.html

  * igt@kms_dp_dsc@basic-dsc-enable-edp:
    - shard-iclb:         [SKIP][93] ([fdo#109349]) -> [DMESG-WARN][94] ([fdo#107724])
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6979/shard-iclb1/igt@kms_dp_dsc@basic-dsc-enable-edp.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/shard-iclb2/igt@kms_dp_dsc@basic-dsc-enable-edp.html

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

  [fdo#102670]: https://bugs.freedesktop.org/show_bug.cgi?id=102670
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103183]: https://bugs.freedesktop.org/show_bug.cgi?id=103183
  [fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
  [fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
  [fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
  [fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
  [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
  [fdo#105957]: https://bugs.freedesktop.org/show_bug.cgi?id=105957
  [fdo#106978]: https://bugs.freedesktop.org/show_bug.cgi?id=106978
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
  [fdo#109385]: https://bugs.freedesktop.org/show_bug.cgi?id=109385
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
  [fdo#110403]: https://bugs.freedesktop.org/show_bug.cgi?id=110403
  [

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14598/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/tc: Implement the TC cold exit sequence
  2019-10-01  0:55 [PATCH] drm/i915/tc: Implement the TC cold exit sequence José Roberto de Souza
                   ` (2 preceding siblings ...)
  2019-10-01 10:04 ` ✗ Fi.CI.IGT: failure " Patchwork
@ 2019-10-03 14:50 ` Imre Deak
  2019-10-18 23:59   ` Souza, Jose
  3 siblings, 1 reply; 9+ messages in thread
From: Imre Deak @ 2019-10-03 14:50 UTC (permalink / raw)
  To: José Roberto de Souza; +Cc: intel-gfx, Lucas De Marchi

On Mon, Sep 30, 2019 at 05:55:36PM -0700, José Roberto de Souza wrote:
> This is required for legacy/static TC ports as IOM is not aware of
> the connection and will not trigger the TC cold exit.
> 
> BSpec: 21750
> BSpsc: 49294
> Cc: Imre Deak <imre.deak@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_tc.c | 34 ++++++++++++++++++++-----
>  drivers/gpu/drm/i915/i915_reg.h         |  1 +
>  2 files changed, 29 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c
> index 7773169b7331..09b78027bdd5 100644
> --- a/drivers/gpu/drm/i915/display/intel_tc.c
> +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> @@ -7,6 +7,7 @@
>  #include "intel_display.h"
>  #include "intel_display_types.h"
>  #include "intel_dp_mst.h"
> +#include "intel_sideband.h"
>  #include "intel_tc.h"
>  
>  static const char *tc_port_mode_name(enum tc_port_mode mode)
> @@ -169,6 +170,22 @@ static void tc_port_fixup_legacy_flag(struct intel_digital_port *dig_port,
>  	dig_port->tc_legacy_port = !dig_port->tc_legacy_port;
>  }
>  
> +static int tc_cold_exit_request(struct drm_i915_private *dev_priv)
> +{
> +	int ret;
> +
> +	do {
> +		ret = sandybridge_pcode_write_timeout(dev_priv,
> +						      ICL_PCODE_EXIT_TCCOLD, 0,
> +						      250, 1);
> +
> +	} while (ret == -EAGAIN);
> +
> +	DRM_DEBUG_KMS("tccold exit %s\n", ret == 0 ? "succeeded" : "failed");
> +
> +	return ret;
> +}
> +
>  static u32 tc_port_live_status_mask(struct intel_digital_port *dig_port)
>  {
>  	struct drm_i915_private *i915 = to_i915(dig_port->base.base.dev);
> @@ -177,13 +194,21 @@ static u32 tc_port_live_status_mask(struct intel_digital_port *dig_port)
>  	u32 mask = 0;
>  	u32 val;
>  
> +	if (intel_uncore_read(uncore, SDEISR) & SDE_TC_HOTPLUG_ICP(tc_port))
> +		mask |= BIT(TC_PORT_LEGACY);
> +
>  	val = intel_uncore_read(uncore,
>  				PORT_TX_DFLEXDPSP(dig_port->tc_phy_fia));
>  
>  	if (val == 0xffffffff) {
> -		DRM_DEBUG_KMS("Port %s: PHY in TCCOLD, nothing connected\n",
> -			      dig_port->tc_port_name);
> -		return mask;
> +		if (mask)
> +			tc_cold_exit_request(i915);

The semantic of the mbox command this needs is inherently racy on
systems with preemption, the instruction to use it is:

"""
Issue GT Driver mailbox command to exit TCCOLD, then complete steps b-d
within 500 milliseconds to prevent re-entry.
"""

We'd have to reach the point where we enable the AUX power in 500ms,
which can't be guaranteed. Moreover TCCOLD could be entered just after
reading PORT_TX_DFLEXDPSP, so we may not detect it.

What we can do - after discussing with HW folks - is to first request
AUX power and then issue the mbox command, which prevents TCCOLD
re-entry until releasing the AUX power request. This also needs ignoring
the timeout of the AUX power enabling ACK, since it will only be ACKed
after exiting TCCOLD.

So I think we should block TCCOLD this way in __intel_tc_port_lock():

	if tc_link_refcount==0:
		intel_display_power_get(POWER_DOMAIN_AUX_<port>)
		tc_cold_exit_request()
		if intel_tc_port_needs_reset():
			intel_tc_port_reset_mode()
		if tc_mode != LEGACY:
			intel_display_power_put(POWER_DOMAIN_AUX_<port>)

then unblock TCCOLD in intel_tc_port_unlock():

	if tc_link_refcount==0 and tc_mode == LEGACY:
		intel_display_power_put(POWER_DOMAIN_AUX_<port>)
	
> +
> +		if (val == 0xffffffff) {
> +			DRM_DEBUG_KMS("Port %s: PHY in TCCOLD, nothing connected\n",
> +				      dig_port->tc_port_name);
> +			return mask;
> +		}
>  	}
>  
>  	if (val & TC_LIVE_STATE_TBT(dig_port->tc_phy_fia_idx))
> @@ -191,9 +216,6 @@ static u32 tc_port_live_status_mask(struct intel_digital_port *dig_port)
>  	if (val & TC_LIVE_STATE_TC(dig_port->tc_phy_fia_idx))
>  		mask |= BIT(TC_PORT_DP_ALT);
>  
> -	if (intel_uncore_read(uncore, SDEISR) & SDE_TC_HOTPLUG_ICP(tc_port))
> -		mask |= BIT(TC_PORT_LEGACY);
> -
>  	/* The sink can be connected only in a single mode. */
>  	if (!WARN_ON(hweight32(mask) > 1))
>  		tc_port_fixup_legacy_flag(dig_port, mask);
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 058aa5ca8b73..35c3724b7fef 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -8860,6 +8860,7 @@ enum {
>  #define     ICL_PCODE_MEM_SS_READ_QGV_POINT_INFO(point)	(((point) << 16) | (0x1 << 8))
>  #define   GEN6_PCODE_READ_D_COMP		0x10
>  #define   GEN6_PCODE_WRITE_D_COMP		0x11
> +#define   ICL_PCODE_EXIT_TCCOLD			0x12
>  #define   HSW_PCODE_DE_WRITE_FREQ_REQ		0x17
>  #define   DISPLAY_IPS_CONTROL			0x19
>              /* See also IPS_CTL */
> -- 
> 2.23.0
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/tc: Implement the TC cold exit sequence
  2019-10-03 14:50 ` [PATCH] drm/i915/tc: Implement the TC cold exit sequence Imre Deak
@ 2019-10-18 23:59   ` Souza, Jose
  2019-10-19 10:49     ` Imre Deak
  0 siblings, 1 reply; 9+ messages in thread
From: Souza, Jose @ 2019-10-18 23:59 UTC (permalink / raw)
  To: Deak, Imre; +Cc: intel-gfx, De Marchi, Lucas

On Thu, 2019-10-03 at 17:50 +0300, Imre Deak wrote:
> On Mon, Sep 30, 2019 at 05:55:36PM -0700, José Roberto de Souza
> wrote:
> > This is required for legacy/static TC ports as IOM is not aware of
> > the connection and will not trigger the TC cold exit.
> > 
> > BSpec: 21750
> > BSpsc: 49294
> > Cc: Imre Deak <imre.deak@intel.com>
> > Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_tc.c | 34 ++++++++++++++++++++-
> > ----
> >  drivers/gpu/drm/i915/i915_reg.h         |  1 +
> >  2 files changed, 29 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_tc.c
> > b/drivers/gpu/drm/i915/display/intel_tc.c
> > index 7773169b7331..09b78027bdd5 100644
> > --- a/drivers/gpu/drm/i915/display/intel_tc.c
> > +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> > @@ -7,6 +7,7 @@
> >  #include "intel_display.h"
> >  #include "intel_display_types.h"
> >  #include "intel_dp_mst.h"
> > +#include "intel_sideband.h"
> >  #include "intel_tc.h"
> >  
> >  static const char *tc_port_mode_name(enum tc_port_mode mode)
> > @@ -169,6 +170,22 @@ static void tc_port_fixup_legacy_flag(struct
> > intel_digital_port *dig_port,
> >  	dig_port->tc_legacy_port = !dig_port->tc_legacy_port;
> >  }
> >  
> > +static int tc_cold_exit_request(struct drm_i915_private *dev_priv)
> > +{
> > +	int ret;
> > +
> > +	do {
> > +		ret = sandybridge_pcode_write_timeout(dev_priv,
> > +						      ICL_PCODE_EXIT_TC
> > COLD, 0,
> > +						      250, 1);
> > +
> > +	} while (ret == -EAGAIN);
> > +
> > +	DRM_DEBUG_KMS("tccold exit %s\n", ret == 0 ? "succeeded" :
> > "failed");
> > +
> > +	return ret;
> > +}
> > +
> >  static u32 tc_port_live_status_mask(struct intel_digital_port
> > *dig_port)
> >  {
> >  	struct drm_i915_private *i915 = to_i915(dig_port-
> > >base.base.dev);
> > @@ -177,13 +194,21 @@ static u32 tc_port_live_status_mask(struct
> > intel_digital_port *dig_port)
> >  	u32 mask = 0;
> >  	u32 val;
> >  
> > +	if (intel_uncore_read(uncore, SDEISR) &
> > SDE_TC_HOTPLUG_ICP(tc_port))
> > +		mask |= BIT(TC_PORT_LEGACY);
> > +
> >  	val = intel_uncore_read(uncore,
> >  				PORT_TX_DFLEXDPSP(dig_port-
> > >tc_phy_fia));
> >  
> >  	if (val == 0xffffffff) {
> > -		DRM_DEBUG_KMS("Port %s: PHY in TCCOLD, nothing
> > connected\n",
> > -			      dig_port->tc_port_name);
> > -		return mask;
> > +		if (mask)
> > +			tc_cold_exit_request(i915);


Sorry for the delay, was OOO.

> 
> The semantic of the mbox command this needs is inherently racy on
> systems with preemption, the instruction to use it is:
> 
> """
> Issue GT Driver mailbox command to exit TCCOLD, then complete steps
> b-d
> within 500 milliseconds to prevent re-entry.
> """
> 
> We'd have to reach the point where we enable the AUX power in 500ms,
> which can't be guaranteed. Moreover TCCOLD could be entered just
> after
> reading PORT_TX_DFLEXDPSP, so we may not detect it.
> 
> What we can do - after discussing with HW folks - is to first request
> AUX power and then issue the mbox command, which prevents TCCOLD
> re-entry until releasing the AUX power request. This also needs
> ignoring
> the timeout of the AUX power enabling ACK, since it will only be
> ACKed
> after exiting TCCOLD.


Huum looks more robust indeed.

> 
> So I think we should block TCCOLD this way in __intel_tc_port_lock():
> 
> 	if tc_link_refcount==0:
> 		intel_display_power_get(POWER_DOMAIN_AUX_<port>)
> 		tc_cold_exit_request()

So for non-legacy the IOM request to exit TCCOLD could have timed out
at this point. But for most cases this will not happen, why not here
read one FIA register and check if == 0xffffffff if so we call
tc_cold_exit_request().

> 		if intel_tc_port_needs_reset():
> 			intel_tc_port_reset_mode()
> 		if tc_mode != LEGACY:
> 			intel_display_power_put(POWER_DOMAIN_AUX_<port>

Also why power_put() for non-legacy? a preemption could happen after
lock() and cause a TCCOLD before the needed reads/writes to FIA is
done.

Better remove this block and only power_put() when removing the last
reference on intel_tc_port_unlock()

> )
> 
> then unblock TCCOLD in intel_tc_port_unlock():
> 
> 	if tc_link_refcount==0 and tc_mode == LEGACY:
> 		intel_display_power_put(POWER_DOMAIN_AUX_<port>)
> 	
> > +
> > +		if (val == 0xffffffff) {
> > +			DRM_DEBUG_KMS("Port %s: PHY in TCCOLD, nothing
> > connected\n",
> > +				      dig_port->tc_port_name);
> > +			return mask;
> > +		}
> >  	}
> >  
> >  	if (val & TC_LIVE_STATE_TBT(dig_port->tc_phy_fia_idx))
> > @@ -191,9 +216,6 @@ static u32 tc_port_live_status_mask(struct
> > intel_digital_port *dig_port)
> >  	if (val & TC_LIVE_STATE_TC(dig_port->tc_phy_fia_idx))
> >  		mask |= BIT(TC_PORT_DP_ALT);
> >  
> > -	if (intel_uncore_read(uncore, SDEISR) &
> > SDE_TC_HOTPLUG_ICP(tc_port))
> > -		mask |= BIT(TC_PORT_LEGACY);
> > -
> >  	/* The sink can be connected only in a single mode. */
> >  	if (!WARN_ON(hweight32(mask) > 1))
> >  		tc_port_fixup_legacy_flag(dig_port, mask);
> > diff --git a/drivers/gpu/drm/i915/i915_reg.h
> > b/drivers/gpu/drm/i915/i915_reg.h
> > index 058aa5ca8b73..35c3724b7fef 100644
> > --- a/drivers/gpu/drm/i915/i915_reg.h
> > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > @@ -8860,6 +8860,7 @@ enum {
> >  #define     ICL_PCODE_MEM_SS_READ_QGV_POINT_INFO(point)	(((poin
> > t) << 16) | (0x1 << 8))
> >  #define   GEN6_PCODE_READ_D_COMP		0x10
> >  #define   GEN6_PCODE_WRITE_D_COMP		0x11
> > +#define   ICL_PCODE_EXIT_TCCOLD			0x12
> >  #define   HSW_PCODE_DE_WRITE_FREQ_REQ		0x17
> >  #define   DISPLAY_IPS_CONTROL			0x19
> >              /* See also IPS_CTL */
> > -- 
> > 2.23.0
> > 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/tc: Implement the TC cold exit sequence
  2019-10-18 23:59   ` Souza, Jose
@ 2019-10-19 10:49     ` Imre Deak
  2019-10-22  0:03       ` Souza, Jose
  0 siblings, 1 reply; 9+ messages in thread
From: Imre Deak @ 2019-10-19 10:49 UTC (permalink / raw)
  To: Souza, Jose; +Cc: intel-gfx, De Marchi, Lucas

On Sat, Oct 19, 2019 at 02:59:14AM +0300, Souza, Jose wrote:
> On Thu, 2019-10-03 at 17:50 +0300, Imre Deak wrote:
> > On Mon, Sep 30, 2019 at 05:55:36PM -0700, José Roberto de Souza
> > wrote:
> > > This is required for legacy/static TC ports as IOM is not aware of
> > > the connection and will not trigger the TC cold exit.
> > > 
> > > BSpec: 21750
> > > BSpsc: 49294
> > > Cc: Imre Deak <imre.deak@intel.com>
> > > Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_tc.c | 34 ++++++++++++++++++++-
> > > ----
> > >  drivers/gpu/drm/i915/i915_reg.h         |  1 +
> > >  2 files changed, 29 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/display/intel_tc.c
> > > b/drivers/gpu/drm/i915/display/intel_tc.c
> > > index 7773169b7331..09b78027bdd5 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_tc.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> > > @@ -7,6 +7,7 @@
> > >  #include "intel_display.h"
> > >  #include "intel_display_types.h"
> > >  #include "intel_dp_mst.h"
> > > +#include "intel_sideband.h"
> > >  #include "intel_tc.h"
> > >  
> > >  static const char *tc_port_mode_name(enum tc_port_mode mode)
> > > @@ -169,6 +170,22 @@ static void tc_port_fixup_legacy_flag(struct
> > > intel_digital_port *dig_port,
> > >  	dig_port->tc_legacy_port = !dig_port->tc_legacy_port;
> > >  }
> > >  
> > > +static int tc_cold_exit_request(struct drm_i915_private *dev_priv)
> > > +{
> > > +	int ret;
> > > +
> > > +	do {
> > > +		ret = sandybridge_pcode_write_timeout(dev_priv,
> > > +						      ICL_PCODE_EXIT_TC
> > > COLD, 0,
> > > +						      250, 1);
> > > +
> > > +	} while (ret == -EAGAIN);
> > > +
> > > +	DRM_DEBUG_KMS("tccold exit %s\n", ret == 0 ? "succeeded" :
> > > "failed");
> > > +
> > > +	return ret;
> > > +}
> > > +
> > >  static u32 tc_port_live_status_mask(struct intel_digital_port
> > > *dig_port)
> > >  {
> > >  	struct drm_i915_private *i915 = to_i915(dig_port-
> > > >base.base.dev);
> > > @@ -177,13 +194,21 @@ static u32 tc_port_live_status_mask(struct
> > > intel_digital_port *dig_port)
> > >  	u32 mask = 0;
> > >  	u32 val;
> > >  
> > > +	if (intel_uncore_read(uncore, SDEISR) &
> > > SDE_TC_HOTPLUG_ICP(tc_port))
> > > +		mask |= BIT(TC_PORT_LEGACY);
> > > +
> > >  	val = intel_uncore_read(uncore,
> > >  				PORT_TX_DFLEXDPSP(dig_port-
> > > >tc_phy_fia));
> > >  
> > >  	if (val == 0xffffffff) {
> > > -		DRM_DEBUG_KMS("Port %s: PHY in TCCOLD, nothing
> > > connected\n",
> > > -			      dig_port->tc_port_name);
> > > -		return mask;
> > > +		if (mask)
> > > +			tc_cold_exit_request(i915);
> 
> 
> Sorry for the delay, was OOO.
> 
> > 
> > The semantic of the mbox command this needs is inherently racy on
> > systems with preemption, the instruction to use it is:
> > 
> > """
> > Issue GT Driver mailbox command to exit TCCOLD, then complete steps
> > b-d
> > within 500 milliseconds to prevent re-entry.
> > """
> > 
> > We'd have to reach the point where we enable the AUX power in 500ms,
> > which can't be guaranteed. Moreover TCCOLD could be entered just
> > after
> > reading PORT_TX_DFLEXDPSP, so we may not detect it.
> > 
> > What we can do - after discussing with HW folks - is to first request
> > AUX power and then issue the mbox command, which prevents TCCOLD
> > re-entry until releasing the AUX power request. This also needs
> > ignoring
> > the timeout of the AUX power enabling ACK, since it will only be
> > ACKed
> > after exiting TCCOLD.
> 
> 
> Huum looks more robust indeed.
> 
> > 
> > So I think we should block TCCOLD this way in __intel_tc_port_lock():
> > 
> > 	if tc_link_refcount==0:
> > 		intel_display_power_get(POWER_DOMAIN_AUX_<port>)
> > 		tc_cold_exit_request()
> 
> So for non-legacy the IOM request to exit TCCOLD could have timed out
> at this point. But for most cases this will not happen, why not here
> read one FIA register and check if == 0xffffffff if so we call
> tc_cold_exit_request().

That would be racy, TCCOLD could be entered right after doing the FIA
reg check. Getting the AUX power ref alone won't prevent a TCCOLD entry
until the PCODE command has completed.

> 
> > 		if intel_tc_port_needs_reset():
> > 			intel_tc_port_reset_mode()
> > 		if tc_mode != LEGACY:
> > 			intel_display_power_put(POWER_DOMAIN_AUX_<port>
> 
> Also why power_put() for non-legacy? a preemption could happen after
> lock() and cause a TCCOLD before the needed reads/writes to FIA is
> done.

The new PCODE command was only added for legacy and the AUX power
reference makes a difference only in that mode. In DP-alt mode the
DPCSSS.DPPMSTC flag prevents TCCOLD.

In TBT mode the TBT AUX power ref would not prevent TCCOLD. In that mode
we don't access FIA regs afterwards and
"the TBT controller prevents TCCOLD while it uses the connection".

> 
> Better remove this block and only power_put() when removing the last
> reference on intel_tc_port_unlock()
> 
> > )
> > 
> > then unblock TCCOLD in intel_tc_port_unlock():
> > 
> > 	if tc_link_refcount==0 and tc_mode == LEGACY:
> > 		intel_display_power_put(POWER_DOMAIN_AUX_<port>)
> > 	
> > > +
> > > +		if (val == 0xffffffff) {
> > > +			DRM_DEBUG_KMS("Port %s: PHY in TCCOLD, nothing
> > > connected\n",
> > > +				      dig_port->tc_port_name);
> > > +			return mask;
> > > +		}
> > >  	}
> > >  
> > >  	if (val & TC_LIVE_STATE_TBT(dig_port->tc_phy_fia_idx))
> > > @@ -191,9 +216,6 @@ static u32 tc_port_live_status_mask(struct
> > > intel_digital_port *dig_port)
> > >  	if (val & TC_LIVE_STATE_TC(dig_port->tc_phy_fia_idx))
> > >  		mask |= BIT(TC_PORT_DP_ALT);
> > >  
> > > -	if (intel_uncore_read(uncore, SDEISR) &
> > > SDE_TC_HOTPLUG_ICP(tc_port))
> > > -		mask |= BIT(TC_PORT_LEGACY);
> > > -
> > >  	/* The sink can be connected only in a single mode. */
> > >  	if (!WARN_ON(hweight32(mask) > 1))
> > >  		tc_port_fixup_legacy_flag(dig_port, mask);
> > > diff --git a/drivers/gpu/drm/i915/i915_reg.h
> > > b/drivers/gpu/drm/i915/i915_reg.h
> > > index 058aa5ca8b73..35c3724b7fef 100644
> > > --- a/drivers/gpu/drm/i915/i915_reg.h
> > > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > > @@ -8860,6 +8860,7 @@ enum {
> > >  #define     ICL_PCODE_MEM_SS_READ_QGV_POINT_INFO(point)	(((poin
> > > t) << 16) | (0x1 << 8))
> > >  #define   GEN6_PCODE_READ_D_COMP		0x10
> > >  #define   GEN6_PCODE_WRITE_D_COMP		0x11
> > > +#define   ICL_PCODE_EXIT_TCCOLD			0x12
> > >  #define   HSW_PCODE_DE_WRITE_FREQ_REQ		0x17
> > >  #define   DISPLAY_IPS_CONTROL			0x19
> > >              /* See also IPS_CTL */
> > > -- 
> > > 2.23.0
> > > 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/tc: Implement the TC cold exit sequence
  2019-10-19 10:49     ` Imre Deak
@ 2019-10-22  0:03       ` Souza, Jose
  2019-10-22 15:52         ` Imre Deak
  0 siblings, 1 reply; 9+ messages in thread
From: Souza, Jose @ 2019-10-22  0:03 UTC (permalink / raw)
  To: Deak, Imre; +Cc: intel-gfx, De Marchi, Lucas

On Sat, 2019-10-19 at 13:49 +0300, Imre Deak wrote:
> On Sat, Oct 19, 2019 at 02:59:14AM +0300, Souza, Jose wrote:
> > On Thu, 2019-10-03 at 17:50 +0300, Imre Deak wrote:
> > > On Mon, Sep 30, 2019 at 05:55:36PM -0700, José Roberto de Souza
> > > wrote:
> > > > This is required for legacy/static TC ports as IOM is not aware
> > > > of
> > > > the connection and will not trigger the TC cold exit.
> > > > 
> > > > BSpec: 21750
> > > > BSpsc: 49294
> > > > Cc: Imre Deak <imre.deak@intel.com>
> > > > Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> > > > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > > > ---
> > > >  drivers/gpu/drm/i915/display/intel_tc.c | 34
> > > > ++++++++++++++++++++-
> > > > ----
> > > >  drivers/gpu/drm/i915/i915_reg.h         |  1 +
> > > >  2 files changed, 29 insertions(+), 6 deletions(-)
> > > > 
> > > > diff --git a/drivers/gpu/drm/i915/display/intel_tc.c
> > > > b/drivers/gpu/drm/i915/display/intel_tc.c
> > > > index 7773169b7331..09b78027bdd5 100644
> > > > --- a/drivers/gpu/drm/i915/display/intel_tc.c
> > > > +++ b/drivers/gpu/drm/i915/display/intel_tc.c
> > > > @@ -7,6 +7,7 @@
> > > >  #include "intel_display.h"
> > > >  #include "intel_display_types.h"
> > > >  #include "intel_dp_mst.h"
> > > > +#include "intel_sideband.h"
> > > >  #include "intel_tc.h"
> > > >  
> > > >  static const char *tc_port_mode_name(enum tc_port_mode mode)
> > > > @@ -169,6 +170,22 @@ static void
> > > > tc_port_fixup_legacy_flag(struct
> > > > intel_digital_port *dig_port,
> > > >  	dig_port->tc_legacy_port = !dig_port->tc_legacy_port;
> > > >  }
> > > >  
> > > > +static int tc_cold_exit_request(struct drm_i915_private
> > > > *dev_priv)
> > > > +{
> > > > +	int ret;
> > > > +
> > > > +	do {
> > > > +		ret = sandybridge_pcode_write_timeout(dev_priv,
> > > > +						      ICL_PCODE
> > > > _EXIT_TC
> > > > COLD, 0,
> > > > +						      250, 1);
> > > > +
> > > > +	} while (ret == -EAGAIN);
> > > > +
> > > > +	DRM_DEBUG_KMS("tccold exit %s\n", ret == 0 ?
> > > > "succeeded" :
> > > > "failed");
> > > > +
> > > > +	return ret;
> > > > +}
> > > > +
> > > >  static u32 tc_port_live_status_mask(struct intel_digital_port
> > > > *dig_port)
> > > >  {
> > > >  	struct drm_i915_private *i915 = to_i915(dig_port-
> > > > > base.base.dev);
> > > > @@ -177,13 +194,21 @@ static u32
> > > > tc_port_live_status_mask(struct
> > > > intel_digital_port *dig_port)
> > > >  	u32 mask = 0;
> > > >  	u32 val;
> > > >  
> > > > +	if (intel_uncore_read(uncore, SDEISR) &
> > > > SDE_TC_HOTPLUG_ICP(tc_port))
> > > > +		mask |= BIT(TC_PORT_LEGACY);
> > > > +
> > > >  	val = intel_uncore_read(uncore,
> > > >  				PORT_TX_DFLEXDPSP(dig_port-
> > > > > tc_phy_fia));
> > > >  
> > > >  	if (val == 0xffffffff) {
> > > > -		DRM_DEBUG_KMS("Port %s: PHY in TCCOLD, nothing
> > > > connected\n",
> > > > -			      dig_port->tc_port_name);
> > > > -		return mask;
> > > > +		if (mask)
> > > > +			tc_cold_exit_request(i915);
> > 
> > Sorry for the delay, was OOO.
> > 
> > > The semantic of the mbox command this needs is inherently racy on
> > > systems with preemption, the instruction to use it is:
> > > 
> > > """
> > > Issue GT Driver mailbox command to exit TCCOLD, then complete
> > > steps
> > > b-d
> > > within 500 milliseconds to prevent re-entry.
> > > """
> > > 
> > > We'd have to reach the point where we enable the AUX power in
> > > 500ms,
> > > which can't be guaranteed. Moreover TCCOLD could be entered just
> > > after
> > > reading PORT_TX_DFLEXDPSP, so we may not detect it.
> > > 
> > > What we can do - after discussing with HW folks - is to first
> > > request
> > > AUX power and then issue the mbox command, which prevents TCCOLD
> > > re-entry until releasing the AUX power request. This also needs
> > > ignoring
> > > the timeout of the AUX power enabling ACK, since it will only be
> > > ACKed
> > > after exiting TCCOLD.
> > 
> > Huum looks more robust indeed.
> > 
> > > So I think we should block TCCOLD this way in
> > > __intel_tc_port_lock():
> > > 
> > > 	if tc_link_refcount==0:
> > > 		intel_display_power_get(POWER_DOMAIN_AUX_<port>)
> > > 		tc_cold_exit_request()
> > 
> > So for non-legacy the IOM request to exit TCCOLD could have timed
> > out
> > at this point. But for most cases this will not happen, why not
> > here
> > read one FIA register and check if == 0xffffffff if so we call
> > tc_cold_exit_request().
> 
> That would be racy, TCCOLD could be entered right after doing the FIA
> reg check. Getting the AUX power ref alone won't prevent a TCCOLD
> entry
> until the PCODE command has completed.
> 
> > > 		if intel_tc_port_needs_reset():
> > > 			intel_tc_port_reset_mode()
> > > 		if tc_mode != LEGACY:
> > > 			intel_display_power_put(POWER_DOMAIN_AUX_<port>
> > 
> > Also why power_put() for non-legacy? a preemption could happen
> > after
> > lock() and cause a TCCOLD before the needed reads/writes to FIA is
> > done.
> 
> The new PCODE command was only added for legacy and the AUX power
> reference makes a difference only in that mode. In DP-alt mode the
> DPCSSS.DPPMSTC flag prevents TCCOLD.
> 
> In TBT mode the TBT AUX power ref would not prevent TCCOLD. In that
> mode
> we don't access FIA regs afterwards and
> "the TBT controller prevents TCCOLD while it uses the connection".

Makes sense, well the only doubt that I have is if getting
POWER_DOMAIN_AUX_<port>_TBT will prevent TCCOLD for legacy and alt-
mode, as at this point we still don't know if it is alt-mode, TBT or
legacy(we know that is legacy but live status could be reporting
something else tc_port_fixup_legacy_flag())

> 
> > Better remove this block and only power_put() when removing the
> > last
> > reference on intel_tc_port_unlock()
> > 
> > > )
> > > 
> > > then unblock TCCOLD in intel_tc_port_unlock():
> > > 
> > > 	if tc_link_refcount==0 and tc_mode == LEGACY:
> > > 		intel_display_power_put(POWER_DOMAIN_AUX_<port>)
> > > 	
> > > > +
> > > > +		if (val == 0xffffffff) {
> > > > +			DRM_DEBUG_KMS("Port %s: PHY in TCCOLD,
> > > > nothing
> > > > connected\n",
> > > > +				      dig_port->tc_port_name);
> > > > +			return mask;
> > > > +		}
> > > >  	}
> > > >  
> > > >  	if (val & TC_LIVE_STATE_TBT(dig_port->tc_phy_fia_idx))
> > > > @@ -191,9 +216,6 @@ static u32 tc_port_live_status_mask(struct
> > > > intel_digital_port *dig_port)
> > > >  	if (val & TC_LIVE_STATE_TC(dig_port->tc_phy_fia_idx))
> > > >  		mask |= BIT(TC_PORT_DP_ALT);
> > > >  
> > > > -	if (intel_uncore_read(uncore, SDEISR) &
> > > > SDE_TC_HOTPLUG_ICP(tc_port))
> > > > -		mask |= BIT(TC_PORT_LEGACY);
> > > > -
> > > >  	/* The sink can be connected only in a single mode. */
> > > >  	if (!WARN_ON(hweight32(mask) > 1))
> > > >  		tc_port_fixup_legacy_flag(dig_port, mask);
> > > > diff --git a/drivers/gpu/drm/i915/i915_reg.h
> > > > b/drivers/gpu/drm/i915/i915_reg.h
> > > > index 058aa5ca8b73..35c3724b7fef 100644
> > > > --- a/drivers/gpu/drm/i915/i915_reg.h
> > > > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > > > @@ -8860,6 +8860,7 @@ enum {
> > > >  #define     ICL_PCODE_MEM_SS_READ_QGV_POINT_INFO(point)	
> > > > (((poin
> > > > t) << 16) | (0x1 << 8))
> > > >  #define   GEN6_PCODE_READ_D_COMP		0x10
> > > >  #define   GEN6_PCODE_WRITE_D_COMP		0x11
> > > > +#define   ICL_PCODE_EXIT_TCCOLD			0x12
> > > >  #define   HSW_PCODE_DE_WRITE_FREQ_REQ		0x17
> > > >  #define   DISPLAY_IPS_CONTROL			0x19
> > > >              /* See also IPS_CTL */
> > > > -- 
> > > > 2.23.0
> > > > 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/tc: Implement the TC cold exit sequence
  2019-10-22  0:03       ` Souza, Jose
@ 2019-10-22 15:52         ` Imre Deak
  0 siblings, 0 replies; 9+ messages in thread
From: Imre Deak @ 2019-10-22 15:52 UTC (permalink / raw)
  To: Souza, Jose; +Cc: intel-gfx, De Marchi, Lucas

On Tue, Oct 22, 2019 at 03:03:18AM +0300, Souza, Jose wrote:
> [...] 
> Makes sense, well the only doubt that I have is if getting
> POWER_DOMAIN_AUX_<port>_TBT will prevent TCCOLD for legacy and alt-
> mode, 

Why do we need to care about POWER_DOMAIN_AUX_<port>_TBT? It doesn't
affect the TCCOLD state and we shouldn't get it here.

> as at this point we still don't know if it is alt-mode, TBT or
> legacy(we know that is legacy but live status could be reporting
> something else tc_port_fixup_legacy_flag())

We enable the non-TBT AUX power and then drop after the mode is already
known and it's other than legacy.

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

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

end of thread, other threads:[~2019-10-22 15:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01  0:55 [PATCH] drm/i915/tc: Implement the TC cold exit sequence José Roberto de Souza
2019-10-01  1:39 ` ✗ Fi.CI.BAT: failure for " Patchwork
2019-10-01  7:56 ` ✓ Fi.CI.BAT: success for drm/i915/tc: Implement the TC cold exit sequence (rev2) Patchwork
2019-10-01 10:04 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-10-03 14:50 ` [PATCH] drm/i915/tc: Implement the TC cold exit sequence Imre Deak
2019-10-18 23:59   ` Souza, Jose
2019-10-19 10:49     ` Imre Deak
2019-10-22  0:03       ` Souza, Jose
2019-10-22 15:52         ` Imre Deak

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.