Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4379280imu; Mon, 12 Nov 2018 10:03:06 -0800 (PST) X-Google-Smtp-Source: AJdET5eMjulRFWMSVdJvHI4vzgcPWmqM4v1Z8ZZUP7SM2dcvKEFLdvFCb3Qbt17foyPZgGqUKpb2 X-Received: by 2002:a62:7796:: with SMTP id s144-v6mr1847190pfc.159.1542045785967; Mon, 12 Nov 2018 10:03:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542045785; cv=none; d=google.com; s=arc-20160816; b=upuh/K2hTJM2jxKH3uEKUjsojFS9RJ77CV5Ps3sYSOqrf7hl2b/8yz9ZYPU5U1oDox SgOB2SCp5hRTvOOicizKt35P3BMwMsZTzAXOEjrUp6LfFZGH4H/Uu0Aj6Vz4netNF/IS OQk5+gb+EYfd77copT0LvRp5MVp3JexXxpueUExyq6yr67teGeOED2FbWZa8h5P63rd+ euUh/UWUbb79VeWMATzGQD7Eue+PK+keis9U0voJSV0rbGGhvmbbGogFTX607x4P9km6 uGXW3ijAwM5ccX6D9KLYl1athUB8AZADN2ttdOqiXAYB2+IkGCByk05we8IzZCcFkmAK ifgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=hoEj1UUVJxkvdTrr4Qfst6ZkhX/Lf5tyvhNBeHaI5Y4=; b=HBeUQaISgeBoEPTcupKWbdXdizmCir3Ak6Nqk96cg4d22Cz8DhQHpeVe1j5Ivme5Vm ctDw9IEkWvmJ7PvexEmaY5oS2ycDreE7vT7UnyB8KH3vUB1Xd7T3flNPIYU5Z4QKTdaY SrWvW0/KmtulZLyda3UVHnWqhnGNx3qao27alaxQUUM0sFZf5j8AKeMVUE/azqhV5zAp ujTv+ixw55BJP4pIpZFOn1KvWqGZfkewrTJCE8dOmENY79qEsC0D/MxdofYkxKl0GRBn 8u/7ryyOlCnqUN7b+gdJeSmKgpGYT6NN1YpLNw8zwcB9mtGz5BvyzsZn/ZTMTL81ohmK T9Xg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si11211301pgv.277.2018.11.12.10.02.48; Mon, 12 Nov 2018 10:03:05 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729926AbeKMD4Z (ORCPT + 99 others); Mon, 12 Nov 2018 22:56:25 -0500 Received: from bmailout2.hostsharing.net ([83.223.90.240]:36875 "EHLO bmailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727712AbeKMD4Z (ORCPT ); Mon, 12 Nov 2018 22:56:25 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id 4387D2800B74A; Mon, 12 Nov 2018 19:02:04 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id CFF7C1C9E0; Mon, 12 Nov 2018 19:02:03 +0100 (CET) Date: Mon, 12 Nov 2018 19:02:03 +0100 From: Lukas Wunner To: Mika Westerberg Cc: 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: <20181112180203.lx72gjfplb6xlur7@wunner.de> References: <20181112160628.86620-1-mika.westerberg@linux.intel.com> <20181112160628.86620-2-mika.westerberg@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181112160628.86620-2-mika.westerberg@linux.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks, Lukas