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 5C08CC433F5 for ; Mon, 14 Feb 2022 08:43:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FD47890BF; Mon, 14 Feb 2022 08:43:57 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A8D710E1AF; Mon, 14 Feb 2022 07:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644824170; x=1676360170; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=TtIgUTAIsXJ4XGN4YguPnu9VZqX5t+e944YjPkCfnAQ=; b=iHWvdIoZgHtfCTj4Jhhc+qlls93Fz+d/JUxueLUUn8/tXAy5kpGvPD5m hDk77VZ969/eUntwWODJEVAPujFNLKiqDxzh8UaU5YJeCcUVZ/sm2Qpth O+bu3Ka7g0O0JOAHkEDRNRztD7xpUlF+0hM0Ppv9eEK6G31gy934aZteB DnNNLDen94uiAE/ZJhMk1hku2IFLGZqqMVcufsUP25GtzN2RLCwuL/BWp fihVxxIPBGVZgLlmqxoZAYDGcO3gNivagm1JPAnw54MXBOKCKEtdsM+iC 1mcf98RTRzTXfk5f6oV25/aJKjr1xbuD7JkzLCdz9In4Yl/Eh4rGaQjih A==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="247628391" X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="247628391" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2022 23:36:09 -0800 X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="772875545" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.162]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2022 23:36:04 -0800 Received: by lahna (sSMTP sendmail emulation); Mon, 14 Feb 2022 09:34:26 +0200 Date: Mon, 14 Feb 2022 09:34:26 +0200 From: Mika Westerberg To: Bjorn Helgaas Subject: Re: [PATCH v3 05/12] PCI: Detect root port of internal USB4 devices by `usb4-host-interface` Message-ID: References: <20220211193250.1904843-6-mario.limonciello@amd.com> <20220211214546.GA737137@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220211214546.GA737137@bhelgaas> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Mailman-Approved-At: Mon, 14 Feb 2022 08:43:42 +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: Andreas Noever , "open list:RADEON and AMDGPU DRM DRIVERS" , Michael Jamet , "open list:PCI SUBSYSTEM" , "open list:THUNDERBOLT DRIVER" , Yehezkel Bernat , "open list:DRM DRIVERS" , Hans de Goede , Lukas Wunner , Mario Limonciello , "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 Bjorn, On Fri, Feb 11, 2022 at 03:45:46PM -0600, Bjorn Helgaas wrote: > On Fri, Feb 11, 2022 at 01:32:43PM -0600, Mario Limonciello wrote: > > The root port used for PCIe tunneling should be marked as removable to > > ensure that the entire chain is marked removable. > > > > This can be done by looking for the device property specified in > > the ACPI tables `usb4-host-interface`. > > > > Suggested-by: Mika Westerberg > > Link: https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports#mapping-native-protocols-pcie-displayport-tunneled-through-usb4-to-usb4-host-routers > > Signed-off-by: Mario Limonciello > > --- > > drivers/pci/pci-acpi.c | 10 ++++++++++ > > drivers/pci/pci.h | 5 +++++ > > drivers/pci/probe.c | 1 + > > 3 files changed, 16 insertions(+) > > > > diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c > > index a42dbf448860..6368e5633b1b 100644 > > --- a/drivers/pci/pci-acpi.c > > +++ b/drivers/pci/pci-acpi.c > > @@ -1391,6 +1391,16 @@ void pci_acpi_cleanup(struct device *dev, struct acpi_device *adev) > > } > > } > > > > +bool pci_acpi_is_usb4(struct pci_dev *dev) > > +{ > > + struct acpi_device *adev = ACPI_COMPANION(&dev->dev); > > + > > + if (!adev) > > + return false; > > + return fwnode_property_present(acpi_fwnode_handle(adev), > > + "usb4-host-interface"); > > Maybe it's obvious to everybody but me that "USB4" means this device > is removable. The Microsoft reference above doesn't say anything > about removability. > > My expectation is that "USB" (like "PCI" and "PCIe") tells me > something about how a device is electrically connected and how > software can operate it. It doesn't really tell me anything about > whether those electrical connections are permanent, made through an > internal slot, or made through an external connector and cable. It is used to identify "tunneled" ports (whether PCIe, USB 3.x or DisplayPort). Tunnels are created by software (in Linux it is the Thunderbolt driver) and are dynamic in nature. The USB4 links go over USB Type-C cable which also is something user can plug/unplug freely. I would say it is reasonable expectation that anything behind these ports can be assumed as "removable". 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 15543C433F5 for ; Mon, 14 Feb 2022 07:36:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231886AbiBNHgR (ORCPT ); Mon, 14 Feb 2022 02:36:17 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229693AbiBNHgQ (ORCPT ); Mon, 14 Feb 2022 02:36:16 -0500 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E21BB593BE; Sun, 13 Feb 2022 23:36:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644824169; x=1676360169; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=TtIgUTAIsXJ4XGN4YguPnu9VZqX5t+e944YjPkCfnAQ=; b=SwRK8zVWJgEMXtJtpBLzZy1BsUZKzdZ+4NjbisNZaDzXs889iWGOHqSd GOonLu/QM7tAGFVRmW+FDlBJvZGgBbfFVfQ4U7dZDo0RDcdusIwtAohQY fd6aWPIchooNH8JYKbF6byvkhmh6IOfSK8jD3iB+b+UTq0Z7P0gzYCS5T LxLb7neO5XXg+OsWvtnsx3+lUZF1a+Ww9vNQg5F2eY/3XkfER6+wEj+nb mWEpZEUnyA+YMMSMLuQSrzq6BPcGfD+zG9TwCjb/De75gRDyW2G3hdXZH 7TNGJXADQ+P3UJMbzWPhXJuNu+0TVa13kvmUD1tISvFskC37ptitYU+hm g==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="247628389" X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="247628389" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2022 23:36:09 -0800 X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="772875545" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.162]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2022 23:36:04 -0800 Received: by lahna (sSMTP sendmail emulation); Mon, 14 Feb 2022 09:34:26 +0200 Date: Mon, 14 Feb 2022 09:34:26 +0200 From: Mika Westerberg To: Bjorn Helgaas Cc: Mario Limonciello , Bjorn Helgaas , "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" , Hans de Goede , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Lukas Wunner , Andreas Noever Subject: Re: [PATCH v3 05/12] PCI: Detect root port of internal USB4 devices by `usb4-host-interface` Message-ID: References: <20220211193250.1904843-6-mario.limonciello@amd.com> <20220211214546.GA737137@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220211214546.GA737137@bhelgaas> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Hi Bjorn, On Fri, Feb 11, 2022 at 03:45:46PM -0600, Bjorn Helgaas wrote: > On Fri, Feb 11, 2022 at 01:32:43PM -0600, Mario Limonciello wrote: > > The root port used for PCIe tunneling should be marked as removable to > > ensure that the entire chain is marked removable. > > > > This can be done by looking for the device property specified in > > the ACPI tables `usb4-host-interface`. > > > > Suggested-by: Mika Westerberg > > Link: https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports#mapping-native-protocols-pcie-displayport-tunneled-through-usb4-to-usb4-host-routers > > Signed-off-by: Mario Limonciello > > --- > > drivers/pci/pci-acpi.c | 10 ++++++++++ > > drivers/pci/pci.h | 5 +++++ > > drivers/pci/probe.c | 1 + > > 3 files changed, 16 insertions(+) > > > > diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c > > index a42dbf448860..6368e5633b1b 100644 > > --- a/drivers/pci/pci-acpi.c > > +++ b/drivers/pci/pci-acpi.c > > @@ -1391,6 +1391,16 @@ void pci_acpi_cleanup(struct device *dev, struct acpi_device *adev) > > } > > } > > > > +bool pci_acpi_is_usb4(struct pci_dev *dev) > > +{ > > + struct acpi_device *adev = ACPI_COMPANION(&dev->dev); > > + > > + if (!adev) > > + return false; > > + return fwnode_property_present(acpi_fwnode_handle(adev), > > + "usb4-host-interface"); > > Maybe it's obvious to everybody but me that "USB4" means this device > is removable. The Microsoft reference above doesn't say anything > about removability. > > My expectation is that "USB" (like "PCI" and "PCIe") tells me > something about how a device is electrically connected and how > software can operate it. It doesn't really tell me anything about > whether those electrical connections are permanent, made through an > internal slot, or made through an external connector and cable. It is used to identify "tunneled" ports (whether PCIe, USB 3.x or DisplayPort). Tunnels are created by software (in Linux it is the Thunderbolt driver) and are dynamic in nature. The USB4 links go over USB Type-C cable which also is something user can plug/unplug freely. I would say it is reasonable expectation that anything behind these ports can be assumed as "removable". 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 30A6AC433EF for ; Mon, 14 Feb 2022 07:36:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 544DB10E1C0; Mon, 14 Feb 2022 07:36:12 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A8D710E1AF; Mon, 14 Feb 2022 07:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644824170; x=1676360170; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=TtIgUTAIsXJ4XGN4YguPnu9VZqX5t+e944YjPkCfnAQ=; b=iHWvdIoZgHtfCTj4Jhhc+qlls93Fz+d/JUxueLUUn8/tXAy5kpGvPD5m hDk77VZ969/eUntwWODJEVAPujFNLKiqDxzh8UaU5YJeCcUVZ/sm2Qpth O+bu3Ka7g0O0JOAHkEDRNRztD7xpUlF+0hM0Ppv9eEK6G31gy934aZteB DnNNLDen94uiAE/ZJhMk1hku2IFLGZqqMVcufsUP25GtzN2RLCwuL/BWp fihVxxIPBGVZgLlmqxoZAYDGcO3gNivagm1JPAnw54MXBOKCKEtdsM+iC 1mcf98RTRzTXfk5f6oV25/aJKjr1xbuD7JkzLCdz9In4Yl/Eh4rGaQjih A==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="247628391" X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="247628391" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2022 23:36:09 -0800 X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="772875545" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.162]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2022 23:36:04 -0800 Received: by lahna (sSMTP sendmail emulation); Mon, 14 Feb 2022 09:34:26 +0200 Date: Mon, 14 Feb 2022 09:34:26 +0200 From: Mika Westerberg To: Bjorn Helgaas Message-ID: References: <20220211193250.1904843-6-mario.limonciello@amd.com> <20220211214546.GA737137@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220211214546.GA737137@bhelgaas> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Subject: Re: [Nouveau] [PATCH v3 05/12] PCI: Detect root port of internal USB4 devices by `usb4-host-interface` X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andreas Noever , "open list:RADEON and AMDGPU DRM DRIVERS" , Michael Jamet , "open list:PCI SUBSYSTEM" , "open list:THUNDERBOLT DRIVER" , Yehezkel Bernat , "open list:DRM DRIVERS" , Hans de Goede , Mario Limonciello , "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" , Bjorn Helgaas , Alexander.Deucher@amd.com Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" Hi Bjorn, On Fri, Feb 11, 2022 at 03:45:46PM -0600, Bjorn Helgaas wrote: > On Fri, Feb 11, 2022 at 01:32:43PM -0600, Mario Limonciello wrote: > > The root port used for PCIe tunneling should be marked as removable to > > ensure that the entire chain is marked removable. > > > > This can be done by looking for the device property specified in > > the ACPI tables `usb4-host-interface`. > > > > Suggested-by: Mika Westerberg > > Link: https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports#mapping-native-protocols-pcie-displayport-tunneled-through-usb4-to-usb4-host-routers > > Signed-off-by: Mario Limonciello > > --- > > drivers/pci/pci-acpi.c | 10 ++++++++++ > > drivers/pci/pci.h | 5 +++++ > > drivers/pci/probe.c | 1 + > > 3 files changed, 16 insertions(+) > > > > diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c > > index a42dbf448860..6368e5633b1b 100644 > > --- a/drivers/pci/pci-acpi.c > > +++ b/drivers/pci/pci-acpi.c > > @@ -1391,6 +1391,16 @@ void pci_acpi_cleanup(struct device *dev, struct acpi_device *adev) > > } > > } > > > > +bool pci_acpi_is_usb4(struct pci_dev *dev) > > +{ > > + struct acpi_device *adev = ACPI_COMPANION(&dev->dev); > > + > > + if (!adev) > > + return false; > > + return fwnode_property_present(acpi_fwnode_handle(adev), > > + "usb4-host-interface"); > > Maybe it's obvious to everybody but me that "USB4" means this device > is removable. The Microsoft reference above doesn't say anything > about removability. > > My expectation is that "USB" (like "PCI" and "PCIe") tells me > something about how a device is electrically connected and how > software can operate it. It doesn't really tell me anything about > whether those electrical connections are permanent, made through an > internal slot, or made through an external connector and cable. It is used to identify "tunneled" ports (whether PCIe, USB 3.x or DisplayPort). Tunnels are created by software (in Linux it is the Thunderbolt driver) and are dynamic in nature. The USB4 links go over USB Type-C cable which also is something user can plug/unplug freely. I would say it is reasonable expectation that anything behind these ports can be assumed as "removable". 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 B2028C433EF for ; Mon, 14 Feb 2022 07:36:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DFD8410E1AF; Mon, 14 Feb 2022 07:36:10 +0000 (UTC) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A8D710E1AF; Mon, 14 Feb 2022 07:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644824170; x=1676360170; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=TtIgUTAIsXJ4XGN4YguPnu9VZqX5t+e944YjPkCfnAQ=; b=iHWvdIoZgHtfCTj4Jhhc+qlls93Fz+d/JUxueLUUn8/tXAy5kpGvPD5m hDk77VZ969/eUntwWODJEVAPujFNLKiqDxzh8UaU5YJeCcUVZ/sm2Qpth O+bu3Ka7g0O0JOAHkEDRNRztD7xpUlF+0hM0Ppv9eEK6G31gy934aZteB DnNNLDen94uiAE/ZJhMk1hku2IFLGZqqMVcufsUP25GtzN2RLCwuL/BWp fihVxxIPBGVZgLlmqxoZAYDGcO3gNivagm1JPAnw54MXBOKCKEtdsM+iC 1mcf98RTRzTXfk5f6oV25/aJKjr1xbuD7JkzLCdz9In4Yl/Eh4rGaQjih A==; X-IronPort-AV: E=McAfee;i="6200,9189,10257"; a="247628391" X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="247628391" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2022 23:36:09 -0800 X-IronPort-AV: E=Sophos;i="5.88,367,1635231600"; d="scan'208";a="772875545" Received: from lahna.fi.intel.com (HELO lahna) ([10.237.72.162]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2022 23:36:04 -0800 Received: by lahna (sSMTP sendmail emulation); Mon, 14 Feb 2022 09:34:26 +0200 Date: Mon, 14 Feb 2022 09:34:26 +0200 From: Mika Westerberg To: Bjorn Helgaas Subject: Re: [PATCH v3 05/12] PCI: Detect root port of internal USB4 devices by `usb4-host-interface` Message-ID: References: <20220211193250.1904843-6-mario.limonciello@amd.com> <20220211214546.GA737137@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220211214546.GA737137@bhelgaas> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andreas Noever , "open list:RADEON and AMDGPU DRM DRIVERS" , Michael Jamet , "open list:PCI SUBSYSTEM" , "open list:THUNDERBOLT DRIVER" , Yehezkel Bernat , "open list:DRM DRIVERS" , Hans de Goede , Mario Limonciello , "open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS" , Bjorn Helgaas , Alexander.Deucher@amd.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Bjorn, On Fri, Feb 11, 2022 at 03:45:46PM -0600, Bjorn Helgaas wrote: > On Fri, Feb 11, 2022 at 01:32:43PM -0600, Mario Limonciello wrote: > > The root port used for PCIe tunneling should be marked as removable to > > ensure that the entire chain is marked removable. > > > > This can be done by looking for the device property specified in > > the ACPI tables `usb4-host-interface`. > > > > Suggested-by: Mika Westerberg > > Link: https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports#mapping-native-protocols-pcie-displayport-tunneled-through-usb4-to-usb4-host-routers > > Signed-off-by: Mario Limonciello > > --- > > drivers/pci/pci-acpi.c | 10 ++++++++++ > > drivers/pci/pci.h | 5 +++++ > > drivers/pci/probe.c | 1 + > > 3 files changed, 16 insertions(+) > > > > diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c > > index a42dbf448860..6368e5633b1b 100644 > > --- a/drivers/pci/pci-acpi.c > > +++ b/drivers/pci/pci-acpi.c > > @@ -1391,6 +1391,16 @@ void pci_acpi_cleanup(struct device *dev, struct acpi_device *adev) > > } > > } > > > > +bool pci_acpi_is_usb4(struct pci_dev *dev) > > +{ > > + struct acpi_device *adev = ACPI_COMPANION(&dev->dev); > > + > > + if (!adev) > > + return false; > > + return fwnode_property_present(acpi_fwnode_handle(adev), > > + "usb4-host-interface"); > > Maybe it's obvious to everybody but me that "USB4" means this device > is removable. The Microsoft reference above doesn't say anything > about removability. > > My expectation is that "USB" (like "PCI" and "PCIe") tells me > something about how a device is electrically connected and how > software can operate it. It doesn't really tell me anything about > whether those electrical connections are permanent, made through an > internal slot, or made through an external connector and cable. It is used to identify "tunneled" ports (whether PCIe, USB 3.x or DisplayPort). Tunnels are created by software (in Linux it is the Thunderbolt driver) and are dynamic in nature. The USB4 links go over USB Type-C cable which also is something user can plug/unplug freely. I would say it is reasonable expectation that anything behind these ports can be assumed as "removable".