From patchwork Fri Mar 7 23:05:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 3795101 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 0EFAD9F369 for ; Fri, 7 Mar 2014 23:06:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42733202E9 for ; Fri, 7 Mar 2014 23:06:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5FA27202BE for ; Fri, 7 Mar 2014 23:06:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C80DEFB5F7; Fri, 7 Mar 2014 15:06:28 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f41.google.com (mail-yh0-f41.google.com [209.85.213.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 68BA3FB4D3 for ; Fri, 7 Mar 2014 15:06:18 -0800 (PST) Received: by mail-yh0-f41.google.com with SMTP id v1so381546yhn.0 for ; Fri, 07 Mar 2014 15:06:18 -0800 (PST) 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=kFQt1p7eZG36diSGjgZOI6EyRQ94ZDzHRvxVH44+t/Y=; b=VnYLE+DQqvTvrL3RbScMg0iN3EfDXvV6z57JXwPKS23Pu8F3KI133dT0026xIMdkc0 FDpJBYhjtJBsxSrNB7b12VuhhuZ9NW0z5FSRgELG6tzzEblCOQcDUG3WRa/ivlH3O17b YSiL975aARaXVjgfUVmWBbdhEyg+WXJiOq+Y/96DqzLlAFlgY/n87AQkLFat7zT7NkAy JdSRJxiISwM9A4uIMBIWcOxniQmZq2En8IR3yR9bjK/Sg2vsRk9Sp0nkN7pu/X8K+JbS sJYnp3zKM9rnwmzXnVIStus7agvA1offOVziTJc9mJUyATpop0tY+/jlK1I2t4WsEpXo Io+w== X-Received: by 10.236.96.201 with SMTP id r49mr25776203yhf.33.1394233578048; Fri, 07 Mar 2014 15:06:18 -0800 (PST) Received: from localhost.localdomain ([177.132.70.215]) by mx.google.com with ESMTPSA id m9sm32523558yha.2.2014.03.07.15.06.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Mar 2014 15:06:17 -0800 (PST) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Fri, 7 Mar 2014 20:05:24 -0300 Message-Id: <1394233524-3522-7-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1394233524-3522-1-git-send-email-przanoni@gmail.com> References: <1394233524-3522-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 6/6] drm/i915: get runtime PM at intel_set_mode X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org 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=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, when we run intel_modeset_check_state we may already be runtime suspended, and our state checking code will read registers while the device is suspended. This can only happen if your autosuspend_delay_ms is low (not the default 10s) and i915.pc8_timeout is set to zero. NOTE: The correct way to fix this problem would be to properly get/put runtime PM at the get_config/state functions. I still didn't do this, so I'll keep this patch on the series because it fixes the remaining WARNs we get while running the pm_pc8 test suite. It's fine if we don't merge this. The problem v2: - Add the note above. Reviewed-by: Jesse Barnes Signed-off-by: Paulo Zanoni --- drivers/gpu/drm/i915/intel_display.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 0868afb..dc2b377 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9785,13 +9785,18 @@ static int intel_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode, int x, int y, struct drm_framebuffer *fb) { + struct drm_device *dev = crtc->dev; + struct drm_i915_private *dev_priv = dev->dev_private; int ret; + intel_runtime_pm_get(dev_priv); + ret = __intel_set_mode(crtc, mode, x, y, fb); if (ret == 0) intel_modeset_check_state(crtc->dev); + intel_runtime_pm_put(dev_priv); return ret; }