Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751681AbdFZMcw (ORCPT ); Mon, 26 Jun 2017 08:32:52 -0400 Received: from mga03.intel.com ([134.134.136.65]:41133 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751415AbdFZMcq (ORCPT ); Mon, 26 Jun 2017 08:32:46 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,395,1493708400"; d="scan'208";a="1164715903" From: Paul Kocialkowski To: intel-gfx@lists.freedesktop.org Cc: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Martin Peres , Daniel Vetter , Jani Nikula , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Paul Kocialkowski Subject: [PATCH] drm/i915: Synchronize connectors states when switching from poll to irq Date: Mon, 26 Jun 2017 15:32:29 +0300 Message-Id: <20170626123229.27939-1-paul.kocialkowski@linux.intel.com> X-Mailer: git-send-email 2.13.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1905 Lines: 48 After detecting an IRQ storm, hotplug detection will switch from irq-based detection to poll-based detection. After a short delay or when resetting storm detection from debugfs, detection will switch back to being irq-based. However, it may occur that polling does not have enough time to detect the current connector state when that second switch takes place. Thus, this sets the appropriate hotplug event bits for the concerned connectors and schedules the hotplug work, that will ensure the connectors states are in sync when switching back to irq. Without this, no irq will be triggered and the hpd change will be lost. Signed-off-by: Paul Kocialkowski --- drivers/gpu/drm/i915/intel_hotplug.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_hotplug.c b/drivers/gpu/drm/i915/intel_hotplug.c index f1200272a699..29f55480b0bb 100644 --- a/drivers/gpu/drm/i915/intel_hotplug.c +++ b/drivers/gpu/drm/i915/intel_hotplug.c @@ -218,9 +218,13 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work) struct intel_connector *intel_connector = to_intel_connector(connector); if (intel_connector->encoder->hpd_pin == i) { - if (connector->polled != intel_connector->polled) + if (connector->polled != intel_connector->polled) { DRM_DEBUG_DRIVER("Reenabling HPD on connector %s\n", connector->name); + + dev_priv->hotplug.event_bits |= (1 << i); + } + connector->polled = intel_connector->polled; if (!connector->polled) connector->polled = DRM_CONNECTOR_POLL_HPD; @@ -232,6 +236,8 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work) dev_priv->display.hpd_irq_setup(dev_priv); spin_unlock_irq(&dev_priv->irq_lock); + schedule_work(&dev_priv->hotplug.hotplug_work); + intel_runtime_pm_put(dev_priv); } -- 2.13.1