From patchwork Tue Apr 1 17:55:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 3925111 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 522569F2B6 for ; Tue, 1 Apr 2014 17:55:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77C7520254 for ; Tue, 1 Apr 2014 17:55:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9E468201F9 for ; Tue, 1 Apr 2014 17:55:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3BDCF6E7D3; Tue, 1 Apr 2014 10:55:36 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f45.google.com (mail-yh0-f45.google.com [209.85.213.45]) by gabe.freedesktop.org (Postfix) with ESMTP id CA9F26E7D3 for ; Tue, 1 Apr 2014 10:55:35 -0700 (PDT) Received: by mail-yh0-f45.google.com with SMTP id a41so9363143yho.4 for ; Tue, 01 Apr 2014 10:55:34 -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:in-reply-to:references; bh=3tfu36lMz+2nHM8Avbx5anKYDEY/CW/NG34WMNl0Ee4=; b=SnZSZ1D5SkDGEjziLNMb6TXQinHDsAhW602L6bTRHAL4d6jR0RLS4DcRpfz8NSBh2R UIBhC7NST8QXfIcVAbooa9DLm/jhFM82NJ1027wR1+j30DoYsK0DpoLDjd/Uc+k6w/xZ bV04omiQyusGX80WTRlDDhOTzEoOx6ZujpsNsncGGoddYpzZJ/HDFITsqCTMy+FovprO MjzPWGrBqYJepnSyaBlKo2P3sPB1ht47uJAJlsgwxORCiaWVwO43F4ZXUJZFbE59s4vq v9Lys5tu06O7T/ijcCVnaUmC8a2XTC1gboXzgxwfBaiYVTKcoGl8PWdPb3rBWcOv1AME Rtjg== X-Received: by 10.236.230.41 with SMTP id i39mr47471568yhq.14.1396374934099; Tue, 01 Apr 2014 10:55:34 -0700 (PDT) Received: from localhost.localdomain ([177.42.1.121]) by mx.google.com with ESMTPSA id u5sm31543657yhg.25.2014.04.01.10.55.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Apr 2014 10:55:33 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Tue, 1 Apr 2014 14:55:07 -0300 Message-Id: <1396374913-2030-2-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1396374913-2030-1-git-send-email-przanoni@gmail.com> References: <1396374913-2030-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 1/7] drm/i915: don't schedule force_wake_timer at gen6_read 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=-3.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, 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 So far force_wake_timer was only used by gen6_gt_force_wake_put. Since we always had balanced gen6_gt_force_wake_get/put calls, we could guarantee balanced calls to intel_runtime_pm_get/put. Commit 8232644ccf099548710843e97360a3fcd6d28e04, "drm/i915: Convert the forcewake worker into a timer func" started scheduling the force_wake_timer at gen6_read, which resulted in an unbalanced runtime_pm refcount. So this commit just reverts to the old behavior until we can find a proper way to used delayed force_wake from the register read/write macros without leaving the runtime_pm refcounts unbalanced and without runtime suspending the driver while forcewake is active. Testcase: igt/pm_pc8/rte Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76544 Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_uncore.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c index c3832d9..c47853b 100644 --- a/drivers/gpu/drm/i915/intel_uncore.c +++ b/drivers/gpu/drm/i915/intel_uncore.c @@ -550,11 +550,12 @@ gen6_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \ NEEDS_FORCE_WAKE((dev_priv), (reg))) { \ dev_priv->uncore.funcs.force_wake_get(dev_priv, \ FORCEWAKE_ALL); \ - dev_priv->uncore.forcewake_count++; \ - mod_timer_pinned(&dev_priv->uncore.force_wake_timer, \ - jiffies + 1); \ + val = __raw_i915_read##x(dev_priv, reg); \ + dev_priv->uncore.funcs.force_wake_put(dev_priv, \ + FORCEWAKE_ALL); \ + } else { \ + val = __raw_i915_read##x(dev_priv, reg); \ } \ - val = __raw_i915_read##x(dev_priv, reg); \ REG_READ_FOOTER; \ }