From: Imre Deak Date: Fri, 28 Jun 2019 14:36:22 +0000 (+0300) Subject: drm/i915: Wait for TypeC PHY complete flag to clear in safe mode X-Git-Tag: Ubuntu-5.13.0-19.19~7656^2~19^2~260 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=ddec362724f98a6725aeafda7701a40635c15909;p=mirror_ubuntu-jammy-kernel.git drm/i915: Wait for TypeC PHY complete flag to clear in safe mode The PHY status 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. v2: - Use DRM_DEBUG_KMS instead of DRM_DEBUG_DRIVER. (José) Cc: José Roberto de Souza Cc: Rodrigo Vivi Signed-off-by: Imre Deak Reviewed-by: José Roberto de Souza Link: https://patchwork.freedesktop.org/patch/msgid/20190628143635.22066-11-imre.deak@intel.com --- diff --git a/drivers/gpu/drm/i915/display/intel_tc.c b/drivers/gpu/drm/i915/display/intel_tc.c index f0688c7450c7..4243db6d25a7 100644 --- a/drivers/gpu/drm/i915/display/intel_tc.c +++ b/drivers/gpu/drm/i915/display/intel_tc.c @@ -130,6 +130,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_KMS("Port %s: PHY complete clear timed out\n", + dig_port->tc_port_name); } /*