From patchwork Thu Apr 21 08:40:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhangi Shrivastava X-Patchwork-Id: 8897111 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C442B9F1C1 for ; Thu, 21 Apr 2016 08:37:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E538A201FA for ; Thu, 21 Apr 2016 08:37:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0D35C202EB for ; Thu, 21 Apr 2016 08:37:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E9BB76EC1B; Thu, 21 Apr 2016 08:37:30 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 252416EC18 for ; Thu, 21 Apr 2016 08:37:20 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 21 Apr 2016 01:37:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,512,1455004800"; d="scan'208";a="963355847" Received: from shubhangi-desktop.iind.intel.com ([10.223.25.115]) by fmsmga002.fm.intel.com with ESMTP; 21 Apr 2016 01:37:18 -0700 From: Shubhangi Shrivastava To: intel-gfx@lists.freedesktop.org Date: Thu, 21 Apr 2016 14:10:29 +0530 Message-Id: <1461228031-2515-3-git-send-email-shubhangi.shrivastava@intel.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1461228031-2515-1-git-send-email-shubhangi.shrivastava@intel.com> References: <1461228031-2515-1-git-send-email-shubhangi.shrivastava@intel.com> Cc: Shubhangi Shrivastava Subject: [Intel-gfx] [PATCH 3/5] drm/i915: Cleanup panel IRQ handling X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP IRQ bits are set by panel in DPCD 0x201 to perform various requests. Current code clears all bits in one go and then handles them, but this is not proper since some scenarios require full detection and if we clear such bits the test request may not be detected in the later part. It is always good to clear the bits only when handled, so this patch moves the IRQ clearing bit post handling code. Signed-off-by: Sivakumar Thulasimani Signed-off-by: Shubhangi Shrivastava --- drivers/gpu/drm/i915/intel_dp.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 0402a4b..a528804 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4179,9 +4179,14 @@ static void intel_dp_handle_test_request(struct intel_dp *intel_dp, } update_status: + /* Clear interrupt first */ + drm_dp_dpcd_writeb(&intel_dp->aux, + DP_DEVICE_SERVICE_IRQ_VECTOR, + DP_AUTOMATED_TEST_REQUEST); status = drm_dp_dpcd_write(&intel_dp->aux, DP_TEST_RESPONSE, &response, 1); + if (status <= 0) DRM_DEBUG_KMS("Could not write test response to sink\n"); } @@ -4318,15 +4323,22 @@ intel_dp_short_pulse(struct intel_dp *intel_dp) /* Try to read the source of the interrupt */ if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 && intel_dp_get_sink_irq(intel_dp, &sink_irq_vector)) { - /* Clear interrupt source */ - drm_dp_dpcd_writeb(&intel_dp->aux, - DP_DEVICE_SERVICE_IRQ_VECTOR, - sink_irq_vector); - - if (sink_irq_vector & DP_AUTOMATED_TEST_REQUEST) + if (sink_irq_vector & DP_AUTOMATED_TEST_REQUEST) { intel_dp_handle_test_request(intel_dp, true); + sink_irq_vector &= ~DP_AUTOMATED_TEST_REQUEST; + } + if (sink_irq_vector & (DP_CP_IRQ | DP_SINK_SPECIFIC_IRQ)) DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n"); + + /* Clear interrupt source */ + if (sink_irq_vector) { + DRM_DEBUG_KMS("ATR requests not handled for %x\n", + sink_irq_vector); + drm_dp_dpcd_writeb(&intel_dp->aux, + DP_DEVICE_SERVICE_IRQ_VECTOR, + sink_irq_vector); + } } drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);