From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paulo Zanoni Subject: [PATCH 02/15] drm/i915: change how VLV_IIR is reset Date: Tue, 23 Jul 2013 19:33:42 -0300 Message-ID: <1374618835-28120-3-git-send-email-przanoni@gmail.com> References: <1374618835-28120-1-git-send-email-przanoni@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-gh0-f179.google.com (mail-gh0-f179.google.com [209.85.160.179]) by gabe.freedesktop.org (Postfix) with ESMTP id E6B45E66F8 for ; Tue, 23 Jul 2013 15:34:51 -0700 (PDT) Received: by mail-gh0-f179.google.com with SMTP id f16so2687207ghb.24 for ; Tue, 23 Jul 2013 15:34:51 -0700 (PDT) In-Reply-To: <1374618835-28120-1-git-send-email-przanoni@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org Cc: Paulo Zanoni List-Id: intel-gfx@lists.freedesktop.org From: Paulo Zanoni In the current code VLV_IIR is reset before VLV_IER and VLV_IMR. This looks wrong because after we reset VLV_IIR and before we clear IMR/IER we can still get more interrupts, so when we finally disable IMR and IER, there's no guaranteee that IIR will be clean. So in this patch we use intel_irq_reg_reset which is the function that is used by everybody else and should be correct. Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/i915_irq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 351e30a..292337b 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -2060,8 +2060,7 @@ static void valleyview_irq_preinstall(struct drm_device *dev) I915_WRITE(PORT_HOTPLUG_STAT, I915_READ(PORT_HOTPLUG_STAT)); for_each_pipe(pipe) I915_WRITE(PIPESTAT(pipe), 0xffff); - I915_WRITE(VLV_IIR, 0xffffffff); - INTEL_IRQ_REG_RESET(VLV_I, false); + INTEL_IRQ_REG_RESET(VLV_I, true); } static void ibx_hpd_irq_setup(struct drm_device *dev) @@ -2283,8 +2282,7 @@ static void valleyview_irq_uninstall(struct drm_device *dev) I915_WRITE(PORT_HOTPLUG_STAT, I915_READ(PORT_HOTPLUG_STAT)); for_each_pipe(pipe) I915_WRITE(PIPESTAT(pipe), 0xffff); - I915_WRITE(VLV_IIR, 0xffffffff); - INTEL_IRQ_REG_RESET(VLV_I, false); + INTEL_IRQ_REG_RESET(VLV_I, true); } static void ironlake_irq_uninstall(struct drm_device *dev) -- 1.8.1.2