diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 75bccd6..bfcff19 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -41,6 +42,8 @@ #define DP_LINK_CHECK_TIMEOUT (10 * 1000) +#define DP_HPD_IRQ_TIMEOUT (100) + /* Compliance test status bits */ #define INTEL_DP_RESOLUTION_SHIFT_MASK 0 #define INTEL_DP_RESOLUTION_PREFERRED (1 << INTEL_DP_RESOLUTION_SHIFT_MASK) @@ -4930,6 +4933,17 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd) port_name(intel_dig_port->port), long_hpd ? "long" : "short"); + if (!time_in_range(jiffies, + intel_dp->last_jiffies, + intel_dp->last_jiffies + + msecs_to_jiffies(DP_HPD_IRQ_TIMEOUT))) { + intel_dp->last_jiffies = jiffies; + DRM_DEBUG_KMS("last hpd > %d ms ago\n", DP_HPD_IRQ_TIMEOUT); + } else { + DRM_DEBUG_KMS("hpd storm (< %d ms), discarding this IRQ\n", DP_HPD_IRQ_TIMEOUT); + return IRQ_HANDLED; + } + power_domain = intel_display_port_power_domain(intel_encoder); intel_display_power_get(dev_priv, power_domain); diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 47bc729..1e09e05 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -743,6 +743,8 @@ struct intel_dp { unsigned long compliance_test_type; unsigned long compliance_test_data; bool compliance_test_active; + + unsigned long last_jiffies; }; struct intel_digital_port {