Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1942454imm; Thu, 12 Jul 2018 10:18:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdamtl5sgvHxVojLieytLF7uHunD0bdG+3cfznYbg8y3Ng0mK3CNgA4LPcRon6vanpdZ6xy X-Received: by 2002:a63:8c0b:: with SMTP id m11-v6mr2912632pgd.372.1531415900614; Thu, 12 Jul 2018 10:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531415900; cv=none; d=google.com; s=arc-20160816; b=AKyZDEFsYXGO8wDqHTGsMQ4shGoWRn8k7UIQlJJPkXYQp425APQLxKooNJkrKd3mp+ OZEEgj19F0z175o92G8ALkLOgdPdC1xk/z8KpqU0cjUij4ET3YLDb/Cfde3jsVLme6fb nWcCiZ9oAS6JtSEAC6YXzFtNyTK9mXJG6X/eOU/MY88k5Fn7933RrLtgc1B7bY/nSFCd t8j9NMbi+FuM5bmAXwYwftN2hR8tFNncESJYZjo7/QJERdovg2ME4LHi4vAMIMMRdKFO HZlWZfyXNSeCYGaOta7Fux93OQT3Xcy/irNTWqUcsGCYtUyQ+GIAvVA95WJVaqyg0igS /Q9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=yAAIBTBGddkiVM6XIzTCwX8wAnjI5VL61KDOrokjHCA=; b=f3auQnNB7dOsJdtuC0twqamf6/0AaLHWlT+9l1Ak7g0pVGUSIOecBzs9GrCLet/rMP aPkxL8NQNSSEkN27Xk6I3go+sZkHewc2WzZmAcaR/xHB2VE/NP3ZJfLaNm9ZgdEHEhy7 4xhmt1Ly5p2SyUxphdA1KgNl3q7c1VDk2laGDiJRXBC5OjCczR6ONB2xKm2bbIbqbVwS CY8pnBaBeXP6BFhMu0IYpj3JDU8pRzBebwVcdhuZ61yDwwr5/KP5FeomP5gjtvVAe3/r 8OvuxA9ymSJGomVtzZdp3cBVO+AC6hdQKS0sFmbxJd/TVXDrZeQyx7u2/EfbSI7vh/QO n5eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=SGaW+XX+; 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 r39-v6si22116995pld.83.2018.07.12.10.18.05; Thu, 12 Jul 2018 10:18:20 -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; dkim=fail header.i=@ffwll.ch header.s=google header.b=SGaW+XX+; 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 S1732528AbeGLR15 (ORCPT + 99 others); Thu, 12 Jul 2018 13:27:57 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:35166 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727175AbeGLR14 (ORCPT ); Thu, 12 Jul 2018 13:27:56 -0400 Received: by mail-ed1-f67.google.com with SMTP id b10-v6so22466803edi.2 for ; Thu, 12 Jul 2018 10:17:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=yAAIBTBGddkiVM6XIzTCwX8wAnjI5VL61KDOrokjHCA=; b=SGaW+XX+Ik8cSEvjoqa0OTnEc3/aJnL3TQBK9ox0CybKaY/r2QyHzQJ1Ke9tN2nwWI MVnKZcORtNKbKdETH1SYigMNhEhbaCG2ooauEXh/khdHrzLWbg4yvpT84/dw0ReEGXfD MC6x9lwZanA1GTLEHqtlM/Fp5B1KWgTGC6xHQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=yAAIBTBGddkiVM6XIzTCwX8wAnjI5VL61KDOrokjHCA=; b=c7vvDwazVjhsLZRcqKpR9qK2hl+oKg2a9h1h5WS1ap+D+HoXT7feNsDw9cr9b5oWlM AkN0B+1c7pMdXHg4m+xXX+BXqNR/K9s853xLCAJXuMy/KkVMYrCkC6iBmjF850GyN/Eo YeGNwOnlRH80Cvu/k8Drin6T1YXNPMOdml4F4c4bnqWfoJ0gBTiuuenemzo/H36udT7Z d7q5cWmgkQPUy6teve9N5GYyu1dOwumN7YDO+A4hMLWoYaYLGekAceuSKUTyWr+NXnsx 7ukSMvSVlRrSkEEdK4B0aYj3J4KCxNZtV+MnXdqbS3vbJ5ubYOE41VPdBc0s5Shgvfvj xmfg== X-Gm-Message-State: AOUpUlGtfWxrbd+a/KdcrQ7g+RiSZtLBMdULUW5ppktMJJIVao+EqX6x QVJXQjVRm4ajHphIQbYAb5xt8A== X-Received: by 2002:aa7:d5d2:: with SMTP id d18-v6mr3561755eds.130.1531415847474; Thu, 12 Jul 2018 10:17:27 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:5628:0:496f:7dc5:66d7:a057]) by smtp.gmail.com with ESMTPSA id b22-v6sm10869602edn.0.2018.07.12.10.17.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jul 2018 10:17:26 -0700 (PDT) Date: Thu, 12 Jul 2018 19:17:24 +0200 From: Daniel Vetter To: Lyude Paul Cc: nouveau@lists.freedesktop.org, Karol Herbst , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, stable@vger.kernel.org, Ben Skeggs Subject: Re: [PATCH v2 3/3] drm/nouveau: Remove bogus crtc check in pmops_runtime_idle Message-ID: <20180712171724.GR3008@phenom.ffwll.local> Mail-Followup-To: Lyude Paul , nouveau@lists.freedesktop.org, Karol Herbst , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, stable@vger.kernel.org, Ben Skeggs References: <20180712170256.13018-1-lyude@redhat.com> <20180712170256.13018-4-lyude@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180712170256.13018-4-lyude@redhat.com> X-Operating-System: Linux phenom 4.14.0-3-amd64 User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 12, 2018 at 01:02:54PM -0400, Lyude Paul wrote: > 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 On both patch 2&3: Reviewed-by: Daniel Vetter ->enable vs. ->active is probably the biggest source of pain in atomic, and beyond typing even more kerneldoc that will be ignored (there's another series doing exactly that on the list) I have no idea what to do. 90% rule is to look at ->enable in atomic_check code (since DPMS changes should always work) and ->active in atomic_commit code. Wrt the legacy state: For the legacy pointers we can set them to NULL for atomic, and Ville has done that. That's real effective at stopping drivers from looking at the wrong thing. But for the others like this one here I dunno what to do to effectively hide them from atomic drivers. Cheers, Daniel > --- > 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 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch