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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2DC4C04A6A for ; Wed, 2 Aug 2023 14:31:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233763AbjHBObk (ORCPT ); Wed, 2 Aug 2023 10:31:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231795AbjHBObh (ORCPT ); Wed, 2 Aug 2023 10:31:37 -0400 Received: from mgamail.intel.com (unknown [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 564E5EC; Wed, 2 Aug 2023 07:31:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690986695; x=1722522695; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=04PaJ4rNw2KBD/Q8LpUT/AkUkIbasNkvokyMVEZUDcc=; b=E42LjCI4v/2m/MVMZN0s5n2h9Gkvx/4ny0II/k+Bk2g6YsT8kxGQkmhp ttOrk5pypyIFhIJqPTU2EaAl5AaxqOKIZY0TzHLi7I75je/a1hEwf9YS3 dplzpwgudDLHkQWpU67/+TTdDfgy+z1zwl7oKx10lRoZrMoeGf/cHmghT HxGBc6H9ihcZFwPIYaOpwlauYyk8J9Vw75R8+2pFqj5R4bN20zYl+cYwq jIjibnyy1VXC1nUJhDI3FvqoEmVC06N67nHVx6La6zu/vRcPn1pqfVjTj 5A0eExDypdMJ4h43A80ea/TNHN4Y2E2hyJrTPtu0HYcyDj4+w4PzKqCgL g==; X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="359637080" X-IronPort-AV: E=Sophos;i="6.01,249,1684825200"; d="scan'208";a="359637080" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Aug 2023 07:31:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10789"; a="722867092" X-IronPort-AV: E=Sophos;i="6.01,249,1684825200"; d="scan'208";a="722867092" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 02 Aug 2023 07:31:32 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id DC64C13F; Wed, 2 Aug 2023 17:31:42 +0300 (EEST) Date: Wed, 2 Aug 2023 17:31:42 +0300 From: Mika Westerberg To: Mario Limonciello Cc: "Rafael J. Wysocki" , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown , linux-acpi@vger.kernel.org, Iain Lane , Kuppuswamy Sathyanarayanan , Andy Shevchenko Subject: Re: [PATCH v7 2/2] PCI: Don't put non-power manageable PCIe root ports into D3 Message-ID: <20230802143142.GS14638@black.fi.intel.com> References: <37b005d5-68fb-f8dd-67e2-c953d677fca2@amd.com> <8298c01c-abec-914b-0542-459f38c635fe@amd.com> <20230802052601.GM14638@black.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Aug 02, 2023 at 09:10:38AM -0500, Mario Limonciello wrote: > > > On 8/2/23 00:26, Mika Westerberg wrote: > > Hi Mario, > > > > On Tue, Aug 01, 2023 at 10:17:11PM -0500, Mario Limonciello wrote: > > > > Consequently, platform_pci_bridge_d3() will return false and the only > > > > thing that may allow the port to go into D0 is the dmi_get_bios_year() > > > > check at the end of pci_bridge_d3_possible(). > > > > > > > > However, that was added, because there are Intel platforms on which > > > > Root Ports need to be programmed into D3hot on suspend (which allows > > > > the whole platform to reduce power significantly) and there are no > > > > ACPI device power management objects associated with them (Mika should > > > > know the gory details related to this). It looks like under Windows > > > > the additional power reduction would not be possible on those systems, > > > > but that would be a problem, wouldn't it? > > > > > > > > > > I've been thinking on this today, and I at least have a hypothesis about > > > this behavior. Perhaps Windows is actually utilizing enabled PEP > > > constraints to enforce what state device should be put into over Modern > > > Standby cycles in the absence of ACPI objects. > > > > > > In the case of one of my problematic system the PEP constraints for the root > > > port are: > > > > > > Package (0x04) > > > { > > > 0x00, > > > "\\_SB.PCI0.GP17", > > > 0x00, > > > 0x00 > > > }, > > > > > > That first 0x00 means the constraint isn't actually enabled for the root > > > port. > > > > > > Mika, > > > > > > Could you get an acpidump from one of these problematic Intel systems so we > > > can check the PEP constraints to see if this theory works? Or maybe you have > > > some other ideas why this is different? > > > > The patch adding this was merged in 2016 and unfortunately I don't have > > any of the ACPI dumps from them available anymore (and do not recall the > > details either). I think these were Apollo Lake-P based systems with the > > initial runtime D3cold and S0ix support at the time. > > > I scoured the web looking for acpidumps a bit an Apollo Lake system and came > across this random bug report: > > https://bugzilla.redhat.com/show_bug.cgi?id=1591307 > > "Intel(R) Celeron(R) CPU N3450 @ 1.10GHz (family: 0x6, model: 0x5c, > stepping: 0x9)" > > I looked at the acpidump, and I notice: > > Low Power S0 Idle (V5) : 0 > > That means that Windows wouldn't actually be putting it into Modern Standby > at suspend but would rather use S3. Same goes for Linux AFAICT. The ones needed this actually used S0ix so the bit should definitely be set. > Considering that result, could we perhaps adjust the check to: > > if ((c->x86_vendor == X86_VENDOR_INTEL) && !(acpi_gbl_FADT.flags & > ACPI_FADT_LOW_POWER_S0)) > > Or could we quirk the PCI root ports from Apollo Lake to opt into D3? It is not just Apollo Lake, but all "modern" systems as well (sorry if this was unclear). Apollo Lake just was the first one that needed this. We also have the Low Power S0 Idle bit set in recent systems too.