Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp417444imj; Sat, 16 Feb 2019 03:21:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IZNCIyOmwYrEFERvOibs0BXmbqyw3mVkqJ7kKyhcqryfEBUc0IDYQ5sT7z7+De1bWU0cgvA X-Received: by 2002:a65:64d6:: with SMTP id t22mr9821715pgv.52.1550316097546; Sat, 16 Feb 2019 03:21:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550316097; cv=none; d=google.com; s=arc-20160816; b=pQPOzY63x7ulClX4hbVA7/NjRcnOENdVUVEwbR60mFaA+PcN0F7em7dfQlHOMsDmuV yAaCqURLq6kA6MfVZvanNfq3xj2ScdTO2vJJF2hoCH21FaeIcI7g+UcjPhO6CNfcYPiU wkcs1TMK6b6BWneRTKLsPE9XpgRdj+DP3EUVbTLeExgm/AG8VbQWLoGh+pXnSs1O6CiZ SKLb9dPG5+vCgi2zBL2aNK1fPgZ7dtb8AT9Bh/XTz1a/xQFYoBu5rU7UYSkc6g7nRFex K1VkBoRzcYkEHnKZ26//eFNP2dT6MV3SKwmSz5YOfJxM8j/NOAHRYQ+FvizMjHNF0PSm OoUw== 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:message-id:subject:cc :to:from:date; bh=h7UFvalhW7SsYrrtZVbZW+okvdsFKw/pJZajrnWNJ/I=; b=pQ2A2dCqDO52n1glDLuXmRTTiPCwZ2WGUT7dgtir7UGRY8T67TkWtRW9fN0MZpt3i6 5EFiDZ230XKG4qJZmhbWQA9UbizNGOQ3FgHD3LrrLJ/Gn3THYEh+pwhCyI2o1xJc/4lS vovR1uTg15k8ElqB7WSokav/AW1Fw0fhIjiIFxxHXltDU0qgxnvM38rn1i40YVw5BYfj 4a4ejRdYGVegXgXCrUDIun7fx7jE65LSO7caYF2g1OL3fHEuqPMkN33Hky4Ingh2XteY 61OUTq8MMzc9qULwhBimc8cxkuuj3IXiUYDPTVPZhXJJmwZ35W61SKLCV79KTcpe7Y/b AU2g== 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 bb8si7899991plb.261.2019.02.16.03.21.21; Sat, 16 Feb 2019 03:21:37 -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 S1726996AbfBPGBC (ORCPT + 99 others); Sat, 16 Feb 2019 01:01:02 -0500 Received: from bmailout3.hostsharing.net ([176.9.242.62]:50415 "EHLO bmailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbfBPGBC (ORCPT ); Sat, 16 Feb 2019 01:01:02 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 4762C100D940E; Sat, 16 Feb 2019 07:00:59 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 0601016D4FC; Sat, 16 Feb 2019 07:00:58 +0100 (CET) Date: Sat, 16 Feb 2019 07:00:58 +0100 From: Lukas Wunner To: Alex Deucher Cc: "Rafael J. Wysocki" , Alex Deucher , David Zhou , Linux PM , LKML , amd-gfx list , ?????????????? ???????????????? , Christian =?iso-8859-1?Q?K=F6nig?= Subject: Re: [PATCH] gpu: drm: radeon: Set DPM_FLAG_NEVER_SKIP when enabling PM-runtime Message-ID: <20190216060058.gsiddsmj3f27e6v7@wunner.de> References: <2281684.8tZHfIXjiu@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 15, 2019 at 11:01:04AM -0500, Alex Deucher wrote: > On Fri, Feb 15, 2019 at 10:39 AM Rafael J. Wysocki wrote: > > On HP ProBook 4540s, if PM-runtime is enabled in the radeon driver > > and the direct-complete optimization is used for the radeon device > > during system-wide suspend, the system doesn't resume. > > > > Preventing direct-complete from being used with the radeon device by > > setting the DPM_FLAG_NEVER_SKIP driver flag for it makes the problem > > go away, which indicates that direct-complete is not safe for the > > radeon driver in general and should not be used with it (at least > > for now). > > > > This fixes a regression introduced by commit c62ec4610c40 > > ("PM / core: Fix direct_complete handling for devices with no > > callbacks") which allowed direct-complete to be applied to > > devices without PM callbacks (again) which in turn unlocked > > direct-complete for radeon on HP ProBook 4540s. > > Do other similar drivers like amdgpu and nouveau need the same fix? > I'm not too familiar with the direct_complete feature in general. direct_complete means that a discrete GPU which is in D3cold upon entering system sleep is left as is, i.e. it is not woken. It is also expected to still be in D3cold when resuming from system sleep from the PM core's point of view. (If it is in D0uninitialized, the GPU's driver needs to ensure it is transitioned to D3cold again.) I know for a fact that resuming the discrete GPU is not necessary on my MacBook Pro with Nvidia GPU. I'd expect those with AMD GPUs to behave the same. The apple-gmux driver takes care of putting the GPU into D3cold on resume from system sleep if it was in D3cold when entering system sleep (see drivers/platform/x86/apple-gmux.c, gmux_resume()). I think it is desirable to use direct_complete because it saves power (no need to gratuitously wake the GPU upon entering system sleep, only to immediately cut its power) and it also speeds up the suspend process by about half a second. The root cause on the HP ProBook 4540s needs to be debugged, I'd suspect a BIOS issue which could be adressed by a quirk, either for this particular machine or for a certain class of devices (e.g. all machines which use PR3 to transition to D3cold) if that is necessary to behave identically to Windows. Or maybe the atpx vga_switcheroo handler needs to be amended to put the GPU into D3cold on resume from system sleep if it was runtime suspended before. Is this machine using s2idle or does it suspend to S3? Thanks, Lukas > > Fixes: c62ec4610c40 ("PM / core: Fix direct_complete handling for devices with no callbacks") > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=201519 > > Reported-by: ?????????????? ???????????????? > > Tested-by: ?????????????? ???????????????? > > Signed-off-by: Rafael J. Wysocki > > --- > > drivers/gpu/drm/radeon/radeon_kms.c | 1 + > > 1 file changed, 1 insertion(+) > > > > Index: linux-pm/drivers/gpu/drm/radeon/radeon_kms.c > > =================================================================== > > --- linux-pm.orig/drivers/gpu/drm/radeon/radeon_kms.c > > +++ linux-pm/drivers/gpu/drm/radeon/radeon_kms.c > > @@ -172,6 +172,7 @@ int radeon_driver_load_kms(struct drm_de > > } > > > > if (radeon_is_px(dev)) { > > + dev_pm_set_driver_flags(dev->dev, DPM_FLAG_NEVER_SKIP); > > pm_runtime_use_autosuspend(dev->dev); > > pm_runtime_set_autosuspend_delay(dev->dev, 5000); > > pm_runtime_set_active(dev->dev);