From patchwork Wed Jul 9 17:31:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 4519171 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 DEE04BEEAA for ; Wed, 9 Jul 2014 17:32:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E345202FF for ; Wed, 9 Jul 2014 17:32:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 098BD202B4 for ; Wed, 9 Jul 2014 17:32:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B1596E6F0; Wed, 9 Jul 2014 10:32:07 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by gabe.freedesktop.org (Postfix) with ESMTP id 15C1C6E6F0 for ; Wed, 9 Jul 2014 10:32:06 -0700 (PDT) Received: by mail-vc0-f176.google.com with SMTP id ik5so7559010vcb.21 for ; Wed, 09 Jul 2014 10:32:05 -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=sDoaUdB9vThKNpKcGaKd9W3LS5awB/g0WtAwVM1b16s=; b=p67UW/u5vognGHiI7/E8LKF6VAxwBVqWyli2Z3r1yeHkWUH5hVneKHWXUgo42EJqF4 b0Z50XBIUOZQ1SPaK+dJS4dxKdqO1gOy/NPMDMqcjo/E5pJnojhK5oIJ/HB4an9kmRON FxWhlHburlXAig/iAoLYcJUzKTjUi60LGHWNzu2VKsVMk/wX28KWWHjabkxl7iuk0CUn mzpoDCko3v+OnWWbsheRU+cSdZPu6HBuRlB2P2aHmSZwAIz1dMnPTYe1+s+vX3hkMPpD gss/tV/u7pLOl1H6cakF9n2tbRGb8TVKRvJpKmnTHLpcSXUlAF2g0IFJSV2kXQ20+a6o C+FQ== X-Received: by 10.58.136.163 with SMTP id qb3mr1588202veb.62.1404927125388; Wed, 09 Jul 2014 10:32:05 -0700 (PDT) Received: from localhost.localdomain ([187.58.234.132]) by mx.google.com with ESMTPSA id o69sm78488490yho.19.2014.07.09.10.32.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 09 Jul 2014 10:32:04 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Wed, 9 Jul 2014 14:31:57 -0300 Message-Id: <1404927117-3353-1-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.0.0 Cc: Ben Widawsky , Paulo Zanoni Subject: [Intel-gfx] [PATCH] drm/i915: get/put runtime PM at i915_semaphore_status 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.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=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 Otherwise we will print some WARNs when we read registers and the machine is suspended. Testcase: igt/pm_rpm/debugfs-read Cc: Ben Widawsky Signed-off-by: Paulo Zanoni Reviewed-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_debugfs.c | 2 ++ 1 file changed, 2 insertions(+) I still dream with the day we will have a system that will run IGT on our patches/series _before_ they are applied to the tree, and tell us in case some testcase fails or gives us a WARN. diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 0c665df..1ff56ec 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -2316,6 +2316,7 @@ static int i915_semaphore_status(struct seq_file *m, void *unused) ret = mutex_lock_interruptible(&dev->struct_mutex); if (ret) return ret; + intel_runtime_pm_get(dev_priv); if (IS_BROADWELL(dev)) { struct page *page; @@ -2365,6 +2366,7 @@ static int i915_semaphore_status(struct seq_file *m, void *unused) } seq_putc(m, '\n'); + intel_runtime_pm_put(dev_priv); mutex_unlock(&dev->struct_mutex); return 0; }