Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3306339imu; Sun, 11 Nov 2018 12:02:41 -0800 (PST) X-Google-Smtp-Source: AJdET5cDuWGbTxBZ5ofKXtF5r+hhlX4ePSK/Lv1poleWOFr/aiF3S+ny94fz3uy2stkWTapmwY2Z X-Received: by 2002:a63:3e05:: with SMTP id l5mr14039345pga.96.1541966561514; Sun, 11 Nov 2018 12:02:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541966561; cv=none; d=google.com; s=arc-20160816; b=OuC0RWH09CJmFMT9XVQRd6EWzAgOI9330Np8pWKew/9zzTqG8qJoAz3pL60KNqQwJu PPvf7vGoVjYi9FgzL9yXMgNbnyWnPNVSe0idXORBWuyhM6pIjzKH0XK+CbUvJISGkvNU 7lS6Lj6uiqMXtnquV4T13y94USFl2Wj9L3tN8u/zR4TN6RNlM0hjsbX7O71TpvKj7N1M xVdWbpcVc122bHQroO8oa4i9osksV7f42lH8XiVcNcmkAeXWH8IAuqkWkCmXSGWNPH5W DSoR8qPIJRFELLoF2vrNxrk/98wklh4h+2a1dVML4NC7ShYQ1BEkUAIZtRQn0rujt3mW qXsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition; bh=aL41AH6YQrRy1ckmB8aMTZWCYiFfxKkxNf6hP6+VoPU=; b=IE3LYuQP+kqwY/Z/LzCdE5ApSGPiRmKakjDSzdMXVilw+1VJAnRvCEJ/zr9UECATei BJLXMyH6I7soL4fbYGagkT36UbUU+xUVGUYF+ng9QMckeqqwkRhsQTnh5t63EUcfh75o GT/xqeS+cIgnXlOUM0tD/9OplvILBtRHS84wVkZx44o0Vu7O+0PsNlPYSkwAOsw3rp5a 6WgK/GOfRBG9hIw6y3w2+He2oeub3YhjwwA8SHkzL6BT1U0lVOsVMpGIukoT9eXzqsQ1 K9mW1Xlb9DVbE9edxG1gdGk12MP05HbOEahSnoM2qF1LzsM+FSPKF9am06esubS7gi8V qbHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y35-v6si13981191pgl.14.2018.11.11.12.02.25; Sun, 11 Nov 2018 12:02:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727407AbeKLFus (ORCPT + 99 others); Mon, 12 Nov 2018 00:50:48 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:51182 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730729AbeKLFsc (ORCPT ); Mon, 12 Nov 2018 00:48:32 -0500 Received: from [192.168.4.242] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1gLvsr-0000oJ-L8; Sun, 11 Nov 2018 19:59:01 +0000 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1gLvsW-0001jh-Pb; Sun, 11 Nov 2018 19:58:40 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Ben Skeggs" , "Lyude Paul" , "Daniel Vetter" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 259/366] drm/nouveau: Remove bogus crtc check in pmops_runtime_idle In-Reply-To: X-SA-Exim-Connect-IP: 192.168.4.242 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.61-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Lyude Paul commit 68fe23a626b67b56c912c496ea43ed537ea9708f upstream. This both uses the legacy modesetting structures in a racy manner, and additionally also doesn't even check the right variable (enabled != the CRTC is actually turned on for atomic). This fixes issues on my P50 regarding the dedicated GPU not entering runtime suspend. Signed-off-by: Lyude Paul Reviewed-by: Daniel Vetter Signed-off-by: Ben Skeggs [bwh: Backported to 3.16: - Preserve local variables that are still needed - Adjust context] Signed-off-by: Ben Hutchings --- --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -927,7 +927,6 @@ static int nouveau_pmops_runtime_idle(st struct pci_dev *pdev = to_pci_dev(dev); struct drm_device *drm_dev = pci_get_drvdata(pdev); struct nouveau_drm *drm = nouveau_drm(drm_dev); - struct drm_crtc *crtc; if (nouveau_runtime_pm == 0) { pm_runtime_forbid(dev); @@ -950,12 +949,6 @@ static int nouveau_pmops_runtime_idle(st } } - list_for_each_entry(crtc, &drm->dev->mode_config.crtc_list, head) { - if (crtc->enabled) { - DRM_DEBUG_DRIVER("failing to power off - crtc active\n"); - return -EBUSY; - } - } pm_runtime_mark_last_busy(dev); pm_runtime_autosuspend(dev); /* we don't want the main rpm_idle to call suspend - we want to autosuspend */