Commit 4b84b4a5 authored by Imre Deak's avatar Imre Deak Committed by Jani Nikula

drm/i915/lspcon: Fix resume time initialization due to unasserted HPD

During system resume time initialization the HPD level on LSPCON ports
can stay low for an extended amount of time, leading to failed AUX
transfers and LSPCON initialization. Fix this by waiting for HPD to get
asserted.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99178
Cc: Shashank Sharma <shashank.sharma@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: <stable@vger.kernel.org> # v4.9+
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarShashank Sharma <shashank.sharma@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1485509961-9010-3-git-send-email-imre.deak@intel.com
(cherry picked from commit 390b4e00)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 2a57d9cc
...@@ -4406,8 +4406,8 @@ static bool bxt_digital_port_connected(struct drm_i915_private *dev_priv, ...@@ -4406,8 +4406,8 @@ static bool bxt_digital_port_connected(struct drm_i915_private *dev_priv,
* *
* Return %true if @port is connected, %false otherwise. * Return %true if @port is connected, %false otherwise.
*/ */
static bool intel_digital_port_connected(struct drm_i915_private *dev_priv, bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
struct intel_digital_port *port) struct intel_digital_port *port)
{ {
if (HAS_PCH_IBX(dev_priv)) if (HAS_PCH_IBX(dev_priv))
return ibx_digital_port_connected(dev_priv, port); return ibx_digital_port_connected(dev_priv, port);
......
...@@ -1485,6 +1485,8 @@ bool __intel_dp_read_desc(struct intel_dp *intel_dp, ...@@ -1485,6 +1485,8 @@ bool __intel_dp_read_desc(struct intel_dp *intel_dp,
bool intel_dp_read_desc(struct intel_dp *intel_dp); bool intel_dp_read_desc(struct intel_dp *intel_dp);
int intel_dp_link_required(int pixel_clock, int bpp); int intel_dp_link_required(int pixel_clock, int bpp);
int intel_dp_max_data_rate(int max_link_clock, int max_lanes); int intel_dp_max_data_rate(int max_link_clock, int max_lanes);
bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
struct intel_digital_port *port);
/* intel_dp_aux_backlight.c */ /* intel_dp_aux_backlight.c */
int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector); int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector);
......
...@@ -158,6 +158,8 @@ static bool lspcon_probe(struct intel_lspcon *lspcon) ...@@ -158,6 +158,8 @@ static bool lspcon_probe(struct intel_lspcon *lspcon)
static void lspcon_resume_in_pcon_wa(struct intel_lspcon *lspcon) static void lspcon_resume_in_pcon_wa(struct intel_lspcon *lspcon)
{ {
struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon); struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon);
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
unsigned long start = jiffies; unsigned long start = jiffies;
if (!lspcon->desc_valid) if (!lspcon->desc_valid)
...@@ -173,7 +175,8 @@ static void lspcon_resume_in_pcon_wa(struct intel_lspcon *lspcon) ...@@ -173,7 +175,8 @@ static void lspcon_resume_in_pcon_wa(struct intel_lspcon *lspcon)
if (!__intel_dp_read_desc(intel_dp, &desc)) if (!__intel_dp_read_desc(intel_dp, &desc))
return; return;
if (!memcmp(&intel_dp->desc, &desc, sizeof(desc))) { if (intel_digital_port_connected(dev_priv, dig_port) &&
!memcmp(&intel_dp->desc, &desc, sizeof(desc))) {
DRM_DEBUG_KMS("LSPCON recovering in PCON mode after %u ms\n", DRM_DEBUG_KMS("LSPCON recovering in PCON mode after %u ms\n",
jiffies_to_msecs(jiffies - start)); jiffies_to_msecs(jiffies - start));
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment