From patchwork Sun Aug 20 12:51:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 9914021 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BCAD2603FF for ; Tue, 22 Aug 2017 00:37:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B29B4287BD for ; Tue, 22 Aug 2017 00:37:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A7055287F2; Tue, 22 Aug 2017 00:37:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 53C1F287FD for ; Tue, 22 Aug 2017 00:37:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 147A16E32C; Tue, 22 Aug 2017 00:36:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id C23476E174; Sun, 20 Aug 2017 12:51:29 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id f8so8143307wrf.3; Sun, 20 Aug 2017 05:51:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0XouawrPPTAp3xhmEMQsKMKrbwDLg3+ByfpxlIReFVo=; b=UqPbznwBEfuHM/OfhWpSTYF927f7JcZWXQnS1RL08zhJ5mLlLJstFghNfJbBAyqrcO n2PRWgl0HWku7Wkr6LR3EzcCVTO67EXknTV9MtmUm2TXjQqXVejxLzvipNlM46WHM/QU yI3wJEKJdydnj5Z39W7/l9J8G+Z2fP8am0N37ZxMtmwSKcQPfcTApVFZS7n0CuRZZQ9L CPkDIG6Su5VygsgFJ/sUgQikTvGbKjvOGj8j85lfYaufgEfPejq1RfwwczEMBDxLR1mO ybCpaxvPovfq9FPmsnqGT8k59aZaLX4j+LFKEwWaMqYRbYQR6IlAoDk2F3jAb7qVJWN/ o1dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0XouawrPPTAp3xhmEMQsKMKrbwDLg3+ByfpxlIReFVo=; b=H/G7eZUkwxXhmZ/TBc8hAJyB9K6fzgYX2ygU6O/W5szTevo0imAunSTwkeolOQPoZi E/mhHVB9mDoosD8uponzoNr2BOsBjCXMpt2ssXENdMfyGgzOwwOkr67lnE0k6Cr4QW5D ZfiXw9b+VC3lg7VnpqDVBY+pLgRWbm7rpxN+n9nawKaPOol+sSoFCaM+/RP19V49qwfJ 5ByQ8nDxDU56MB9Tof3lFKQYsGGLn9qEdswdEA5qjuefhLYXe6PlFG2U6mpiSaR4JfI5 oAqRr0mDYT8i04KbilE7EtYMwj09bqqVZBjLwt/1pOhx/mrnANGpw79DzkbbgJdHEu3L NDug== X-Gm-Message-State: AHYfb5gA8UuCDswSuWTH3TuV8jbwL4WK2zbkaYXKpAgBxsqTeMFy+dy1 2RdJO5aeBwSwyYxkcVA= X-Received: by 10.28.194.138 with SMTP id s132mr5461903wmf.29.1503233488242; Sun, 20 Aug 2017 05:51:28 -0700 (PDT) Received: from shalem.localdomain.com (546A5441.cm-12-3b.dynamic.ziggo.nl. [84.106.84.65]) by smtp.gmail.com with ESMTPSA id k45sm6163225wre.1.2017.08.20.05.51.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Aug 2017 05:51:27 -0700 (PDT) From: Hans de Goede X-Google-Original-From: Hans de Goede To: Daniel Vetter , Jani Nikula , =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Imre Deak Subject: [PATCH v4 3/4] drm/i915: Call uncore_suspend before platform suspend handlers Date: Sun, 20 Aug 2017 14:51:18 +0200 Message-Id: <20170820125119.27210-3-hdegoede@redhat.com> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170820125119.27210-1-hdegoede@redhat.com> References: <20170820125119.27210-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 22 Aug 2017 00:36:37 +0000 Cc: Hans de Goede , intel-gfx , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Quoting Ville: "the forcewake timer might still be active until the uncore suspend, and having active forcewakes while we've already told the GT wake stuff to stop acting normally doesn't seem quite right to me." Reported-by: Ville Syrjälä Suggested-by: Imre Deak Signed-off-by: Hans de Goede Reviewed-by: Imre Deak --- Changes in v2: -Rebase on current (July 6th 2017) drm-next Changes in v3: -Add Imre's Reviewed-by --- drivers/gpu/drm/i915/i915_drv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 4715f320c8fa..5bf231abe010 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -2490,6 +2490,8 @@ static int intel_runtime_suspend(struct device *kdev) intel_runtime_pm_disable_interrupts(dev_priv); + intel_uncore_suspend(dev_priv); + ret = 0; if (IS_GEN9_LP(dev_priv)) { bxt_display_core_uninit(dev_priv); @@ -2502,6 +2504,8 @@ static int intel_runtime_suspend(struct device *kdev) if (ret) { DRM_ERROR("Runtime suspend failed, disabling it (%d)\n", ret); + intel_uncore_runtime_resume(dev_priv); + intel_runtime_pm_enable_interrupts(dev_priv); enable_rpm_wakeref_asserts(dev_priv); @@ -2509,8 +2513,6 @@ static int intel_runtime_suspend(struct device *kdev) return ret; } - intel_uncore_suspend(dev_priv); - enable_rpm_wakeref_asserts(dev_priv); WARN_ON_ONCE(atomic_read(&dev_priv->pm.wakeref_count));