[10/23] drm/i915: Wait for TypeC PHY complete flag to clear in safe mode

Submitted by Imre Deak on June 4, 2019, 2:58 p.m.

Details

Message ID 20190604145826.16424-11-imre.deak@intel.com
State New
Headers show
Series "drm/i915: Fix TypeC port mode switching" ( rev: 2 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Imre Deak June 4, 2019, 2:58 p.m.
The PHY satus complete flag normally clears when disconnecting the PHY
in DP-alt mode (achieved by switching to safe mode), so wait for the
flag to clear.

Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/intel_tc.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/intel_tc.c b/drivers/gpu/drm/i915/intel_tc.c
index 3fdcfa2bbaee..84e0c06877ec 100644
--- a/drivers/gpu/drm/i915/intel_tc.c
+++ b/drivers/gpu/drm/i915/intel_tc.c
@@ -143,6 +143,10 @@  static void icl_tc_phy_set_safe_mode(struct intel_digital_port *dig_port,
 		val |= DP_PHY_MODE_STATUS_NOT_SAFE(tc_port);
 
 	I915_WRITE(PORT_TX_DFLEXDPCSSS, val);
+
+	if (enable && wait_for(!icl_tc_phy_status_complete(dig_port), 10))
+		DRM_DEBUG_DRIVER("Port %s: PHY complete clear timed out\n",
+				 tc_port_name(dev_priv, tc_port));
 }
 
 /*

Comments

On Tue, 2019-06-04 at 17:58 +0300, Imre Deak wrote:
> The PHY satus complete flag normally clears when disconnecting the 


s/satus/status

> PHY

> in DP-alt mode (achieved by switching to safe mode), so wait for the

> flag to clear.

> 

> Cc: José Roberto de Souza <jose.souza@intel.com>

> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>

> Signed-off-by: Imre Deak <imre.deak@intel.com>

> ---

>  drivers/gpu/drm/i915/intel_tc.c | 4 ++++

>  1 file changed, 4 insertions(+)

> 

> diff --git a/drivers/gpu/drm/i915/intel_tc.c

> b/drivers/gpu/drm/i915/intel_tc.c

> index 3fdcfa2bbaee..84e0c06877ec 100644

> --- a/drivers/gpu/drm/i915/intel_tc.c

> +++ b/drivers/gpu/drm/i915/intel_tc.c

> @@ -143,6 +143,10 @@ static void icl_tc_phy_set_safe_mode(struct

> intel_digital_port *dig_port,

>  		val |= DP_PHY_MODE_STATUS_NOT_SAFE(tc_port);

>  

>  	I915_WRITE(PORT_TX_DFLEXDPCSSS, val);

> +

> +	if (enable && wait_for(!icl_tc_phy_status_complete(dig_port),

> 10))

> +		DRM_DEBUG_DRIVER("Port %s: PHY complete clear timed

> out\n",

> +				 tc_port_name(dev_priv, tc_port));


No mention in spec that we need to do that but it should not harm.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>


>  }

>  

>  /*