Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1927866imm; Thu, 12 Jul 2018 10:03:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcMrh3gwhRKd0TrtvLfKVqmC9GHt2Z90rhbpK89LdDD8TL8zUnwvCPIZxeHAHRzZlzB62OC X-Received: by 2002:a65:5205:: with SMTP id o5-v6mr2830939pgp.108.1531415039609; Thu, 12 Jul 2018 10:03:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531415039; cv=none; d=google.com; s=arc-20160816; b=ApCfqUPEBnTFGcAwntKcKLVhqXcbzON9XmALhsetm7nDJ60w0IyQHA7BJTsGBSHQ+s riAPWFdGiLI8ftdI+KA0xvGe4317tAXt2JtSF+BxhwWVMTetGjZl5EpxhFf8yG+rRfQE 3j+YVZEHrsBE5ByvbjcOCDqznFw1x3iSnGuPlXD7aVEI6Wu839eEPDdIvtejs+xkLodK R8DYl1mh3b6SQVvZ7I+2wKgZfRZ6KuWB3bwWdL38PqRy0NdgZyw7hTG/viEvC3ZW3Edz yy4Q2BU/oHFVVc44RwWfX7K6K4UySJkuJqGJ4KC472bRIhXg/PhqTbvAcTVqINi+wpXb BaRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=kLFp3qiBDjeSWWHDHhhoLyoL/dQbnuJqY1F/f2N139Y=; b=mh58u45W0GCwQjeXgNf8wAwqx4WYiVx8o8s6bOADicz+g4EL9TXv4/TNLszjL7YUNk U9jsqREMKe12E3RVP2Hur0KNwbaDnCtTIDBFxxgp3IS1g+UmNZGRMNwm8FE13xOPf2L/ dmZFjZ1r03vfh+INphi94DcF8qqS6DVqa2iOE8OfPd9GITweKUxK/H5vgf0FpmORZadu sTkvrqtSnaIkGhiBQHjcxDnfH0dmaCW8K2VpfJRXUHHSFGXITWTXG6pMjJSzuLFdWPwE 84H3MGq1um4509Ww+43UgV1ERmf0b/PO2iXCm/BINw48man1Y9IX9DU0XCBO3NKsDHo/ Xkag== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f21-v6si20825693pgl.235.2018.07.12.10.03.44; Thu, 12 Jul 2018 10:03:59 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732451AbeGLRNa (ORCPT + 99 others); Thu, 12 Jul 2018 13:13:30 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:53158 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727455AbeGLRNa (ORCPT ); Thu, 12 Jul 2018 13:13:30 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BFE0640200AE; Thu, 12 Jul 2018 17:03:05 +0000 (UTC) Received: from whitewolf.lyude.net.com (ovpn-120-214.rdu2.redhat.com [10.10.120.214]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5971B10FFE4D; Thu, 12 Jul 2018 17:03:05 +0000 (UTC) From: Lyude Paul To: nouveau@lists.freedesktop.org Cc: Karol Herbst , stable@vger.kernel.org, Ben Skeggs , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] drm/nouveau: Remove bogus crtc check in pmops_runtime_idle Date: Thu, 12 Jul 2018 13:02:54 -0400 Message-Id: <20180712170256.13018-4-lyude@redhat.com> In-Reply-To: <20180712170256.13018-1-lyude@redhat.com> References: <20180712170256.13018-1-lyude@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 12 Jul 2018 17:03:05 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Thu, 12 Jul 2018 17:03:05 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'lyude@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Cc: stable@vger.kernel.org --- drivers/gpu/drm/nouveau/nouveau_drm.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 0f668e275ee1..c7ec86d6c3c9 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -881,22 +881,11 @@ nouveau_pmops_runtime_resume(struct device *dev) static int nouveau_pmops_runtime_idle(struct device *dev) { - 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_pmops_runtime()) { pm_runtime_forbid(dev); return -EBUSY; } - 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 */ -- 2.17.1