Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2089340rwd; Wed, 17 May 2023 05:45:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4gFPluWYOn+Hm2SMx1kEIo8q32qUUeFFpcVcOMtcqbWviQiTIaZbOKCp4qqJMAsNrByYrr X-Received: by 2002:a17:903:41c6:b0:1ad:f7d9:1ae2 with SMTP id u6-20020a17090341c600b001adf7d91ae2mr19828410ple.55.1684327527247; Wed, 17 May 2023 05:45:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684327527; cv=pass; d=google.com; s=arc-20160816; b=066a6iykh9pC6pGK1QC1fQ+MOEL9aWzYs/kvAgLZ1C0JXpOfWxjCGoGJkczhpC/OL7 y34kzeN/Sem60tgq9/58DXuPh5VB3oWw3jIZAK0JaJR7qJgeLuFDbCCCU8kIvf+osyKM eZXe39TFH1/FZjDEjVwp3VhMpcP/Yar0jM0da6QvBya/ft0zQa4YbiRO71pRKT5hAHS0 zKSCHGwGAVBGKZ+dL+nkcjOejvNmWq5a2lgnd9NPUuGH5dajdgECvByhz0PLOhz0wKUg lKVfsdJRM+U1XCSNiUWlNkB3Uwx4bFYd+K25W1aiBaJACGvGyGJoBqO6ZvEIYx6qDxtX zoBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=fcn257jqt50UQnfinT3HB0mItESfQuYPNInIDt1bKLo=; b=wKnE3gnS/pTBAx8kQqUugF6m4y+2RacQHWg+vIQlNg2//q6Ls9Wf33KxwiJEeKwMMh ZE1iMNDbFF/QjwOAHmTWdCRnlbJAEB7NbvXSzhxCLLt171QqNtz+FWg7o5PJZScjA5aj 8v6+cDw1+IrBwNohmCnF2YBNx0Ko+Q8yK7qdT9lTwzAdJFfpzJf6hwJC8ErdODU7Tlw1 SjhGFchAMW14KWqs30ILsHza4bM4k7ZQJ54buQEYXHlPBPq2h0iAUktXSF3jiIwJCLV/ s32bKuSbWvA7P+rUgxj3b0eAoZbNb28l5oFVfskevvv+n2dComPv/lWQCpJpCfxq6PDL baGg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=M6n4fPrf; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k6-20020a170902694600b001ab23cbe13bsi18917733plt.104.2023.05.17.05.45.11; Wed, 17 May 2023 05:45:27 -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=@amd.com header.s=selector1 header.b=M6n4fPrf; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231709AbjEQMd0 (ORCPT + 99 others); Wed, 17 May 2023 08:33:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231389AbjEQMdZ (ORCPT ); Wed, 17 May 2023 08:33:25 -0400 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2084.outbound.protection.outlook.com [40.107.93.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 362E32101; Wed, 17 May 2023 05:33:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CKMbQssgBeS+ePhxDQe57cLJg0o2ct7CtgmGhjPDIB4b0+O7oTnpLrtCnv2zqwzHz31Uy74F3vXmhdW2CSHaRTkhTW1wPyS/EWeHT6VOrsOdsk8FsSKRrbmsQhdLW673ftwVvwBTutvTROheqHW7oTlWZK/prupBxFnWhbQ8vpKILZZK+Js96EY8cRE41r64tOwxeYbZ4v9FzGNXimR0S4nuJMMWrsc8hU/BupkHaldPG/25oFIkhtyYAjt6U0ypaINIgALkvLVQ5pE0dGp5VmTStkvR8qgyluTm+lDesotlDz2FxN6nFa/jaTbfCNMeVJlzoJvBbpsoiIlzWpEtLw== 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=fcn257jqt50UQnfinT3HB0mItESfQuYPNInIDt1bKLo=; b=iN7+Xnm8mLksQ0SJYUxvZyoXsx2uafJ2KuQS1SK9yie9Kk/kMiHXzCtXkI+C7EbJa4YhJxxJXjSJaPSP/jEetf0TWAHGtJmAJ+Gx4Q+w7Ka6ZzEZCnfuyfFOY2Rc661VuqW9m9zaiS45ZxidJmZpRvXDgJQ1SnS1Quv74YCtE0LeurdDs/VvA3wyuKT02OplrmhKvFGlJaLyOt/oqlbztAHTos5uwg+X+K1phmLK1jPtJPH+/oHBAfeubzAW6hlk7BIR0Nf672Wz4PUcsHuEjS/vGxKkNaklGj7hYS2mIJqX6+Oo2Gm29rq1E8M82WfUgoOrZ1lg7b04AeOv4O/sQg== 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=fcn257jqt50UQnfinT3HB0mItESfQuYPNInIDt1bKLo=; b=M6n4fPrfbrKoWh6MHjk25iHujJoZZjlx9i4mzcDvLP6Yuv63um2RKvqutr90SBbEbNvlZlsQS6d5Cxw5KAUacegMEZ7Ca7eu/gh7Ca73YQ4G5W4tF2T66/rtLkwnOQ8Sww1o+X/ciem1nYk9wvTOVofdzPj9nVVWMs5B5/WWdvk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) by CH0PR12MB5170.namprd12.prod.outlook.com (2603:10b6:610:b9::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Wed, 17 May 2023 12:33:19 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::3f45:358e:abba:24f5]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::3f45:358e:abba:24f5%3]) with mapi id 15.20.6387.030; Wed, 17 May 2023 12:33:19 +0000 Message-ID: <8e7e23dc-f01b-6f78-f383-7706795e386e@amd.com> Date: Wed, 17 May 2023 07:33:17 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH] PCI: Only put >= 2015 root ports into D3 on Intel Content-Language: en-US To: Mika Westerberg , "Limonciello, Mario" Cc: 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 References: <20230515231515.1440-1-mario.limonciello@amd.com> <20230516055918.GS66750@black.fi.intel.com> <20230517071527.GU66750@black.fi.intel.com> From: "Limonciello, Mario" In-Reply-To: <20230517071527.GU66750@black.fi.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SA0PR11CA0113.namprd11.prod.outlook.com (2603:10b6:806:d1::28) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB6101:EE_|CH0PR12MB5170:EE_ X-MS-Office365-Filtering-Correlation-Id: 56b17f05-2d81-4f47-9b6e-08db56d2e51c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lcbJ3sIPlIVC4DZgQm7rnarlARWebl8a5pMGafA0qy3NrtxvwCyToGAC+ISVdN4XKT4JBNqjc85UFW2yEXxkfzA+FG2dpVrNJC9xDLGBFE7syO7v6Wvu8iGR7hAOOCXMT+g5EMtsx52V0JlgPbeW4EVut3auoFQKL/iywFUVtfvr9BbNWiOfeHO3y97tlfMtP7Wmep9K4J5vagsJPYSqOaBngX7G6CoCMREqx+rdhKLvJsXWy5JwuWjUvTC1Pqsyxj6qQlf2Dk2jRREGwo54J5K5Oi/QISNqyA0rRPlyqqcVTF/wqEdcXJ8agu9ITkOiZBqjsrPMHexuGjDH4InuH2Tj/O3F/GN7w7ccOab0j08j3L5BlfsFgIvTSjUQUZ+j0lSw4YzAlqXk7HmD3it5acCOHICPtf7M5fhdSAX5ky4bn18n1LXCgMKXqi+2OgHFONYR/hgnEY5XGZxQwRnggEUD0KjeVWFaxKH33T8A9vzCInOg8XUqh5WtMrNooYyRhr9KWw99VN9YNFVrqfmr3sjNgvC7A4dcDZF2jU6+J+rCj+MFW5vHOdMF1TWOauY9wW4sJffN74HsUrSi0eSPLGlt6OcDu/O5HL4u1mNqaXOxVPd/fACyb0+widn3biYqy9JwY64kgOUEjVpNH0ecIg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB6101.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(136003)(366004)(376002)(346002)(451199021)(5660300002)(41300700001)(2906002)(36756003)(83380400001)(2616005)(86362001)(31696002)(38100700002)(26005)(186003)(6512007)(6506007)(8676002)(8936002)(66556008)(66476007)(31686004)(66946007)(478600001)(6486002)(54906003)(316002)(6636002)(4326008)(110136005)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cnJiVHgxYnd6RXpDWHdtK3UxZDhpTkVsd1dLOGdxcDVZMnRJNkYyZVpzczI0?= =?utf-8?B?RkhYaEJSQW1pWUVHTkh1RER0TjZobnBNb0poL0xBQms0R2wzT3VTS2JLWk91?= =?utf-8?B?UGJkM3RURjhFU3NXUE9MRWhwQlJCYms3MXF5cmczV05VMXBNOFdzZWFvTlh5?= =?utf-8?B?VnBid011VUZ5ZWFVMjM0ZmRCbTJNSDBpUGt6amt1U2NIeHRJUUZsNkVzSzZw?= =?utf-8?B?RVh2Y25OK0FvZmlQektzZGh3MU1SQ3VZem00V0JsbWZzMWxuektyRGEwdVNi?= =?utf-8?B?TmFPbW1KcE5BTHJzeVM0SzBndEwxYTFqZkJMdVAvVDZQeU4ydVRWdk1Fb2h4?= =?utf-8?B?LzdvWVJaRXRwd0F6anE3N3crWWdFV2ptMiswQkVWR1RXekhVY3laQThSOEkz?= =?utf-8?B?eE5UWnBLUmszSW1JelV3a3hwbExVTDJOZGlhMHVCWjFOaDU0enpYVHJoMXBt?= =?utf-8?B?cVZhbW4rblo1OFpuR24zMjU3eHhnckVCQjBuYTBwRj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xOUFyZThmNVgxWXh4RVpCM0ho?= =?utf-8?B?czRrWEV1V0hlV0tVT2NmK2F6VWtMZVhPYi95K2NLN0Y1eTJXdllHcHIzaXl5?= =?utf-8?B?TlJ2eTBLc2NaWkVwMkNlSDFyZHBxclhCd0pvTmVLODZ1SC9IVTZyQURkeVNs?= =?utf-8?B?a2dqWG4vRVUyalNleFpXREJmRUlkOHhCQm1oQjIra0dEOE9aZmt1N3p3RTZI?= =?utf-8?B?UEhuWHVocEx3SkROMUU3enBGWTZMZkU4dVBROCsyeStIc1Q1eVN4c0VlWjZL?= =?utf-8?B?NWRyNHZ6aE9KaVYrU1YvSi9nMGZsT2ptbTY5OG1Ubnpob0NtZ3g1SFVLY0l5?= =?utf-8?B?NGcvcmxlUVM1Vit0aVBhYVFhenM1bkdoa3pvcFdRbWVUNFVMMVJML21EK2Nh?= =?utf-8?B?c1V0RUNRRmtlaTBEcVFpQzM3RWNQQ1M3UUYwMkFoWGp5UU12N2hQV1JvcGVw?= =?utf-8?B?Vkx5Nm9ZQTkxaVMxWmYzc2JzdVVrd2dYKzRlclJvTFA3cFlZWnVsT2NrQnBv?= =?utf-8?B?WE4zV1hWSUJqZ3dUdTE1QnhmalgvL01PbW5SOTJLbkJzdzNNVWE5bTNWakh5?= =?utf-8?B?Qzc0V2p1bkdtL2tETlNKdmZ5RzgyblFtbVBQdEkydHgvWm4zc3Y4N1ZPUmta?= =?utf-8?B?RjNHODFBNmladUhTL2tSbXJ6Z21yajBKbFRmbFZSMkgvT0Y3RnNaVEFYdGFt?= =?utf-8?Q?yZSmczX6hTS5egQYUPUuPanLv?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 56b17f05-2d81-4f47-9b6e-08db56d2e51c X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2023 12:33:19.1614 (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: H4Ps8hsvDJ/hvQF0s7n+8b3QhDtVSGVHQ2uFBPPuenqrUmo42G5CHYqKyKGbUNJZp0EEbQe0t9kjpOxfgei6sg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5170 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 >> 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. On AMD all devices in runtime suspend and SoC entering system suspend aren't the same state. >> 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. > >> 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. That means my idea to try to only change D-states at suspend for enabled constraints won't help.