From patchwork Thu Oct 9 17:46:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 5060151 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 EB7FEC11AC for ; Thu, 9 Oct 2014 17:47:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A0BC8201FE for ; Thu, 9 Oct 2014 17:47:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CB2D0201F2 for ; Thu, 9 Oct 2014 17:47:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 06F616E3B6; Thu, 9 Oct 2014 10:47:19 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qc0-f180.google.com (mail-qc0-f180.google.com [209.85.216.180]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D20C6E3B6 for ; Thu, 9 Oct 2014 10:47:17 -0700 (PDT) Received: by mail-qc0-f180.google.com with SMTP id x3so651794qcv.11 for ; Thu, 09 Oct 2014 10:47:16 -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; bh=db8rmPTikTnqIHOPsnxwpK40RnEb0qgM9R9NBFCPHPI=; b=ZPkeuBdgbzBvq3YENOTyoTg3mDCYHumiOnrepYIt82vMcQydr+rWH+R382ghC+rcO0 fFC2Im0Y7dNwTwMc9ON62vH1KqWIQQMGAXbj9CriLObTLq5+TGCPnL0zG2t5hqtKSYUI 0rr0X23yT1hR5UXPc94OJfG5Au9ywFjtxqtilt1TEu0KFEt67/koLe+JCzp2nEAisWBx btfUMwMS48favHKeqg9/dzjpi8SgXKtm9VqfZbVnV5qLd+KrDOWZ8bccCo5nTwpLpLfC Ovlimydh3JYG5C5UHuF+HeLdP3ynBLo+IoPMbNCwxsMrGgT5lWKoWdNQiL8rhkkDftm5 xAPQ== X-Received: by 10.224.22.143 with SMTP id n15mr26028741qab.53.1412876835991; Thu, 09 Oct 2014 10:47:15 -0700 (PDT) Received: from localhost.localdomain ([191.251.51.49]) by mx.google.com with ESMTPSA id k3sm3355979qay.1.2014.10.09.10.47.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 09 Oct 2014 10:47:15 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 9 Oct 2014 14:46:56 -0300 Message-Id: <1412876816-2313-1-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.9.1 Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH] drm/i915: run intel_uncore_early_sanitize earlier on resume 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: , MIME-Version: 1.0 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, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 As far as I understand, intel_uncore_early_sanitize() was supposed to be ran before any register access, but currently intel_resume_prepare() is ran earlier, and it does register access. I don't think it should be safe to be calling I915_{READ,WRITE} without calling intel_uncore_early_sanitize() first. One of the problems we currently have is that when we suspend/resume BDW, the FPGA_DBG_RM_NOCLAIM bit becomes 1, so we end up printing an "unclaimed register" message on resume, but this message doesn't really seem to have been triggered by our driver or user space, since the bit was not there before suspending, and gets there just after resuming, before any of our own register accesses. So calling intel_uncore_early_sanitize() as a first thing will allow us to stop printing the error message, fixing the "bug". Cc: Chris Wilson Cc: Imre Deak Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83094 Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/i915_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Maybe we need to move even more code up? diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index a05a1d0..dffb173 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -665,11 +665,11 @@ static int i915_drm_thaw_early(struct drm_device *dev) struct drm_i915_private *dev_priv = dev->dev_private; int ret; + intel_uncore_early_sanitize(dev, true); ret = intel_resume_prepare(dev_priv, false); if (ret) DRM_ERROR("Resume prepare failed: %d,Continuing resume\n", ret); - intel_uncore_early_sanitize(dev, true); intel_uncore_sanitize(dev); intel_power_domains_init_hw(dev_priv);