Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1745492imj; Sun, 17 Feb 2019 13:28:49 -0800 (PST) X-Google-Smtp-Source: AHgI3IZuKMZkKyOwN4j+v8zT1h0nfODI1AmA7bUZxGBDWjYelhN7heqaB6W6uhh3t4crAEal/AJQ X-Received: by 2002:aa7:8293:: with SMTP id s19mr21798467pfm.252.1550438929602; Sun, 17 Feb 2019 13:28:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550438929; cv=none; d=google.com; s=arc-20160816; b=hykr1KKDQycG8XEBA3ToMlP/iLF5ACQsHqgBjs08szqR+VJOsEHonrCoQTQXEV5KpV 1Rg8S94jF40eRWoErTXLsWKPOasMHEa2LmZkDCQ+A2tFofzxGQ9kvxckElh9+ubY+Moy kg1MUCG4I/tv/P8Zbb91riutG63U1boUxfmzuqgL2gpWlmFiE1xuQoZcmzLDw3zGKpbm jDfSBbw9EAiHDeOnb3S8GWCYb3YGUevWkLbArMtRzb59vbwiEiFTgvLTy+05KNEkzFID +wKJXggIup1leHqwEI3/cVTqMFeH29qN5F1EtIrO6B6SsqMcoApyehPyLg5SUukBQ3vs b7AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=HMju/mxaXk1kxjGwvpC36lXH8o3QSc8+PMhigawvNSE=; b=Wv3I8lMl9g4N236nIBP2UC0898eh7LT3UTWO6Umkg/CfbWGARlQC4Ns0wr9yt4/gXm pAxp/QMA1DexZ+GtqjGcD/NCu2PZS2IDBbBqKcflVlQ/6oFcgxNOAuDPq3SHIZZtSdDP dzq3EazAHGIliy5gQCyWLvLTkylfyPTFhCHv/nH+N8M/toORHJFMBgTS2clO2XHnR6Zd yXfe+hnM7IKHa5XQHh2XztrzTwa2T3kWR28WygDSHXaHS5K+1SMOFuQs9ojVPWXdMFxp 7lx3akYkyexSNxz02V3rJHJk+W9guqTad8bA4Wb35o76PTA/GuFguHLAMKAxSLIxz57k nWOg== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z23si10863765pgu.151.2019.02.17.13.28.33; Sun, 17 Feb 2019 13:28:49 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726735AbfBQV0K (ORCPT + 99 others); Sun, 17 Feb 2019 16:26:10 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:42271 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726235AbfBQV0K (ORCPT ); Sun, 17 Feb 2019 16:26:10 -0500 Received: by mail-ot1-f68.google.com with SMTP id i5so25082857oto.9; Sun, 17 Feb 2019 13:26:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HMju/mxaXk1kxjGwvpC36lXH8o3QSc8+PMhigawvNSE=; b=N9SS0ShUSMIV3kwZXxwyx1cvP5d3HZMs2lmrkUUHN+NmDgXczEBpULgAuL80aUWZ6r jWdqSfqElm5nLolWsiNFUMLcCZiqUPqBN/cp3wguU60Gch1L33j5+Ul20b+AjqvyZv80 0Me17MHbxgl05R1FUg3l1n22CDSOcTBdCx/EDjk/gZHrin2/F+oenxdSyVXx5i3mxosY pqCGo3vOabcZv0di+dFTBCk9o9R0lH/xG2MkfFcji0AYZicO3DNe1N9crWrj/ndGRVMp D7rZVEcBt45DA5LDKTXWcZs5307U4XW4DXeBfvtneafrLvlMD57LJKFMWQUfj8158M2d jKJA== X-Gm-Message-State: AHQUAuZguZDLrbd4nDudBgqUPcphXX3GpzbSG8t6R4ihm2tYrZw55eiK z79GomVaP2/DvzyzZISrpm1Zn6ACXVq0/sQ6EoFpvQ== X-Received: by 2002:a05:6830:2005:: with SMTP id e5mr12916811otp.258.1550438768625; Sun, 17 Feb 2019 13:26:08 -0800 (PST) MIME-Version: 1.0 References: <2281684.8tZHfIXjiu@aspire.rjw.lan> <20190216060058.gsiddsmj3f27e6v7@wunner.de> In-Reply-To: From: "Rafael J. Wysocki" Date: Sun, 17 Feb 2019 22:25:57 +0100 Message-ID: Subject: Re: [PATCH] gpu: drm: radeon: Set DPM_FLAG_NEVER_SKIP when enabling PM-runtime To: Alex Deucher Cc: Lukas Wunner , "Rafael J. Wysocki" , Alex Deucher , David Zhou , Linux PM , LKML , amd-gfx list , "?????????????? ????????????????" , =?UTF-8?Q?Christian_K=C3=B6nig?= Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 17, 2019 at 12:37 AM Alex Deucher wrote: > > On Sat, Feb 16, 2019 at 1:01 AM Lukas Wunner wrote: > > > > 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. > > Thanks for the info. It sounds like we need a similar patch for > amdgpu. With dGPUs controlled by the ACPI ATPX method, I believe the > dGPU is powered by automatically on resume from S3/S4. I think there > may be a way to change that behavior in some revisions of ATPX (i.e., > to keep the state across suspend cycles), but it's not the default. > I'm not sure about the newer _PR3 stuff in Hybrid Graphics laptops. I > think it retains state. In both radeon and amdgpu we probably need to > check if the system is using ATPX or _PR3 and disable direct complete > for ATPX at least. I would disable direct-complete entirely for them then and possibly consider using DPM_FLAG_SMART_SUSPEND in the cases when that would be safe. Anyway, I posted this patch for radeon, because it addresses a specific regression and I'm not super-familiar with GPU drivers in general. Cheers, Rafael