Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5235662imu; Tue, 13 Nov 2018 03:27:53 -0800 (PST) X-Google-Smtp-Source: AJdET5drs+t2dBke3bPrV8wPY6HNLP+aTFbz/h5KsaKa8E+2gaxi0qElJfR6PgGWA17tQGfCsWsy X-Received: by 2002:a17:902:8ec1:: with SMTP id x1-v6mr4718134plo.130.1542108473414; Tue, 13 Nov 2018 03:27:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542108473; cv=none; d=google.com; s=arc-20160816; b=sD+Q4gB3ZgdWP5mkK61HHJ57NTbtsrguocBLfdPZRVYHudP2MMV3kYFOoqm21vWU4b rNcpUO8fBgI5WrOnpzI5ks0JJ268UPrW72j/SgyksQdfk7O3aMAWjnruE8y3RBF0U8w6 okfEzK5xOJX1PV6/pJO3LiuOIZe1L1XgVJSOz6HDyjccHB6UwI0kogsDMujmTNvnjeRH bHJco6zd5kkrU4y+z/MsL+rXuHudJESrZ6nNM9Rqp7lkU7ms2zer2Dq13wlPWFyxzdlA 28ZZaB2KJqkqB5RKFyvEh37T7qODUQrluRPNF+IweOAxddbjUhGTq0pEPaqQMBsobh0H LLRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=eyIaRn9mY2qEugErc2EE8RHZ7BbhC3IDn5pwfzAukYw=; b=FBWrE9lBhwGMte3So6Xdc2BH7scFkpB8mQoAbXtMKWttqIBAcVIzE4upUZnCiZgO4U BMXK9oLE3UPe6d/fdu+V0FoCdTybHgApauBQVjWrYmtDWVlKrc3hcWGQgnb1486q5ou4 X8gQWkEQNX/nS3gC8Uw/xYd4DRrcbvGbT8NpJ9bUZsKPCi04sN88ro3JtvMlOXbGta3f LeH4ojXwGGwNeM+HoBsNg+bo1t1e1BrR+6R8qvauBd0NdS/38bKWZKlhcRcJpXi716pU XD+PqoTb5G/9l/8BLuiwEevh6OmBbcMSYfNQN1jZYATrFtSZMKEZlhssBxykfMuxLck1 QIlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t2si6627511plz.392.2018.11.13.03.27.37; Tue, 13 Nov 2018 03:27:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732675AbeKMVYs (ORCPT + 99 others); Tue, 13 Nov 2018 16:24:48 -0500 Received: from mga12.intel.com ([192.55.52.136]:2750 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732455AbeKMVYs (ORCPT ); Tue, 13 Nov 2018 16:24:48 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2018 03:27:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,499,1534834800"; d="scan'208";a="85455127" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.157]) by fmsmga007.fm.intel.com with SMTP; 13 Nov 2018 03:27:01 -0800 Received: by lahna (sSMTP sendmail emulation); Tue, 13 Nov 2018 13:27:00 +0200 Date: Tue, 13 Nov 2018 13:27:00 +0200 From: Mika Westerberg To: Lorenzo Pieralisi Cc: Lukas Wunner , iommu@lists.linux-foundation.org, Joerg Roedel , David Woodhouse , Lu Baolu , Ashok Raj , Bjorn Helgaas , "Rafael J. Wysocki" , Jacob jun Pan , Andreas Noever , Michael Jamet , Yehezkel Bernat , Christian Kellner , Mario.Limonciello@dell.com, Anthony Wong , linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] PCI / ACPI: Identify external PCI devices Message-ID: <20181113112700.GT2500@lahna.fi.intel.com> References: <20181112160628.86620-1-mika.westerberg@linux.intel.com> <20181112160628.86620-2-mika.westerberg@linux.intel.com> <20181112180203.lx72gjfplb6xlur7@wunner.de> <20181113105636.GB11202@e107981-ln.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181113105636.GB11202@e107981-ln.cambridge.arm.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 13, 2018 at 10:56:36AM +0000, Lorenzo Pieralisi wrote: > On Mon, Nov 12, 2018 at 07:02:03PM +0100, Lukas Wunner wrote: > > On Mon, Nov 12, 2018 at 07:06:25PM +0300, Mika Westerberg wrote: > > > --- a/drivers/pci/probe.c > > > +++ b/drivers/pci/probe.c > > > @@ -1378,6 +1378,27 @@ static void set_pcie_thunderbolt(struct pci_dev *dev) > > > } > > > } > > > > > > +static void set_pcie_external(struct pci_dev *dev) > > > +{ > > > + struct pci_dev *parent; > > > + > > > + /* > > > + * Walk up the device hierarchy and check for any upstream > > > + * bridge that has is_external_facing set to true. This means > > > + * the hierarchy is below PCIe port that is exposed externally > > > + * (such as Thunderbolt). > > > + */ > > > + parent = pci_upstream_bridge(dev); > > > + while (parent) { > > > + if (parent->is_external) { > > > + dev->is_external = true; > > > + break; > > > + } > > > + > > > + parent = pci_upstream_bridge(parent); > > > + } > > > +} > > > + > > > > This looks pretty much like a duplication of the is_thunderbolt bit > > in struct pci_dev and the pci_is_thunderbolt_attached() helper. > > > > Why constrain the functionality to ports with the _DSD property > > instead of making it available for *any* Thunderbolt port? > > I assume it is because this is just not needed for Thuderbolt ports but > rather for all PCIe devices that are "external" (whatever that is > supposed to mean), ie it is valid also for PCIe slots. Yes, that was the idea. We could have other "external" devices that are not using Thunderbolt as the interconnect. We could do so that we automatically set "is_external" for devices with "is_thunderbolt" so it should cover those as well. > To be frank the concept (and Microsoft _DSD bindings) seems a bit vague > and not thoroughly defined and I would question its detection at > PCI/ACPI core level, I would hope this can be clarified at ACPI > specification level, at least. I guess that is the way they envision to use _DSD. Instead of having single UUID that covers all properties (like what we have with device properties) they have one UUID per property "class". I certainly hope we don't need to keep extending prp_guids[] array each time they invent another "class" of properties.