public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "José Roberto de Souza" <jose.souza@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Subject: [PATCH 2/6] drm/i915/icl: Set TC type to unknown in the disconnection flow
Date: Wed, 10 Oct 2018 14:35:04 -0700	[thread overview]
Message-ID: <20181010213508.3046-2-jose.souza@intel.com> (raw)
In-Reply-To: <20181010213508.3046-1-jose.souza@intel.com>

Otherwise it would be in a inconsistent state as port is disconnected
but with a valid tc type.

Also setting it to unknown will earlier return
icl_tc_phy_disconnect() for any future calls to
intel_digital_port_connected(), this way we don't need to check if
port is marked as safe everytime.

Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 13ff89be6ad6..d3f31103b8ec 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4934,21 +4934,24 @@ static void icl_tc_phy_disconnect(struct drm_i915_private *dev_priv,
 				  struct intel_digital_port *dig_port)
 {
 	enum tc_port tc_port = intel_port_to_tc(dev_priv, dig_port->base.port);
-	u32 val;
 
-	if (dig_port->tc_type != TC_PORT_LEGACY &&
-	    dig_port->tc_type != TC_PORT_TYPEC)
+	if (dig_port->tc_type == TC_PORT_UNKNOWN)
 		return;
 
 	/*
-	 * This function may be called many times in a row without an HPD event
-	 * in between, so try to avoid the write when we can.
+	 * TBT disconnection flow is read the live status, what was done in
+	 * caller.
 	 */
-	val = I915_READ(PORT_TX_DFLEXDPCSSS);
-	if (val & DP_PHY_MODE_STATUS_NOT_SAFE(tc_port)) {
+	if (dig_port->tc_type == TC_PORT_TYPEC ||
+	    dig_port->tc_type == TC_PORT_LEGACY) {
+		u32 val;
+
+		val = I915_READ(PORT_TX_DFLEXDPCSSS);
 		val &= ~DP_PHY_MODE_STATUS_NOT_SAFE(tc_port);
 		I915_WRITE(PORT_TX_DFLEXDPCSSS, val);
 	}
+
+	dig_port->tc_type = TC_PORT_UNKNOWN;
 }
 
 /*
-- 
2.19.1

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

  reply	other threads:[~2018-10-10 21:36 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-10 21:35 [PATCH 1/6] drm/i915/debugfs: Do not print cached information of a disconnected sink José Roberto de Souza
2018-10-10 21:35 ` José Roberto de Souza [this message]
2018-10-10 21:35 ` [PATCH 3/6] drm/i915/icl: Set TC type to unknown when a sudden disconnection happen José Roberto de Souza
2018-10-30 17:51   ` Ville Syrjälä
2018-10-30 20:42     ` Souza, Jose
2018-10-10 21:35 ` [PATCH 4/6] drm/i915: Initialize panel_vdd_work only for eDP ports José Roberto de Souza
2018-10-30 17:51   ` Ville Syrjälä
2018-10-10 21:35 ` [PATCH 5/6] drm/i915/icl: Delay hotplug processing for tc ports José Roberto de Souza
2018-10-30 17:52   ` Ville Syrjälä
2018-10-31  1:02     ` Souza, Jose
2018-10-10 21:35 ` [PATCH 6/6] drm/i915/icl: Fix crash when getting DPLL of a MST encoder in TC ports José Roberto de Souza
2018-10-30 17:56   ` Ville Syrjälä
2018-10-10 21:52 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/6] drm/i915/debugfs: Do not print cached information of a disconnected sink Patchwork
2018-10-10 22:12 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-11  7:54 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181010213508.3046-2-jose.souza@intel.com \
    --to=jose.souza@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=paulo.r.zanoni@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox