From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46DB9C433EF for ; Tue, 18 Jan 2022 18:20:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EEC2810E12F; Tue, 18 Jan 2022 18:20:19 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2048.outbound.protection.outlook.com [40.107.94.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B77310E12F for ; Tue, 18 Jan 2022 18:20:19 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aLgCZCIHs9JruQzLEtTfJzIgTrzkHyzqmxMaKioRotmCRH+NxAY2g9YjS7uz9wjaHreDF+dpqpPTwS7PlnROjftRZE68wEJNt7QY7O4ad8wHyVmIjB7MzJHIXX/2GsCekvJYB3lj10P97atWed+DRNM/82d/SeaY9HmCoWErJ1R2/kpxgnyT9TiAPdWX1Hr1jhso/tC6R8wfEaOjXFZl/eL7NS4wN76ZKLeFz51LYqTfd01CJ02YSVSwOxWXgNWtVBWgg8hBGa09yKsqR/Q0dg72QFY32dIDpBKoYaP93BAGpos/7PPru/tswLPYN7Fb+gcqBihOO0PnShIZB+lbhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2JMbUyjErrUk+WiNsnHQ95OosGASTWRHyPMWLxiIl8Y=; b=EGQfdH5Ebo/TbwEhZS6/fxzGQ+wrEBZLADsn/KBbzV8bNKjzOxWKX8r1p/r6YTtI8ZIn+mqvkRsMLjdbCM836vinz7Ie9bmW/+xmOJGcyI+4sfOfXK9C1qt1CHzwVNMEMho8dOAOSI6VytBDLvAWoae83vCtFo1ExJMLzNVeWRvj7XMxqkJJmzb7g9VeeyNsQUzREGu4XwRtK595aC2sxx+uIn3PiPtGIBOZziKRC8Q5xXscPMatzT4fgLt09PWze7G0WSTIYrnJdk2Ll4W0XjchHSYxFh1TUp8+DdSnbpxCiB11e+BAZYvdzN2n8h22+AB6vSrtboYOEqf6BlAewQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2JMbUyjErrUk+WiNsnHQ95OosGASTWRHyPMWLxiIl8Y=; b=VSLfDnLGafORLWK1pGgsl+TqQtTPFUy+/y7WSN8abjXliqXbK8v3QPiylj9IPhjHvkiZwkYvtJzOHvigqwlb4lGplVDy5GA/BvodbAxSXU7eNsFUzIcql7NMnf6UoEl9wgLS2uBA+grOLR6bsDrKYJXC8f2QcnlfkB8QhHjtwN4= Received: from BL1PR12MB5157.namprd12.prod.outlook.com (2603:10b6:208:308::15) by MWHPR12MB1183.namprd12.prod.outlook.com (2603:10b6:300:d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.9; Tue, 18 Jan 2022 18:20:17 +0000 Received: from BL1PR12MB5157.namprd12.prod.outlook.com ([fe80::42f:534d:e82:b59f]) by BL1PR12MB5157.namprd12.prod.outlook.com ([fe80::42f:534d:e82:b59f%6]) with mapi id 15.20.4909.007; Tue, 18 Jan 2022 18:20:17 +0000 From: "Limonciello, Mario" To: "Liang, Prike" , "Lazar, Lijo" , "amd-gfx@lists.freedesktop.org" Subject: RE: [PATCH v2] drm/amd: Warn users about potential s0ix problems Thread-Topic: [PATCH v2] drm/amd: Warn users about potential s0ix problems Thread-Index: AQHYByXifc5BzR5/BUKp3P/SNW4846xnfToQgAABRQCAAAFLkIAA/I2AgACk3wA= Date: Tue, 18 Jan 2022 18:20:16 +0000 Message-ID: References: <20220111200026.15855-1-mario.limonciello@amd.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Enabled=True; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SetDate=2022-01-17T17:15:10.0000000Z; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Name=Public-AIP 2.0; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_ContentBits=1; MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Method=Privileged msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_enabled: true msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_setdate: 2022-01-18T18:20:14Z msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_method: Privileged msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_name: Public-AIP 2.0 msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_siteid: 3dd8961f-e488-4e60-8e11-a82d994e183d msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_actionid: c5143e5c-8cc3-4186-a1e1-d0891c6c58d5 msip_label_d4243a53-6221-4f75-8154-e4b33a5707a1_contentbits: 0 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a0cb294c-405e-4d54-e0cb-08d9daaf2dc7 x-ms-traffictypediagnostic: MWHPR12MB1183:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jWi+BteC1OBQMLYI3gQPXHbWc3O2OTSzPpjXqu1m6MbSN2Y2I9WwoVFN2plOLE8xLY7lTVWhDr98L/PKSF1jRHal9drE0sSFL4TaIyHKbFrPCE6SV6Hi1Jmbe2lu9Pxo0Alna+Md+YBMpx4dw5XUhO/qdD0LUQO9mU89SXFvcjrPhqOsxBhV6ALKvCFTjNrhhvoZ31nNvd0NjNlmliIYjMi9CokR03SRNYZRUSHnKyA39RAcIkEe/vnCcOYi1c7GsuAy4G+bGuEVCkzwr+Wr9mjVhKXwol14zh3a835U7clkehjABLOPWBaUnD4JJ6sq40IpYUA1uffmZMvz+uN/aXbaQzXve7xG9ygKc43CdjkLH3P8fO+luZzstNYF/OfKysKNJfefAxKqb5lYvb6bWjzBmAKVUrrbblY1DHG0CamwgMBM/jnipGkeS/cMqJef4eONiOuu+g2rMB3pYGQDSCQMErP9v4keuzChnDrdqinBQiVTcDWwcL6AThcr/aa/cCdLuGqFDq3OKS8cYECCLAQUN7pR3wfsnFhwKURuYM6smnVBnAGtA00SoOG2H7duPgCi53FELv3zo7hIv4DLuNVZo4RVCLE4JEesvwMtaIckdwWTkpJj77Buj5CJUg+0Yb1qA0s8w4kOcFXAX8r4NFuoILqCfRAzFI8A6scgJwHMm2e2chZTeMpmQgTHmn1nCmepmL7SmisZcyZTZl5h0wuLVGML+dRF5XB9LI52VN8= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL1PR12MB5157.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(55016003)(71200400001)(2906002)(33656002)(86362001)(7696005)(8936002)(508600001)(316002)(9686003)(38070700005)(8676002)(26005)(166002)(83380400001)(66446008)(6506007)(38100700002)(122000001)(66556008)(186003)(53546011)(64756008)(66476007)(5660300002)(4326008)(76116006)(66946007)(966005)(52536014)(110136005)(32563001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?PsoJobNpv4+hrcydZJGxt0JvOp/uY0pXff/7/lC27vO8bzqi+5IQ6uEkUruC?= =?us-ascii?Q?EZR7CNfOCMkn0+WpJ0FsPrFhjK/Gswx/tTzWIMfiWTTdhaTkao2yfMixjL58?= =?us-ascii?Q?o5D4cidxHXQntPoIuy5wAkG/Y6XQAkorVtjGEKuLkbrP2qVwKP9WWgbruOiS?= =?us-ascii?Q?NalQg0nGAU+4NPlrDyXYCoLpDKtJJAi9OFFYIfL9OfKdvy8QKkNY9aeiu/0v?= =?us-ascii?Q?uVHXBMZ5KVyyKSUGQFyR7JSNswu+/E2OE9mfBTZIvwFxywK24iGBPdtOLWaj?= =?us-ascii?Q?dly4XepFlAO7/Fqgp+gAMdqh0SJWyAWYA1DAhaQrQPKzmLKgYSvDa81uFSxZ?= =?us-ascii?Q?hsk+OtkQj95I7eEZxHfXX8qGtxhXp69YRqWFhiY/NFvZIaL68eoZ91MIphEw?= =?us-ascii?Q?hw7xm5yaXG5CAONW1s4jpNHL7iUJYUCfHpTeMpwgIRXgSgr/kfxoZAHN4aaq?= =?us-ascii?Q?N4KOLXHIlPaz31Ui40sf0Xl9BsYhn4GFn6UqGXFFs71xkPMsYmcpS+FFtKbd?= =?us-ascii?Q?eP4qjh9Qh8f41b7pUfvRCcf2bx6z3tiImZXH56ACpABIwPgKpZqAf1YYNZ9O?= =?us-ascii?Q?dFcVhxu0OijN+taw21a4neG7g24oR7RuAYhFRmBrTIcAfYbRWfGj7sYQ/yLg?= =?us-ascii?Q?lGTmvwX5fFu8SiEPUKv/MOe4Rj35hTrMSrcGi41iVgE8ck2yM5Ua7G0dpHcm?= =?us-ascii?Q?umbrD3Q3Ohotk+q/eiYh6QsV6GinTuXsmau64OgBiBELzlF188r8eLyx3VcA?= =?us-ascii?Q?1GoDrwirF7RdevAAhis3X1r2NK6gttyxiAW6RnXu/E6HCnuPTSty1paXqC4H?= =?us-ascii?Q?Lrokitre1vybd97z8NMCweoQldax8YR8ASYbRiCdG+QoUQVzYjiEkXzfSWzh?= =?us-ascii?Q?G93ovZuvk+LkC32hGMwQZkG3di0wKb79gFPxMQsFQPMGOWUkV+mX1cSY3mSD?= =?us-ascii?Q?voHDbcVfPvVfHQU7ueW3jJn6rE45hV238g/RPzy7QZ89v8eUAbGVhB9x63GH?= =?us-ascii?Q?PKWfFpJ8q7lUIlL5jCyi05BBI8dH+ikQKONjYDm6woCD0Pwym65V0EmrJfVf?= =?us-ascii?Q?csrkdofjPgulgSeq3jps3uSXXtn+FS42BLUT7v0DbnohZ69fcrtX/a6Jvawm?= =?us-ascii?Q?W3j8ODppsXH2UkAjIAi9IMV4bD0f9olo4OLZ20ZgQKrmv1uExN6lp60+uUL+?= =?us-ascii?Q?apjIkcY8MoqwAK0nrm3Z4oD+YbNfzRXg+z9kgGwkernvvvxMA4RB6VARwZFc?= =?us-ascii?Q?EGz++5r2k6tA+WSWAMnCLfs9GXtorWkHTDwQchg7fHl7fgFkY6P1zs3w+BBm?= =?us-ascii?Q?DKt6XAx/aMVWrl+IG3xl+35crGN/dkN5Gx3IEW/CMd+GhclEO9qJoZ+R20H/?= =?us-ascii?Q?e6CkM7BZ/8dcvG1t0yQ492hEoOe2I/VBu1KDmB9uaXArUVKRLaL2cvCgbSnF?= =?us-ascii?Q?Brzl8/k1RlddJEJUP+tEPu6DpG+kNalJLsV1lQIQP9rqD0Sve5vWKQt5cFJn?= =?us-ascii?Q?0QHd4jJ+63g6GhGSLGHZ34qBJ6i5EjCoGem4uO9ymzDxoYNr14A/Eas3NnSs?= =?us-ascii?Q?zgOAz2OfaVUr4mvZcidqjRt4A8K0xh3uJke5UBr+aJBRY591VuFM2nSLhVrU?= =?us-ascii?Q?Z6Fhe1VQJDQchb4sWo80RvE=3D?= Content-Type: multipart/alternative; boundary="_000_BL1PR12MB5157646D2702EAB9B8CFA501E2589BL1PR12MB5157namp_" MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5157.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a0cb294c-405e-4d54-e0cb-08d9daaf2dc7 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Jan 2022 18:20:16.9978 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: hn7dncY3WGoSUSw3vpAsC6UZMXp5xzFmYNBuz7MIyxGL1HwtqJyZzzi7oiMYMi1YKzxc795QRxA76nOThvoz0Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1183 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bjoren Dasse Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" --_000_BL1PR12MB5157646D2702EAB9B8CFA501E2589BL1PR12MB5157namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [Public] That is what I was hoping to convey with the warning messages. I'll take a= stab at rewording them and send out an updated revision. From: Liang, Prike Sent: Tuesday, January 18, 2022 02:28 To: Limonciello, Mario ; Lazar, Lijo ; amd-gfx@lists.freedesktop.org Cc: Bjoren Dasse Subject: RE: [PATCH v2] drm/amd: Warn users about potential s0ix problems If the flag ACPI_FADT_LOW_POWER_S0 not set or AMDPMC driver not build, then= that seems will mess up the suspend entry and unable to enter either S3 no= r S2idle properly. In this S2idle configuration issue case, how about add s= ome message to notify end user how to configure S2idle correctly? Thanks, Prike From: amd-gfx > On Behalf Of Limonciello, Mario Sent: Tuesday, January 18, 2022 1:26 AM To: Lazar, Lijo >; amd-gfx@li= sts.freedesktop.org Cc: Bjoren Dasse > Subject: RE: [PATCH v2] drm/amd: Warn users about potential s0ix problems [Public] Yes, that's part of why I want to make sure there are explicit warnings to = users about using this flow. When not enabled in ACPI then also the LPS0 device is not exported and AMD_= PMC won't load or be used. I think from amdgpu perspective it should behave relatively similar to an a= borted suspend. From: Lazar, Lijo > Sent: Monday, January 17, 2022 11:20 To: Limonciello, Mario >; amd-gfx@lists.freedesktop.org Cc: Bjoren Dasse > Subject: Re: [PATCH v2] drm/amd: Warn users about potential s0ix problems Any problem with PMFW sequence in the way Linux handles s2idle when it's no= t enabled in ACPI? Thanks, Lijo ________________________________ From: Limonciello, Mario > Sent: Monday, January 17, 2022 10:45:44 PM To: amd-gfx@lists.freedesktop.org >; Lazar, = Lijo > Cc: Bjoren Dasse > Subject: RE: [PATCH v2] drm/amd: Warn users about potential s0ix problems [Public] This has been sitting a week or so. Bump on review for this patch. > -----Original Message----- > From: Limonciello, Mario > > Sent: Tuesday, January 11, 2022 14:00 > To: amd-gfx@lists.freedesktop.org > Cc: Limonciello, Mario >; Bjoren Dasse > > > Subject: [PATCH v2] drm/amd: Warn users about potential s0ix problems > > On some OEM setups users can configure the BIOS for S3 or S2idle. > When configured to S3 users can still choose 's2idle' in the kernel by > using `/sys/power/mem_sleep`. Before commit 6dc8265f9803 > ("drm/amdgpu: > always reset the asic in suspend (v2)"), the GPU would crash. Now when > configured this way, the system should resume but will use more power. > > As such, adjust the `amdpu_acpi_is_s0ix function` to warn users about > potential power consumption issues during their first attempt at > suspending. > > Reported-by: Bjoren Dasse > > Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1824 > Signed-off-by: Mario Limonciello > > --- > v1->v2: > * Only show messages in s2idle cases > drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c > index 4811b0faafd9..1295de6d6c30 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c > @@ -1040,11 +1040,15 @@ void amdgpu_acpi_detect(void) > */ > bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) > { > -#if IS_ENABLED(CONFIG_AMD_PMC) && IS_ENABLED(CONFIG_SUSPEND) > - if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) { > - if (adev->flags & AMD_IS_APU) > - return pm_suspend_target_state =3D=3D > PM_SUSPEND_TO_IDLE; > - } > + if (!(adev->flags & AMD_IS_APU) || > + pm_suspend_target_state !=3D PM_SUSPEND_TO_IDLE) > + return false; > + if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) > + dev_warn_once(adev->dev, > + "BIOS is not configured for suspend-to-idle, = power > consumption will be higher\n"); > +#if !IS_ENABLED(CONFIG_AMD_PMC) > + dev_warn_once(adev->dev, > + "amd-pmc is not enabled in the kernel, power > consumption will be higher\n"); > #endif > - return false; > + return true; > } > -- > 2.25.1 --_000_BL1PR12MB5157646D2702EAB9B8CFA501E2589BL1PR12MB5157namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

[Public]

 

That is what I was hoping to convey with the warning= messages.  I’ll take a stab at rewording them and send out an u= pdated revision.

 

From: Liang, Prike <Prike.Liang@amd.com>= ;
Sent: Tuesday, January 18, 2022 02:28
To: Limonciello, Mario <Mario.Limonciello@amd.com>; Lazar, Lij= o <Lijo.Lazar@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Bjoren Dasse <bjoern.daase@gmail.com>
Subject: RE: [PATCH v2] drm/amd: Warn users about potential s0ix pro= blems

 

If the flag ACPI_FADT_LOW_POWER_S0 not set or AMDPMC= driver not build, then that seems will mess up the suspend entry and unabl= e to enter either S3 nor S2idle properly. In this S2idle configuration issu= e case, how about add some message to notify end user how to configure S2idle correctly?

 

Thanks,

Prike

From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Limonciello, Mario
Sent: Tuesday, January 18, 2022 1:26 AM
To: Lazar, Lijo <Lijo.Lazar= @amd.com>; amd-gfx@lists.freedesktop.= org
Cc: Bjoren Dasse <bjoer= n.daase@gmail.com>
Subject: RE: [PATCH v2] drm/amd: Warn users about potential s0ix pro= blems

 

[Public]

 

Yes, that’s part of why I want to make sure th= ere are explicit warnings to users about using this flow.

When not enabled in ACPI then also the LPS0 device i= s not exported and AMD_PMC won’t load or be used.

 

I think from amdgpu perspective it should behave rel= atively similar to an aborted suspend.

 

From: Lazar, Lijo <Lijo.Lazar@amd.com>
Sent: Monday, January 17, 2022 11:20
To: Limonciello, Mario <Mario.Limonciello@amd.com>; amd-gfx@lists.freedesktop.= org
Cc: Bjoren Dasse <bjoer= n.daase@gmail.com>
Subject: Re: [PATCH v2] drm/amd: Warn users about potential s0ix pro= blems

 

Any problem with PMFW sequence in the way Linux handles s2idle when it= 's not enabled in ACPI?

 

Thanks,
Lijo


From: Limonciello, Mario <Mario.Limonciello@amd.com>
Sent: Monday, January 17, 2022 10:45:44 PM
To:
amd-gfx@= lists.freedesktop.org <amd-gfx@lists.freedesktop.org>; Lazar, Lijo <Lijo.Lazar@amd.com>
Cc: Bjoren Dasse <
bjoern.daase@gmail.com>
Subject: RE: [PATCH v2] drm/amd: Warn users about potential s0ix pro= blems

 

[Public]

This has been sitting a week or so.
Bump on review for this patch.

> -----Original Message-----
> From: Limonciello, Mario <Mario.Limonciello@amd.com>
> Sent: Tuesday, January 11, 2022 14:00
> To: amd-gfx@lists.fre= edesktop.org
> Cc: Limonciello, Mario <Mario.Limonciello@amd.com>; Bjoren Dasse
> <bjoern.daase@gmail.com>
> Subject: [PATCH v2] drm/amd: Warn users about potential s0ix problems<= br> >
> On some OEM setups users can configure the BIOS for S3 or S2idle.
> When configured to S3 users can still choose 's2idle' in the kernel by=
> using `/sys/power/mem_sleep`.  Before commit 6dc8265f9803
> ("drm/amdgpu:
> always reset the asic in suspend (v2)"), the GPU would crash.&nbs= p; Now when
> configured this way, the system should resume but will use more power.=
>
> As such, adjust the `amdpu_acpi_is_s0ix function` to warn users about<= br> > potential power consumption issues during their first attempt at
> suspending.
>
> Reported-by: Bjoren Dasse <
bjoern.daase@gmail.com>
> Link: https://gitlab.freedesktop.org/drm/amd/-/issues/1824
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> v1->v2:
>  * Only show messages in s2idle cases
>  drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 16 ++++++++++------ >  1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> index 4811b0faafd9..1295de6d6c30 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
> @@ -1040,11 +1040,15 @@ void amdgpu_acpi_detect(void)
>   */
>  bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev)
>  {
> -#if IS_ENABLED(CONFIG_AMD_PMC) && IS_ENABLED(CONFIG_SUSPEND)<= br> > -     if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_= POWER_S0) {
> -           &nb= sp; if (adev->flags & AMD_IS_APU)
> -           &nb= sp;         return pm_suspend_targe= t_state =3D=3D
> PM_SUSPEND_TO_IDLE;
> -     }
> +     if (!(adev->flags & AMD_IS_APU) || > +         pm_suspend_target_st= ate !=3D PM_SUSPEND_TO_IDLE)
> +           &nb= sp; return false;
> +     if (!(acpi_gbl_FADT.flags & ACPI_FADT_LO= W_POWER_S0))
> +           &nb= sp; dev_warn_once(adev->dev,
> +           &nb= sp;            =    "BIOS is not configured for suspend-to-idle, power
> consumption will be higher\n");
> +#if !IS_ENABLED(CONFIG_AMD_PMC)
> +     dev_warn_once(adev->dev,
> +           &nb= sp;       "amd-pmc is not enabled in the= kernel, power
> consumption will be higher\n");
>  #endif
> -     return false;
> +     return true;
>  }
> --
> 2.25.1

--_000_BL1PR12MB5157646D2702EAB9B8CFA501E2589BL1PR12MB5157namp_--