All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Subject: [PATCH 5/9] drm/i915/dp: Remove intel_dp->is_mst check in intel_dp_check_mst_status
Date: Tue, 12 Sep 2017 16:57:26 -0700	[thread overview]
Message-ID: <20170912235730.3492-5-dhinakaran.pandiyan@intel.com> (raw)
In-Reply-To: <20170912235730.3492-1-dhinakaran.pandiyan@intel.com>

There is just only one caller now, which already checks for
intel_dp->is_mst. So, remove this and fix some braces while at it.

Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 85 ++++++++++++++++++++---------------------
 1 file changed, 42 insertions(+), 43 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index b3d95cb7546b..3f2ca10ccbcd 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -4192,57 +4192,56 @@ static int
 intel_dp_check_mst_status(struct intel_dp *intel_dp)
 {
 	bool bret;
+	u8 esi[DP_DPRX_ESI_LEN] = { 0 };
+	int ret = 0;
+	int retry;
+	bool handled;
 
-	if (intel_dp->is_mst) {
-		u8 esi[DP_DPRX_ESI_LEN] = { 0 };
-		int ret = 0;
-		int retry;
-		bool handled;
-		bret = intel_dp_get_sink_irq_esi(intel_dp, esi);
+	bret = intel_dp_get_sink_irq_esi(intel_dp, esi);
 go_again:
-		if (bret == true) {
-
-			/* check link status - esi[10] = 0x200c */
-			if (intel_dp->active_mst_links &&
-			    !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
-				DRM_DEBUG_KMS("channel EQ not ok, retraining\n");
-				intel_dp_start_link_train(intel_dp);
-				intel_dp_stop_link_train(intel_dp);
-			}
+	if (bret == true) {
+
+		/* check link status - esi[10] = 0x200c */
+		if (intel_dp->active_mst_links &&
+		    !drm_dp_channel_eq_ok(&esi[10], intel_dp->lane_count)) {
+			DRM_DEBUG_KMS("channel EQ not ok, retraining\n");
+			intel_dp_start_link_train(intel_dp);
+			intel_dp_stop_link_train(intel_dp);
+		}
 
-			DRM_DEBUG_KMS("got esi %3ph\n", esi);
-			ret = drm_dp_mst_hpd_irq(&intel_dp->mst_mgr, esi, &handled);
-
-			if (handled) {
-				for (retry = 0; retry < 3; retry++) {
-					int wret;
-					wret = drm_dp_dpcd_write(&intel_dp->aux,
-								 DP_SINK_COUNT_ESI+1,
-								 &esi[1], 3);
-					if (wret == 3) {
-						break;
-					}
-				}
+		DRM_DEBUG_KMS("got esi %3ph\n", esi);
+		ret = drm_dp_mst_hpd_irq(&intel_dp->mst_mgr, esi, &handled);
 
-				bret = intel_dp_get_sink_irq_esi(intel_dp, esi);
-				if (bret == true) {
-					DRM_DEBUG_KMS("got esi2 %3ph\n", esi);
-					goto go_again;
-				}
-			} else
-				ret = 0;
+		if (handled) {
+			for (retry = 0; retry < 3; retry++) {
+				int wret;
 
-			return ret;
+				wret = drm_dp_dpcd_write(&intel_dp->aux,
+							 DP_SINK_COUNT_ESI+1,
+							 &esi[1], 3);
+				if (wret == 3)
+					break;
+			}
+
+			bret = intel_dp_get_sink_irq_esi(intel_dp, esi);
+			if (bret == true) {
+				DRM_DEBUG_KMS("got esi2 %3ph\n", esi);
+				goto go_again;
+			}
 		} else {
-			struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
-			DRM_DEBUG_KMS("failed to get ESI - device may have failed\n");
-			intel_dp->is_mst = false;
-			drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, intel_dp->is_mst);
-			/* send a hotplug event */
-			drm_kms_helper_hotplug_event(intel_dig_port->base.base.dev);
+			ret = 0;
 		}
+	} else {
+		struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
+
+		DRM_DEBUG_KMS("failed to get ESI - device may have failed\n");
+		intel_dp->is_mst = false;
+		drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr,
+						intel_dp->is_mst);
+		drm_kms_helper_hotplug_event(intel_dig_port->base.base.dev);
+		ret = -EINVAL;
 	}
-	return -EINVAL;
+	return ret;
 }
 
 static void
-- 
2.11.0

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

  parent reply	other threads:[~2017-09-12 23:58 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-12 23:57 [PATCH 1/9] drm/i915/mst: Debug log connector name in destroy_connector() Dhinakaran Pandiyan
2017-09-12 23:57 ` [PATCH 2/9] drm/i915/mst: Print active mst links after update Dhinakaran Pandiyan
2017-09-14 20:58   ` Ausmus, James
2017-09-12 23:57 ` [PATCH 3/9] drm/i915/dp: Fix buffer size for sink_irq_esi read Dhinakaran Pandiyan
2017-09-14 21:10   ` Ausmus, James
2017-09-12 23:57 ` [PATCH 4/9] drm/i915/dp: Avoid more dpcd transactions after resume failure Dhinakaran Pandiyan
2017-09-13 13:24   ` Ville Syrjälä
2017-09-13 20:21     ` Pandiyan, Dhinakaran
2017-09-12 23:57 ` Dhinakaran Pandiyan [this message]
2017-09-13  9:32   ` [PATCH 5/9] drm/i915/dp: Remove intel_dp->is_mst check in intel_dp_check_mst_status Jani Nikula
2017-09-13 20:13     ` Pandiyan, Dhinakaran
2017-09-13 13:31   ` Ville Syrjälä
2017-09-13 20:33     ` Pandiyan, Dhinakaran
2017-09-12 23:57 ` [PATCH 6/9] drm/i915/dp: Handle check_mst_status() failure in one place Dhinakaran Pandiyan
2017-09-14 21:32   ` Ausmus, James
2017-09-14 21:52     ` Pandiyan, Dhinakaran
2017-09-12 23:57 ` [PATCH 7/9] drm/i915/dp: Avoid double-printing esi regs Dhinakaran Pandiyan
2017-09-14 20:42   ` Ausmus, James
2017-09-12 23:57 ` [PATCH 8/9] drm/i915/dp: Protect link training with connection mutex Dhinakaran Pandiyan
2017-09-14 22:26   ` Ausmus, James
2017-09-15 18:16     ` Pandiyan, Dhinakaran
2017-09-15 18:38     ` Manasi Navare
2017-09-15 18:57       ` Ausmus, James
2017-09-15 10:10   ` Ville Syrjälä
2017-09-18 21:50     ` Pandiyan, Dhinakaran
2017-09-19 12:42       ` Ville Syrjälä
2017-09-19 19:21         ` Pandiyan, Dhinakaran
2017-09-12 23:57 ` [PATCH 9/9] drm/i915/dp: Remove redundant can_mst checks in intel_dp_configure_mst() Dhinakaran Pandiyan
2017-09-14 22:36   ` Ausmus, James
2017-09-15 18:29     ` Pandiyan, Dhinakaran
2017-09-13  0:19 ` ✗ Fi.CI.BAT: failure for series starting with [1/9] drm/i915/mst: Debug log connector name in destroy_connector() Patchwork
2017-09-14  0:20 ` [PATCH 1/9] " Ausmus, James
2017-09-14 19:22   ` Pandiyan, Dhinakaran

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=20170912235730.3492-5-dhinakaran.pandiyan@intel.com \
    --to=dhinakaran.pandiyan@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 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.