From patchwork Thu Sep 17 21:23:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 7210951 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0E51ABEEC1 for ; Thu, 17 Sep 2015 21:23:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AE5A2063F for ; Thu, 17 Sep 2015 21:23:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C7D962062B for ; Thu, 17 Sep 2015 21:23:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EF5BC6E6BD; Thu, 17 Sep 2015 14:23:50 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from gproxy8-pub.mail.unifiedlayer.com (gproxy8-pub.mail.unifiedlayer.com [67.222.33.93]) by gabe.freedesktop.org (Postfix) with SMTP id D28EC6E6BD for ; Thu, 17 Sep 2015 14:23:49 -0700 (PDT) Received: (qmail 10906 invoked by uid 0); 17 Sep 2015 21:23:47 -0000 Received: from unknown (HELO CMOut01) (10.0.90.82) by gproxy8.mail.unifiedlayer.com with SMTP; 17 Sep 2015 21:23:47 -0000 Received: from box514.bluehost.com ([74.220.219.114]) by CMOut01 with id JMPd1r00V2UhLwi01MPgdM; Thu, 17 Sep 2015 15:23:46 -0600 X-Authority-Analysis: v=2.1 cv=EbVbHpWC c=1 sm=1 tr=0 a=9W6Fsu4pMcyimqnCr1W0/w==:117 a=9W6Fsu4pMcyimqnCr1W0/w==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=TBVoxVdAAAAA:8 a=GhZ5P8ky69gA:10 a=noBwr2J6l1kA:10 a=ff-B7xzCdYMA:10 a=WsQXpmujm7-0TD6luGQA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuousgeek.org; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=CssF5a/wuvm2e1LCRW4USZIN7dh9ii+bR8eyxZ32hPw=; b=YNd4Q3w6kpo/7jkg+6lq6XxCLeWI3YtnMX0Uwg/OJZJvS7Sauo2RaL9bunRQGt1XaHUUvgA2w0mTeMKxwPjClM3FaJRvc50GK0x0+l1u5xD0Euki67YtjccZz0+TxTSI; Received: from [67.161.37.189] (port=54244 helo=localhost.localdomain) by box514.bluehost.com with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.84) (envelope-from ) id 1ZcgeY-00056G-2m; Thu, 17 Sep 2015 15:23:38 -0600 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org Date: Thu, 17 Sep 2015 14:23:32 -0700 Message-Id: <1442525012-1845-1-git-send-email-jbarnes@virtuousgeek.org> X-Mailer: git-send-email 1.9.1 X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 67.161.37.189 authed with jbarnes@virtuousgeek.org} Cc: rjw@rjwysocki.net Subject: [Intel-gfx] [PATCH] drm/i915: use correct runtime get/put calls at init/teardown X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 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_SIGNED, 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 According to the PCI docs and Rafael, we need to be using pm_runtime_put_noidle() and pm_runtime_get_noresume() in our init and teardown routines, rather than using a direct enable/disable pair (and we didn't even have the enable side, so never autosuspended after an unload). This fixes one failure of the basic-pci-d3-state test on my BYT. I'm still debugging why the device never autosuspends. Signed-off-by: Jesse Barnes --- drivers/gpu/drm/i915/intel_runtime_pm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c index 85c35fd..1addb8a 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.c +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c @@ -1822,7 +1822,7 @@ static void intel_runtime_pm_disable(struct drm_i915_private *dev_priv) /* Make sure we're not suspended first. */ pm_runtime_get_sync(device); - pm_runtime_disable(device); + pm_runtime_get_noresume(device); } /** @@ -2114,8 +2114,6 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv) if (!HAS_RUNTIME_PM(dev)) return; - pm_runtime_set_active(device); - /* * RPM depends on RC6 to save restore the GT HW context, so make RC6 a * requirement. @@ -2130,5 +2128,6 @@ void intel_runtime_pm_enable(struct drm_i915_private *dev_priv) pm_runtime_use_autosuspend(device); pm_runtime_put_autosuspend(device); + pm_runtime_put_noidle(device); }