From patchwork Thu Jul 17 20:43:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 4578761 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 20EDAC0514 for ; Thu, 17 Jul 2014 20:44:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40D2B20160 for ; Thu, 17 Jul 2014 20:44:11 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 57F802010B for ; Thu, 17 Jul 2014 20:44:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 99F296E6AD; Thu, 17 Jul 2014 13:44:09 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by gabe.freedesktop.org (Postfix) with ESMTP id 3C21B6E6AD for ; Thu, 17 Jul 2014 13:44:08 -0700 (PDT) Received: by mail-vc0-f181.google.com with SMTP id lf12so5703463vcb.40 for ; Thu, 17 Jul 2014 13:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=fr4pRQTi9gW2ZVmV/DcI4HT3zAPFagTLlxzbuq030rM=; b=tQE/SJ0hYzHou0+Bv4LNbNtMSGLb7F10iPNLuoAqq2kebqBPK4ieSFvvR6PvJTCYcV jA/ZQiTMh/A3PjTuYoItDvGkDT+lyzbVQClOsFkswJk3GYtMk/bktDMadvIVjXJprMwH 3VrXUUYW0AmYZvJxKgHzEWeOjYgH4FGBPZwBWAxOu1jA2THVvfHwgIBBedlws6Gi+dM9 fpeD+2mP9Hw1RKM/8npsR6Uk9jZcB/nzZeQtSLPIPUzcXGsTP8ZYhfvsM+FdgF2a78RB TPfVesWRcjDdLVgW3aI3GAaR6tCJvJJQ1Kf3gY0i5QVi774k7/pkYDgVzO9T/HnMql2b OMMA== X-Received: by 10.52.157.164 with SMTP id wn4mr14189349vdb.81.1405629847559; Thu, 17 Jul 2014 13:44:07 -0700 (PDT) Received: from localhost.localdomain ([177.132.8.34]) by mx.google.com with ESMTPSA id td9sm2721880veb.8.2014.07.17.13.44.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Jul 2014 13:44:07 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 17 Jul 2014 17:43:46 -0300 Message-Id: <1405629826-3455-1-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.0.0 MIME-Version: 1.0 Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH] drm/i915: freeze display before the interrupts and GT X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 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=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 From: Paulo Zanoni Since we started using intel_runtime_pm_disable_interrupts() at normal (non-runtime) suspend/resume, we had to remove a WARN from ironlake_disable_display_irq to avoid a case where we were doing the correct thing and the WARN was not really needed. The problem is that the WARN was useful in other cases, and its removal can hide some bugs that we would catch automatically. To be able to add back the WARN, we have to call intel_crtc_control() before interrupts are disabled, which is what this patch currently does. Also notice that Ville's patch from the Watermarks series "drm/i915: Leave interrupts enabled while disabling crtcs during suspend" also did a change that's equivalent to the one we're doing on this patch, with the exception that its original patch, when applied to the current tree, procduces a WARN. Related commits: commit daa390e5ee45cc051d6bf37b296901f2f92b002d Author: Jesse Barnes drm/i915: don't warn if IRQs are disabled when shutting down display IRQs commit e11aa362308f5de467ce355a2a2471321b15a35c Author: Jesse Barnes drm/i915: use runtime irq suspend/resume in freeze/thaw Cc: Ville Syrjälä Cc: Jesse Barnes Signed-off-by: Paulo Zanoni Reviewed-by: Jesse Barnes --- drivers/gpu/drm/i915/i915_drv.c | 11 +++++------ drivers/gpu/drm/i915/i915_irq.c | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) No need to revert anything :) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 3315358..63675bf 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -520,12 +520,6 @@ static int i915_drm_freeze(struct drm_device *dev) return error; } - flush_delayed_work(&dev_priv->rps.delayed_resume_work); - - intel_runtime_pm_disable_interrupts(dev); - - intel_suspend_gt_powersave(dev); - /* * Disable CRTCs directly since we want to preserve sw state * for _thaw. Also, power gate the CRTC power wells. @@ -535,6 +529,11 @@ static int i915_drm_freeze(struct drm_device *dev) intel_crtc_control(crtc, false); drm_modeset_unlock_all(dev); + flush_delayed_work(&dev_priv->rps.delayed_resume_work); + intel_runtime_pm_disable_interrupts(dev); + + intel_suspend_gt_powersave(dev); + intel_modeset_suspend_hw(dev); } diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 20c777c..af231ba 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c @@ -151,7 +151,7 @@ ironlake_disable_display_irq(struct drm_i915_private *dev_priv, u32 mask) { assert_spin_locked(&dev_priv->irq_lock); - if (!intel_irqs_enabled(dev_priv)) + if (WARN_ON(!intel_irqs_enabled(dev_priv))) return; if ((dev_priv->irq_mask & mask) != mask) {