From patchwork Mon Apr 25 08:24:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shubhangi Shrivastava X-Patchwork-Id: 8924151 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1464ABF29F for ; Mon, 25 Apr 2016 08:22:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3330F20173 for ; Mon, 25 Apr 2016 08:22:01 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5891B20165 for ; Mon, 25 Apr 2016 08:22:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2CDFD6E51B; Mon, 25 Apr 2016 08:21:54 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id B226C6E45D for ; Mon, 25 Apr 2016 08:21:18 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 25 Apr 2016 01:21:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,532,1455004800"; d="scan'208";a="952257096" Received: from shubhangi-desktop.iind.intel.com ([10.223.25.115]) by fmsmga001.fm.intel.com with ESMTP; 25 Apr 2016 01:21:17 -0700 From: Shubhangi Shrivastava To: intel-gfx@lists.freedesktop.org Date: Mon, 25 Apr 2016 13:54:28 +0530 Message-Id: <1461572670-32421-3-git-send-email-shubhangi.shrivastava@intel.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1461572670-32421-1-git-send-email-shubhangi.shrivastava@intel.com> References: <1461572670-32421-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 387800b..de9ea18 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4144,9 +4144,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"); } @@ -4283,15 +4288,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);