drm/i915/lspcon: Fail LSPCON probe if the start of DPCD can't be read
authorImre Deak <imre.deak@intel.com>
Mon, 24 Oct 2016 16:33:28 +0000 (19:33 +0300)
committerImre Deak <imre.deak@intel.com>
Wed, 26 Oct 2016 09:41:00 +0000 (12:41 +0300)
All types of DP devices (eDP, DP sink, DP branch) will fail their probe
if the start of DPCD can't be read. The LSPCON PCON functionality also
depends on accessing this area, so fail the probe if the read fails.

Cc: Shashank Sharma <shashank.sharma@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1477326811-30431-6-git-send-email-imre.deak@intel.com
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h
drivers/gpu/drm/i915/intel_lspcon.c

index bff27b7c5b62070a969843eb5fae63a80b066e6b..07a502fd6773ee2b3e04637915a5930d316dc721 100644 (file)
@@ -3497,7 +3497,7 @@ intel_dp_link_down(struct intel_dp *intel_dp)
        intel_dp->DP = DP;
 }
 
-static bool
+bool
 intel_dp_read_dpcd(struct intel_dp *intel_dp)
 {
        if (drm_dp_dpcd_read(&intel_dp->aux, 0x000, intel_dp->dpcd,
index 65ebe92e0e96f1ecc0f2b75066557b58ff7a20e6..b9583268aafb963ef5035b02b3f1193c3f41774e 100644 (file)
@@ -1467,6 +1467,8 @@ static inline unsigned int intel_dp_unused_lane_mask(int lane_count)
        return ~((1 << lane_count) - 1) & 0xf;
 }
 
+bool intel_dp_read_dpcd(struct intel_dp *intel_dp);
+
 /* intel_dp_aux_backlight.c */
 int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector);
 
index 632149c6b3ad4fea0767350a133f05f84bd40974..23b817acd99d25c4439f1d656527a256e2b87999 100644 (file)
@@ -131,6 +131,11 @@ bool lspcon_init(struct intel_digital_port *intel_dig_port)
                }
        }
 
+       if (!intel_dp_read_dpcd(dp)) {
+               DRM_ERROR("LSPCON DPCD read failed\n");
+               return false;
+       }
+
        DRM_DEBUG_KMS("Success: LSPCON init\n");
        return true;
 }