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 C42F5C433F5 for ; Fri, 11 Feb 2022 14:19:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7CBF910EA8B; Fri, 11 Feb 2022 14:19:21 +0000 (UTC) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 415F010EA64; Fri, 11 Feb 2022 10:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644575250; x=1676111250; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=RCuCxhjV4esmnxdab6oU2vPqQ9Idnpu43es31WIDuUM=; b=UyPdhbHmFGfbZf1OgdeHBGCnppPDm7DXtkeUR0EzWHH8mj8/AAfQoFv/ UBRdDBAf3NCHdjL+ciHrAq+ACbFaNX2QUCf4+CIYgVAN+IiIaZM1QGWhp ngRmL3IH6H9zMNJyNIab45Mpt9aqxgsaPtMnZS+s2f0q7SyN581jdgzJD LoUY88Eaeg38GvQ3yA+OKu4sFPzcaxOMvHsLu1JHZ9Sx3D1fEJz/hqycB l+uZROKZo6ogr2QOVcHAAd5dWofBlyX2t/cmlZu3+PaI3xrlZSUAZOVbf /ZpyZLDT5pSvtqBrDLn8rg7gykdlLPQY2LM3e7RaDyCaJFQs74/xteNHe g==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="274265058" X-IronPort-AV: E=Sophos;i="5.88,360,1635231600"; d="scan'208";a="274265058" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2022 02:27:13 -0800 X-IronPort-AV: E=Sophos;i="5.88,360,1635231600"; d="scan'208";a="542034263" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.162]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Feb 2022 02:27:08 -0800 Received: by lahna (sSMTP sendmail emulation); Fri, 11 Feb 2022 12:23:51 +0200 Date: Fri, 11 Feb 2022 12:23:51 +0200 From: Mika Westerberg To: Mario Limonciello Subject: Re: [PATCH v2 3/9] PCI: drop `is_thunderbolt` attribute Message-ID: References: <20220210224329.2793-1-mario.limonciello@amd.com> <20220210224329.2793-4-mario.limonciello@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220210224329.2793-4-mario.limonciello@amd.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Mailman-Approved-At: Fri, 11 Feb 2022 14:19:18 +0000 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: Michael Jamet , "open list:PCI SUBSYSTEM" , "open list:THUNDERBOLT DRIVER" , Yehezkel Bernat , "open list:DRM DRIVERS" , "open list:X86 PLATFORM DRIVERS" , Andreas Noever , Lukas Wunner , "open list:RADEON and AMDGPU DRM DRIVERS" , "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" , Bjorn Helgaas , Alexander.Deucher@amd.com Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" Hi Mario, On Thu, Feb 10, 2022 at 04:43:23PM -0600, Mario Limonciello wrote: > The `is_thunderbolt` attribute is currently a dumping ground for a > variety of things. > > Instead use the driver core removable attribute to indicate the > detail a device is attached to a thunderbolt or USB4 chain. > > Signed-off-by: Mario Limonciello > --- > drivers/pci/pci.c | 2 +- > drivers/pci/probe.c | 20 +++++++------------- > drivers/platform/x86/apple-gmux.c | 2 +- > include/linux/pci.h | 5 ++--- > 4 files changed, 11 insertions(+), 18 deletions(-) > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c > index 9ecce435fb3f..1264984d5e6d 100644 > --- a/drivers/pci/pci.c > +++ b/drivers/pci/pci.c > @@ -2955,7 +2955,7 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge) > return true; > > /* Even the oldest 2010 Thunderbolt controller supports D3. */ > - if (bridge->is_thunderbolt) > + if (dev_is_removable(&bridge->dev)) For this, I'm not entirely sure this is what we want. The purpose of this check is to enable port power management of Apple systems with Intel Thunderbolt controller and therefore checking for "removable" here is kind of misleading IMHO. I wonder if we could instead remove the check completely here and rely on the below: if (platform_pci_bridge_d3(bridge)) return true; and that would then look like: static inline bool platform_pci_bridge_d3(struct pci_dev *dev) { if (pci_use_mid_pm()) return false; if (acpi_pci_bridge_d3(dev)) return true; if (device_property_read_bool(&dev->dev, "HotPlugSupportInD3")) return true; return false; } and then make a quirk in quirks.c that adds the software node property for the Apple systems? Or something along those lines. @Lukas, what do you think?