From patchwork Wed Jan 22 19:52:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 3525211 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 68331C02DC for ; Wed, 22 Jan 2014 19:53:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 984AC20176 for ; Wed, 22 Jan 2014 19:53:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B56CD2011D for ; Wed, 22 Jan 2014 19:53:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0E5841059DB; Wed, 22 Jan 2014 11:53:51 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yk0-f175.google.com (mail-yk0-f175.google.com [209.85.160.175]) by gabe.freedesktop.org (Postfix) with ESMTP id 5F25F1059E7 for ; Wed, 22 Jan 2014 11:53:28 -0800 (PST) Received: by mail-yk0-f175.google.com with SMTP id q200so1085205ykb.6 for ; Wed, 22 Jan 2014 11:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=f0fpmP8V9XYe9YWfGY4YtmtaKQJE1/+Ai/fZWE/dBok=; b=ygkjoba7bBJU7vM/tUCI2qLaDmEUCnLwoRtJ4wDx6bMKFjquSDBA/5zZbNwUVcvsJf /qRnHkmxOwM3VDff78WqWTX9RqvaDJCOVvY1/Wu5WdQqHJXEDQWv743W69EkCI42oWJB UXAKoZW9PHUoT2vUc5Tpa2fz5KdCXz3dz7kA9C0pf3oxndKYFEFupAyNG8QLPinh3U45 zDDVlzixVl3Pqhjd/neL1c2Cg2yvlgTj21SkjuknT8+JFu6ErtFXNEMfx5KtiXKV4VYe 6NIr3c7comtg1V3GyfmOKjfmy7DLjSDgSP4jJAhc8qra25aXGdj1YdQzZnboIbWD5kIM y1eQ== X-Received: by 10.236.144.194 with SMTP id n42mr3631168yhj.114.1390420407853; Wed, 22 Jan 2014 11:53:27 -0800 (PST) Received: from localhost.localdomain ([187.112.59.220]) by mx.google.com with ESMTPSA id f78sm27457275yhp.12.2014.01.22.11.53.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jan 2014 11:53:27 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Wed, 22 Jan 2014 17:52:27 -0200 Message-Id: <1390420357-23669-10-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1390420357-23669-1-git-send-email-przanoni@gmail.com> References: <1390420357-23669-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 09/19] drm/i915: fix SERR_INT init/reset code X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 From: Paulo Zanoni The SERR_INT register is very similar to the other IIR registers, so let's zero it at preinstall/uninstall and WARN for a non-zero value at postinstall, just like we do with the other IIR registers. For this one, there's no need to double-clear since it can't store more than one interrupt. Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/i915_irq.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index fb6ebd1..5b60de5 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -2643,6 +2643,10 @@ static void ibx_irq_preinstall(struct drm_device *dev) return; GEN5_IRQ_RESET(SDE); + + if (HAS_PCH_CPT(dev) || HAS_PCH_LPT(dev)) + I915_WRITE(SERR_INT, 0xffffffff); + /* * SDEIER is also touched by the interrupt handler to work around missed * PCH interrupts. Hence we can't update it after the interrupt handler @@ -2781,7 +2785,7 @@ static void ibx_irq_postinstall(struct drm_device *dev) } else { mask = SDE_GMBUS_CPT | SDE_AUX_MASK_CPT | SDE_ERROR_CPT; - I915_WRITE(SERR_INT, I915_READ(SERR_INT)); + GEN5_ASSERT_IIR_IS_ZERO(SERR_INT); } GEN5_ASSERT_IIR_IS_ZERO(SDEIIR); @@ -3059,7 +3063,7 @@ static void ironlake_irq_uninstall(struct drm_device *dev) GEN5_IRQ_RESET(SDE); if (HAS_PCH_CPT(dev) || HAS_PCH_LPT(dev)) - I915_WRITE(SERR_INT, I915_READ(SERR_INT)); + I915_WRITE(SERR_INT, 0xffffffff); } static void i8xx_irq_preinstall(struct drm_device * dev)