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 1A0B6C433F5 for ; Sun, 13 Feb 2022 09:19:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232470AbiBMJT3 (ORCPT ); Sun, 13 Feb 2022 04:19:29 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:47678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231366AbiBMJT3 (ORCPT ); Sun, 13 Feb 2022 04:19:29 -0500 Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [83.223.78.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01EA55C344; Sun, 13 Feb 2022 01:19:23 -0800 (PST) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id 05A4D2800B3D2; Sun, 13 Feb 2022 10:19:21 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id E8C26294C60; Sun, 13 Feb 2022 10:19:20 +0100 (CET) Date: Sun, 13 Feb 2022 10:19:20 +0100 From: Lukas Wunner To: Mario Limonciello Cc: Bjorn Helgaas , Mika Westerberg , "open list:PCI SUBSYSTEM" , "open list:THUNDERBOLT DRIVER" , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:DRM DRIVERS" , "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" , Andreas Noever , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Hans de Goede Subject: Re: [PATCH v3 03/12] PCI: Move check for old Apple Thunderbolt controllers into a quirk Message-ID: <20220213091920.GA15535@wunner.de> References: <20220211193250.1904843-1-mario.limonciello@amd.com> <20220211193250.1904843-4-mario.limonciello@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220211193250.1904843-4-mario.limonciello@amd.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Fri, Feb 11, 2022 at 01:32:41PM -0600, Mario Limonciello wrote: > `pci_bridge_d3_possible` currently checks explicitly for a Thunderbolt > controller to indicate that D3 is possible. As this is used solely > for older Apple systems, move it into a quirk that enumerates across > all Intel TBT controllers. I'm not so sure if it is only needed on Apple systems. > @@ -2954,10 +2960,6 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge) > if (pci_bridge_d3_force) > return true; > > - /* Even the oldest 2010 Thunderbolt controller supports D3. */ > - if (bridge->is_thunderbolt) > - return true; > - > /* Platform might know better if the bridge supports D3 */ > if (platform_pci_bridge_d3(bridge)) > return true; The fact that Thunderbolt PCIe ports support D3 is a property of those devices. It's not a property of the platform or a quirk of a particular vendor. Hence in my view the current location of the check (pci_bridge_d3_possible()) makes sense wheras the location you're moving it to does not. > +/* Apple machines as old as 2010 can do D3 with Thunderbolt controllers, but don't specify > + * it in the ACPI tables > + */ Apple started shipping Thunderbolt in 2011. Intel brought the first chips to market in 2010. The date is meaningful at the code's current location in pci_bridge_d3_possible() because a few lines further down there's a 2015 BIOS cut-off date. Microsoft came up with an ACPI property that BIOS vendors may set so that Windows knows it may put a Thunderbolt controller into D3cold. I'm not even sure if that property was ever officially adopted by the ACPI spec or if it's just a Microsoft-defined "standard". Apple had been using its own scheme to put Thunderbolt controllers into D3cold when nothing is plugged in, about a decade before Microsoft defined the ACPI property. I'm not sure if other vendors came up with their own schemes to power-manage Thunderbolt. We may regress those with the present patch. Thanks, Lukas