Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2127392rwd; Wed, 17 May 2023 06:12:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56vaYmCpPVoXgaukQzk2kPgibOUYcAaFIAtJoCRnVnL0tOGwfGR/Kj3zGuED/DRtpi/yeu X-Received: by 2002:a05:6a20:8f16:b0:103:c059:9371 with SMTP id b22-20020a056a208f1600b00103c0599371mr29007820pzk.38.1684329162815; Wed, 17 May 2023 06:12:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684329162; cv=none; d=google.com; s=arc-20160816; b=VsF6W9c9fFQbZiMnF3LNidURJxmClv/OAl5cPlvcU4MOjsEFC9Vt5gcs6VM8pLa1OS 8Fgcqsq8iMgkehesRzXVhbRWa9qIP9suXeb0KhvBhROUetQedZTSGkqcwjOiYnFDNZq1 bUb3AGyu9O8OhlPBT/fAyAzvPDpZaHrBYgb36AvNLaTSbwPY43EYge7Bt1hHJ8oZPl7a RCOniWA0Krdj7JQhSK6IoVnEQ5gVajee+jf/2Gb2pZaua8MVXZuX8zsSkcVI8ffeF4/w QkaU81cMGnFhc8mvjUj09k1rqT5lJQG6j9zojj10hvClNMJhZn8hq4jB4B3yQD9G5QEL PRqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jjxgd8t6dZ4Oshy9p9oMCU+BII+Tev3Wn3O7QVoCVis=; b=zVUxdzS+DERU0I2E4QXqxioERqurM+7i8Iuv2cgq6pC54kwK9uvZbSzlWKeEu/SQLA dcnR4RSSL8mIHd144vzUlxJQb13ZI29IIXUw+bhVcI6oi+pi1b2XJ4PICnL0rqfrdHkg HDZQ3kznn3oYWUcF0XGOQvGM+CPTPMuowgFCeQ5/LeZVjC8Vt42/DVY9o6QiF0j7Fh2r RdVlwoZQ3EoF/EmInKMqpzh8pvxxIDlR3BnumjXktldxErOKl1LUza5JyP7N6FU2rfbw RiGY0L2+rPGBNZDHZ5qeqDxXdf6ZI5R7yGDqjgLW9iMbAmKwaBZmhBtG8VlNflABRDMQ DXWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KKZ3qWD4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i186-20020a6387c3000000b0051b5fc497e9si21946513pge.739.2023.05.17.06.12.28; Wed, 17 May 2023 06:12:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KKZ3qWD4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231591AbjEQM6F (ORCPT + 99 others); Wed, 17 May 2023 08:58:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230139AbjEQM6E (ORCPT ); Wed, 17 May 2023 08:58:04 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 480692D73; Wed, 17 May 2023 05:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684328283; x=1715864283; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=pFCGdaUiZ35dGVV0+KTHsJ5y2FJpK7N77Y7pmbvylYw=; b=KKZ3qWD4OiBn4mTECwibL5YUbJyebHBOZrztKNRJm/JC+KrKVx7z04PV 1jf0hsOAfE9n7EJ8ZdlytqMc7AStYLZKCsRjMIadHdoWGNX3PBBHnchBu VPDn9tLZPeQlb9XSIbchSkXSWeRut1lTz+MQNaGSRRafzAb0oWfIyd9Z7 A7Cpvxrq+YjY+mjdUsituNGkQul1F1mwG9ZrzUbCX7Wdf1V8gW5y0OS5q 4AytxfehGQgJAVfAtMxbUQ4PHsa91elH25FNqt6ARCliZHJcmMaFbsDGJ ntPLko65X8jNmRdLF+bZ4OG3ARm+dY9KbYGw0sACBfKpkQJLYWk0dgDUv A==; X-IronPort-AV: E=McAfee;i="6600,9927,10712"; a="438094654" X-IronPort-AV: E=Sophos;i="5.99,282,1677571200"; d="scan'208";a="438094654" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2023 05:58:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10712"; a="771447279" X-IronPort-AV: E=Sophos;i="5.99,282,1677571200"; d="scan'208";a="771447279" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 17 May 2023 05:58:00 -0700 Received: by black.fi.intel.com (Postfix, from userid 1001) id E8FD3618; Wed, 17 May 2023 15:58:11 +0300 (EEST) Date: Wed, 17 May 2023 15:58:11 +0300 From: Mika Westerberg To: "Limonciello, Mario" Cc: "Limonciello, Mario" , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, S-k Shyam-sundar , Natikar Basavaraj , Deucher Alexander , "Rafael J. Wysocki" , Iain Lane Subject: Re: [PATCH] PCI: Only put >= 2015 root ports into D3 on Intel Message-ID: <20230517125811.GG45886@black.fi.intel.com> References: <20230515231515.1440-1-mario.limonciello@amd.com> <20230516055918.GS66750@black.fi.intel.com> <20230517071527.GU66750@black.fi.intel.com> <8e7e23dc-f01b-6f78-f383-7706795e386e@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <8e7e23dc-f01b-6f78-f383-7706795e386e@amd.com> X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 17, 2023 at 07:33:17AM -0500, Limonciello, Mario wrote: > > > > AFAICT the actual issue is entirely a wakeup platform firmware sequencing > > > issue > > > while in a hardware sleep state and not PMEs. > > > > > > It's only exposed by putting the root ports into D3 over s2idle. > > But there are two ways to enter s2idle (well or the S0ix whatever is the > > AMD term for that). Either through system sleep or simply waiting that > > all the needed devices runtime suspend. There should be no difference > > from device perspective AFAICT. I should correct that the wakes may be configured differently, though. > On AMD all devices in runtime suspend and SoC entering system > suspend aren't the same state. Okay. > > > As an experiment on an unpatched kernel if I avoid letting amd-pmc bind then > > > the > > > hardware will never enter a hardware sleep state over Linux s2idle and this > > > issue > > > doesn't occur. > > > > > > That shows that PMEs *do* work from D3cold. > > > > > > With all of this I have to wonder if the Windows behavior of what to do with > > > the root > > > ports is tied to the uPEP requirements specified in the firmware. > > > > > > Linux doesn't do any enforcement or adjustments from what uPEP indicates. > > > > > > The uPEP constraints for the root port in question in an affected AMD system > > > has: > > > > > >                     Package (0x04) > > >                     { > > >                         Zero, > > >                         "\\_SB.PCI0.GP19", > > >                         Zero, > > >                         Zero > > >                     }, > > > > > > AMD's parsing is through 'lpi_device_get_constraints_amd' so that structure > > > shows > > > as not enabled and doesn't specify any D-state requirements. > > AFAIK this object does not exist in ChromeOS so Linux cannot use it > > there. > OK that means that if we came up with a solution that utilized > uPEP that it would have to remain optional. Right. > > > What do they specify for Intel on a matching root port? > > I think the corresponding entry in ADL-P system for TBT PCIe root port 0 > > looks like this: > > > > Package (0x03) > > { > > "\\_SB.PC00.TRP0", > > Zero, > > Package (0x02) > > { > > Zero, > > Package (0x02) > > { > > 0xFF, > > 0x03 > > } > > } > > }, > > > > I'm not entirely sure what does it tell? ;-) > > It's parsed using `lpi_device_get_constraints`. > > So should I follow it right this means for ACPI device > \\_SB.PC00.TRP0 the constraint is disabled. > > It's described as > Version 0, UID 0xFF has a minimum D-state of 3. I see, so it needs to be in D3 for this "constraint" to be valid. > That means my idea to try to only change D-states at > suspend for enabled constraints won't help. :(