From patchwork Fri Oct 17 19:01:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 5098721 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 73E3C9F30B for ; Fri, 17 Oct 2014 19:01:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8A47520114 for ; Fri, 17 Oct 2014 19:01:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7E2E8200D0 for ; Fri, 17 Oct 2014 19:01:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9E19389704; Fri, 17 Oct 2014 12:01:54 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qa0-f43.google.com (mail-qa0-f43.google.com [209.85.216.43]) by gabe.freedesktop.org (Postfix) with ESMTP id CDC0789704 for ; Fri, 17 Oct 2014 12:01:53 -0700 (PDT) Received: by mail-qa0-f43.google.com with SMTP id s7so929767qap.16 for ; Fri, 17 Oct 2014 12:01:53 -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=8o6FCn3HSX6qXs/UnC4rdbKRpBU2l9CiwOg3sUFg1aw=; b=ZX2nbv0fH8uZXB4vM9A6Sw/jGnvsEM3L9MShp8AXSCOj7AipOL69TtvARYsTNwFGNj iXNVBwQ/oSluwxeDYtfOYc3wivYwFMUmpCYnhR8cx8knlkp9/ncs94rNoCPrVKa1z26n ZvsLwS5YXaucfdnGUGNgIlJsVe1CJ8t5Y3KL2DGZxCxULbsGL0avFx/rcGUQA5SaAPjE gnNJ7/DmrxeKWQgnKcAh7s1MrpPWeebhhRY3FE+Y6xVsH2Py5QPsVcZaxULva9kFJgl1 fhdunjgktZdrFI8rW+mIMCoD6arZv6tCyf7w9oL//uWVZSVzgczD0Nbwyw8RrcuXJVNg 1Yzg== X-Received: by 10.224.79.79 with SMTP id o15mr14699242qak.93.1413572512921; Fri, 17 Oct 2014 12:01:52 -0700 (PDT) Received: from localhost.localdomain (201.47.13.6.dynamic.adsl.gvt.net.br. [201.47.13.6]) by mx.google.com with ESMTPSA id g94sm1558931qgd.0.2014.10.17.12.01.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 17 Oct 2014 12:01:52 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Fri, 17 Oct 2014 16:01:30 -0300 Message-Id: <1413572490-2129-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 on non-VLV 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, 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 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". v2: VLV is an exception to the early_sanitize() rule: it needs to do stuff before calling early_sanitize(), so instead of calling it earlier for every platform, we call it earlier for non-VLV by adding the early_sanitize() call inside intel_resume_prepare(). This doesn't look like the most-beautiful-solution-ever, but, well, at least it fixes the bug. (Imre) Cc: Chris Wilson Cc: Imre Deak Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83094 Signed-off-by: Paulo Zanoni Reviewed-by: Imre Deak --- drivers/gpu/drm/i915/i915_drv.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index a05a1d0..f6d28f2 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -669,7 +669,6 @@ static int i915_drm_thaw_early(struct drm_device *dev) 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); @@ -1049,6 +1048,8 @@ static int snb_resume_prepare(struct drm_i915_private *dev_priv, if (rpm_resume) intel_init_pch_refclk(dev); + else + intel_uncore_early_sanitize(dev, true); return 0; } @@ -1056,6 +1057,9 @@ static int snb_resume_prepare(struct drm_i915_private *dev_priv, static int hsw_resume_prepare(struct drm_i915_private *dev_priv, bool rpm_resume) { + if (!rpm_resume) + intel_uncore_early_sanitize(dev_priv->dev, true); + hsw_disable_pc8(dev_priv); return 0; @@ -1421,6 +1425,9 @@ static int vlv_resume_prepare(struct drm_i915_private *dev_priv, i915_gem_restore_fences(dev); } + if (!rpm_resume) + intel_uncore_early_sanitize(dev, true); + return ret; }