From patchwork Fri Feb 11 19:32:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12743810 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 2D1DCC433EF for ; Fri, 11 Feb 2022 19:35:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 20A6910EB0F; Fri, 11 Feb 2022 19:35:14 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2077.outbound.protection.outlook.com [40.107.220.77]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5282010EAFE; Fri, 11 Feb 2022 19:35:10 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MO/PdqVF9DEgSaIfkcSjEdf6+71zCNpyF6hq72JKWspse1FwsqwnNf1ipPuWQimHlT4YKij5lij9T8BOu+izzF4kf/8fiBds44br/gFAu+6GjALEn0fXtV/F63ay0LjDwnGqQcEWBo9xxgLCMlLNCZKUC9MHm8nVxqxmkM1DREo7x6jfo/zIFQqZSGLMVHAlHa7zsA9R5WsId9I6jujCUJe4wDcOpk5mRxQrMXW8C8NtfMrGzlPeREecjO8iKJ9KWxmzqCJ3mKzjNE5wsv+qa70qtas1dj51vwEA4eK88ZauBn3YmeP2nG3Z3v9v1t7xYmsIln9JJsO0IvnI55+lkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qpI5Xy+GcTJMt/Vmrooq7MpFhVOKwe9xhlaC3EvijRo=; b=OdgId7VdP7rPsGzIPgvv9ILCz8Bd8cfgnxbLfa6LUcGQw1RnbvJHUZnsuTdhqg8IqTvIiT2lKQrMMf+tqVcSNIfXiBkQGT1SM6qjpNPip+AH0D4/V8KEU36dSyrE2ESTTFi6NxKuuKCW/TdIVUqw6IabGLiFH8N0va+kof1oqZpNaR9C9HUrVXUYDwsHRdsDszj9hnDWheHnx0Nyb0ymXs4X1iqQBc8xOldDt7QiilJK3E8KzXDTz+5qHsqPmPoeeCrCk8PlVyN9BgM+wa8pBB+gjGcZ+uzlhGZMrIodaDsqky/xgiWnwCoZk2Ue+BBN10rsG27gmdcaqwD2f1zSsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qpI5Xy+GcTJMt/Vmrooq7MpFhVOKwe9xhlaC3EvijRo=; b=3RDUupwvtlcbN2SO1EV1B6+azmn3aAaBQ6fjv6/1WMmGxoKc6HrZpmr3Mvv9EF72WBiQG6Xnnl4HZ2CslkExvlE1t/8q7mOSkTQgx4yuOE0nSz5DvVhdhLRQ+ER6js+TxjBuOkfhKnKwqg5X/9F9IPrJGn9NqzkA1sJ3SGhinqQ= Received: from DS7PR03CA0228.namprd03.prod.outlook.com (2603:10b6:5:3ba::23) by DM5PR12MB1433.namprd12.prod.outlook.com (2603:10b6:3:73::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.15; Fri, 11 Feb 2022 19:35:07 +0000 Received: from DM6NAM11FT027.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3ba:cafe::20) by DS7PR03CA0228.outlook.office365.com (2603:10b6:5:3ba::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Fri, 11 Feb 2022 19:35:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT027.mail.protection.outlook.com (10.13.172.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:06 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 11 Feb 2022 13:35:05 -0600 From: Mario Limonciello To: 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" Subject: [PATCH v3 01/12] thunderbolt: move definition of PCI_CLASS_SERIAL_USB_USB4 Date: Fri, 11 Feb 2022 13:32:39 -0600 Message-ID: <20220211193250.1904843-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211193250.1904843-1-mario.limonciello@amd.com> References: <20220211193250.1904843-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39e683f8-bf9d-475d-188c-08d9ed959bdc X-MS-TrafficTypeDiagnostic: DM5PR12MB1433:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yGO1zUtB1IfAJOibPkDKYeJQgnDIUvN8xlhG9Mib0rY0xg9eBMQwy8XP8OdGjeqHKwShmKG+t3xc6OsS2WvsDs5066NBHjFbffzF2H0NwN7kTyrbiWrx1T9VgiR0PuEe76mrFDmPfR5HrE0Yd1AZb/l1YtrAhfGudRV0Cbx/QSYbq7w3CIkydiwq+XHcLznfp1QCTZx9h+TTFEXrW7dRNwoPWZ46io3ckLcFuA1i5+nYHIP0iHbYtnaqStAMwvaeRsoVVTFGwDjbSDFiedza9uD4Yn3nXJ9NSyJ7OPU67dK981BbERWCB+B4rtP7RZd86J9gt2p4J4adhEh4elpRrJEsvBCEE7h6bcZKAhG6vM2dvPZ/XYRLT9OC9JibJ84uqbvopJFScMxFrclDCRpWGgf5qQwZP2K/2kdJsFCSLz1JIvtSXCnN1bx6gRtmCNfrsXxc3CkafBQlFBfYv4ng+XFANKSqifG0NvtEWrDnUAh4I/Kelx34Wd7HEbmRKna9rBM+1O3EmLGfOZInxNniV4JsAJOKsiRzYyxKrE3tQZQb9HcjEe3VxvVuOsgxRNInkjOyqkoaIeyJhA24bRDQI1EQshJ6LHCbJ2QHDJZhXXL97O/iovM0K7Lmz4l0cMqqEhpy+HJiSq/ssS7TZWk5GzHMtkKx9K924eHeh7rgpRpylOozD5zf9RJ6Tfkbra5tMr1XRXr63C4Qot9/WfKrzg== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(36860700001)(82310400004)(47076005)(40460700003)(86362001)(2906002)(54906003)(110136005)(316002)(356005)(81166007)(70586007)(8676002)(70206006)(4326008)(44832011)(6666004)(83380400001)(508600001)(8936002)(7416002)(5660300002)(2616005)(426003)(336012)(36756003)(26005)(16526019)(186003)(1076003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 19:35:06.9344 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39e683f8-bf9d-475d-188c-08d9ed959bdc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT027.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1433 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: Hans de Goede , Michael Jamet , Yehezkel Bernat , Alex Deucher , Mario Limonciello , Andreas Noever Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This PCI class definition of the USB4 device is currently located only in the thunderbolt driver. It will be needed by a few other drivers for upcoming changes. Move it into the common include file. Acked-by: Alex Deucher Acked-by: Mika Westerberg Signed-off-by: Mario Limonciello Acked-by: Bjorn Helgaas --- drivers/thunderbolt/nhi.h | 2 -- include/linux/pci_ids.h | 1 + 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/thunderbolt/nhi.h b/drivers/thunderbolt/nhi.h index 69083aab2736..79e980b51f94 100644 --- a/drivers/thunderbolt/nhi.h +++ b/drivers/thunderbolt/nhi.h @@ -81,6 +81,4 @@ extern const struct tb_nhi_ops icl_nhi_ops; #define PCI_DEVICE_ID_INTEL_TGL_H_NHI0 0x9a1f #define PCI_DEVICE_ID_INTEL_TGL_H_NHI1 0x9a21 -#define PCI_CLASS_SERIAL_USB_USB4 0x0c0340 - #endif diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index aad54c666407..61b161d914f0 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -116,6 +116,7 @@ #define PCI_CLASS_SERIAL_USB_OHCI 0x0c0310 #define PCI_CLASS_SERIAL_USB_EHCI 0x0c0320 #define PCI_CLASS_SERIAL_USB_XHCI 0x0c0330 +#define PCI_CLASS_SERIAL_USB_USB4 0x0c0340 #define PCI_CLASS_SERIAL_USB_DEVICE 0x0c03fe #define PCI_CLASS_SERIAL_FIBER 0x0c04 #define PCI_CLASS_SERIAL_SMBUS 0x0c05 From patchwork Fri Feb 11 19:32:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12743809 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 9F30FC433EF for ; Fri, 11 Feb 2022 19:35:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9C49F10EAFD; Fri, 11 Feb 2022 19:35:10 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2071.outbound.protection.outlook.com [40.107.94.71]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5C23B10EAFD; Fri, 11 Feb 2022 19:35:09 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eqgyUeuNJOuZR8R2o8skyayFRJLk9UYn6dyYFYleqFuqSAWrEkapnZpR2qxORlreAdFIYtSD0+lrn0/uCXkg7d9e/bje3vvM/3FeX5J6j5UIDxQTCSNCwjjVI/zyGAfpL8z8OTENdfOPKwXD3VlWKGKOd4XJl15Drajy07JvLXHTID1JBIwVG6o7OAnGV57MSFsHYwPbY07s6s7oMtHooHhFIz+E7MYNmn+RbckIWcWPMtPYufY+C9KrVdvSvi84SoMKgU4jCq1uZn6dvjDS0BxQ6JMy6vZjzrCkc+2gOwtL6XgB+wL/S0+oQXrOQhW7kP5zwGQ5A7rXzlSR+1L12g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ePYmeTfI1tYVdV1YQeEXeXNbHxPMCjFPOZ6uOCDxB6I=; b=XcAmQnh7kNxSHo5Mr1Tv+DZBwFbKif+ly8UMNmY6PWAZf2BOy7N4xy6ofjXRPv7UDB+PzT/hYLfjWui7rsUllLr1mXlDmOulkLafPTnTjytBbXZcVZ0rNvY33+FrQtmMObLR6sgjR8piqqhrX9IE2RjE7N8yRE/321c8PJiGwdewUlCh4c3rMQQp23J1h0q/Szyb+rJgtACzPspH5Sh+G+J001wxrS3HMXezpdreK1oQaSBoJINiYzOH43kP2j4MdkAfB4oniXxCfBxcm+NAYH3xFCJD+z3+FObd0GVGBUhX80A2uQjY7Ruy/tlPZdrWAN2kwl370A+okjdxEpAwcw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ePYmeTfI1tYVdV1YQeEXeXNbHxPMCjFPOZ6uOCDxB6I=; b=XxPcVvoIDbmOWzW/abRhedRrDzA3tdz972YllOh7w/lzi23X7dfHUzkwGbSFTEs3NfiY63s43KuUBDiODD95rxniHmYuQnKAsPn9FP3bISXbaTfEd7niPknk/rmdZ0wNffK0bs82hdeNq6HVtsO7xmrwAtjwreddZ+DaRcO55aI= Received: from DS7PR03CA0220.namprd03.prod.outlook.com (2603:10b6:5:3ba::15) by CH0PR12MB5058.namprd12.prod.outlook.com (2603:10b6:610:e1::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Fri, 11 Feb 2022 19:35:07 +0000 Received: from DM6NAM11FT027.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3ba:cafe::b1) by DS7PR03CA0220.outlook.office365.com (2603:10b6:5:3ba::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT027.mail.protection.outlook.com (10.13.172.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:07 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 11 Feb 2022 13:35:06 -0600 From: Mario Limonciello To: 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" Subject: [PATCH v3 02/12] PCI: Move `is_thunderbolt` check for lack of command completed to a quirk Date: Fri, 11 Feb 2022 13:32:40 -0600 Message-ID: <20220211193250.1904843-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211193250.1904843-1-mario.limonciello@amd.com> References: <20220211193250.1904843-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c92e5b04-b49a-43dc-d8f4-08d9ed959c1e X-MS-TrafficTypeDiagnostic: CH0PR12MB5058:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1186; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mdzZ/RjbW62UNak3aBwfT8a7fMLD484/FVPQLhx5nyUBN3phhe75osDN5pTksUtnwlR8qrq/oxumryyxP2zeVFThDw/eDjnne5tQypgRFde+vVJ88FP9v1d4e4yHJxof/EHm5/Wk8Pv+r0/qGnUXgKf/g5R9wr2UuVahh9BRYOpL9HzXN6+8Z/elRyvag35IcSUU+kHwqXAYBXRCbb+c/zqGz6pMxS+fbcRRVGrig1H+gPkr/NqgNy84q19kj8JFfjNvfv1XpojwKkgPimqgjEu44jQ01UMY/c2yN/TkpFzhgl51STYa4fD59rDdscOZe7XORz35G4TZPS5voJF+2+SFt8nSkuINj8tqa8XOm54mFexkRvVGreWLHVm4CTHUHMP8/DwCrAXiYLTbMIWjhyZwoutvMpQ/bawqswzHF6guReLUXvbjNUlq88HHcgrbsfDwUo1vmkoqEEGjnAB7mqI5HwTEPNE6kI4q3QIoXoypbBN4CXN5u2RgIx+KIyoeEe6j3nyFacRo7m3RdLGsSrJJetgnINL3AUQdQCumJYb/pVNilzAduXbRD12pNkK6bcUHMJpCnr8vl3GcmlMe8ZheGwYVEhtIEzvgC9/5kO9B2xRETz3+DRO5OY2iV599kXJCWRWHxlKLKInBaAZ2NJFccIY8PAmg2LcPKx83tYo2s2U+OhVMRZAHCPuMweX2FyvxAX2MxWBSFioibg/8ERpkz3LsecZVNz5156w4R/k= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(54906003)(16526019)(110136005)(426003)(8936002)(336012)(186003)(70206006)(316002)(82310400004)(70586007)(86362001)(8676002)(4326008)(26005)(2616005)(81166007)(356005)(1076003)(508600001)(83380400001)(6666004)(2906002)(36756003)(36860700001)(40460700003)(47076005)(44832011)(5660300002)(7416002)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 19:35:07.3719 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c92e5b04-b49a-43dc-d8f4-08d9ed959c1e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT027.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5058 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: Hans de Goede , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Mario Limonciello , Andreas Noever Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The `is_thunderbolt` check is currently used to indicate the lack of command completed support for a number of older Thunderbolt devices. This however is heavy handed and should have been done via a quirk. Move the affected devices outlined in commit 493fb50e958c ("PCI: pciehp: Assume NoCompl+ for Thunderbolt ports") into pci quirks. Suggested-by: Lukas Wunner Signed-off-by: Mario Limonciello --- drivers/pci/hotplug/pciehp_hpc.c | 6 +----- drivers/pci/quirks.c | 17 +++++++++++++++++ include/linux/pci.h | 2 ++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 1c1ebf3dad43..e4c42b24aba8 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -996,11 +996,7 @@ struct controller *pcie_init(struct pcie_device *dev) if (pdev->hotplug_user_indicators) slot_cap &= ~(PCI_EXP_SLTCAP_AIP | PCI_EXP_SLTCAP_PIP); - /* - * We assume no Thunderbolt controllers support Command Complete events, - * but some controllers falsely claim they do. - */ - if (pdev->is_thunderbolt) + if (pdev->no_cmd_complete) slot_cap |= PCI_EXP_SLTCAP_NCCS; ctrl->slot_cap = slot_cap; diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index d2dd6a6cda60..6d3c88edde00 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3675,6 +3675,23 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PORT_RIDGE, quirk_thunderbolt_hotplug_msi); +static void quirk_thunderbolt_command_completed(struct pci_dev *pdev) +{ + pdev->no_cmd_complete = 1; +} +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LIGHT_RIDGE, + quirk_thunderbolt_command_completed); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EAGLE_RIDGE, + quirk_thunderbolt_command_completed); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LIGHT_PEAK, + quirk_thunderbolt_command_completed); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C, + quirk_thunderbolt_command_completed); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_2C, + quirk_thunderbolt_command_completed); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PORT_RIDGE, + quirk_thunderbolt_command_completed); + #ifdef CONFIG_ACPI /* * Apple: Shutdown Cactus Ridge Thunderbolt controller. diff --git a/include/linux/pci.h b/include/linux/pci.h index 8253a5413d7c..1e5b769e42fc 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -443,6 +443,8 @@ struct pci_dev { unsigned int is_hotplug_bridge:1; unsigned int shpc_managed:1; /* SHPC owned by shpchp */ unsigned int is_thunderbolt:1; /* Thunderbolt controller */ + unsigned int no_cmd_complete:1; /* Lies about command completed events */ + /* * Devices marked being untrusted are the ones that can potentially * execute DMA attacks and similar. They are typically connected From patchwork Fri Feb 11 19:32:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12743811 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 8269EC4332F for ; Fri, 11 Feb 2022 19:35:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B523310EB14; Fri, 11 Feb 2022 19:35:15 +0000 (UTC) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam08on2055.outbound.protection.outlook.com [40.107.100.55]) by gabe.freedesktop.org (Postfix) with ESMTPS id 183D310EB04; Fri, 11 Feb 2022 19:35:11 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TW5r8QoeSaCPltn23XnhDIIWNRx/L9To5JdOgcYLC7nsV28DbYMERfd613ZbFmTfB1QD3JteuyzgZSkI7klC+dVAk+56A7PKcV+CgbHxQ6hAjRU8/g9VGYUrEQSJOyI/l6IjrmSZYPYb6SBzOjJqF8eWhlW8E8OCDOOkMgnF3l8693lF3e0x1RvbltBDMRplYLboV+K4rA4Gi7jRsXvMkdRC9tqwACH1W4ULEh7x9riJhn4Iw6MVEebemwKmLlk7iWLt/+xUsY5W3F1SF2TzTBBu43QTqUsIR4ost8fpH/r8xO4iZQ8RuVtzYNhNbv6jy8jyiPa+s974cVyqI5NaCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hGyUiNfNmLcYoL5Uja9mwPpAddDiKgLKFIYAV9pVhbQ=; b=NqCRAU/1jRNf/ZqWyxshQ4chkCqa5NhuGbu/UZ37Kb/gdv3aF28UikN15s+4n0SY24ADJfyDSZwHaeBHL8BqP+G4qEBUguXaM8FIyKSaxLUEx0soVL6LaH5Q3ervCCCUYKvBiKX2oN3/yK8mbJbUpTDgeQmKk/xKEBGnXc+P+nfPC6XrsCxlmvqyVgL8uT3hAfbQ/6hqCKkqggXWREW3HJgpFaWUKMBI5zGVCmzO/jPHzH8mut9q65DoFBFI7xpqts+6WIXukx9axZFTXudL3ATGSR80GIr9xUeijgwpR6eNLHwtkTlsTr4jVn6sJmQ1JAy/ROB3X7TFcabmuBsD6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hGyUiNfNmLcYoL5Uja9mwPpAddDiKgLKFIYAV9pVhbQ=; b=A2jXLulWTFcnzg0gvkgIWuUpAPUn9WliJsEVXJZpMS8m9555ZyOUTRmoPmeqmC23Ad031HVQ2Jh/to/cgX7i09y4rPFReYM33YhPdpHv8JwrHl24Bwd6tw6ZIuIpH5NcnTbkGufLZaEmtUdUpD962GbWUJPClLNUrRhSP0LC8Ik= Received: from DS7PR07CA0008.namprd07.prod.outlook.com (2603:10b6:5:3af::21) by DM6PR12MB3290.namprd12.prod.outlook.com (2603:10b6:5:189::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Fri, 11 Feb 2022 19:35:08 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3af:cafe::91) by DS7PR07CA0008.outlook.office365.com (2603:10b6:5:3af::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.13 via Frontend Transport; Fri, 11 Feb 2022 19:35:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:08 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 11 Feb 2022 13:35:07 -0600 From: Mario Limonciello To: 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" Subject: [PATCH v3 03/12] PCI: Move check for old Apple Thunderbolt controllers into a quirk Date: Fri, 11 Feb 2022 13:32:41 -0600 Message-ID: <20220211193250.1904843-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211193250.1904843-1-mario.limonciello@amd.com> References: <20220211193250.1904843-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cbd1c42b-6738-41c1-d280-08d9ed959c92 X-MS-TrafficTypeDiagnostic: DM6PR12MB3290:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GtlV3h22rJ89fBat8QtlMIQVq7SDAirecTqFKMOykUyoV3pDlnKT6Uu02VSom4Djsfnxpe2lYs6EAHqAoPRt6XfP8VuzhRvv5NY2iXaAkBcJLqkHdAegUXg7WZ7w+44l73+kWI1EsiDVB9FEEI6wRHfQLYnqJOFpbyntj9IukKe8ZQnH+LnMu/VbKgl1dSuOrLDvPdUBqfMsLm3PbCfVFCNGwIDDSfib6XKHWQjbPX3B4iGkKW91tjx6TPuUmkK1k/K0MGQrxr8EnCj3zF5sZ7RHu5MmQNfQvI8UmTMPExXBvJUUdDMkER4s6AIFu7jj95Xrk9ahZGVfO/jXC3ieI7H4Ezq85T+xTqRKhOBX6Diy1QW6wXRxXg+aGpI7kC1WhEGUDbKNVR0Oe8BZUvwGXkE6iWBbbNWlG2u8nax2RrIKLxsRKTixF3CSlQu7g6WH7LxR5OzFOFxlvbDIOI3Gz0vds2Fmm0aLaJmzks9GdNFldLPOnOnLY53CZe2dXSJsG/47YiiUJDJpqGD2I9RLLw9xtMxDm6EavqnG1jz6dsUyoQN3UdqeOzBq9FPpH/eHKkl2F3vXsZX+HifWQyUNvKbn9BjzUhhqYVvsjwaAWspYnvtyEKjINVaIzUMQbS29kUrVHrYgbvHt8RPPVILSceEJjBlszOcKpspGNHbcQDmGEUqvGSxBRjNfhXh4qnu3kgXC5plhExxvpO2b41BIRL7eo4SusYGZiZA1wEbMI9IaQ663G9bZGzSFv7/1M498 X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(47660400002)(40470700004)(36840700001)(46966006)(36860700001)(508600001)(82310400004)(6666004)(47076005)(83380400001)(2906002)(316002)(8936002)(4326008)(19627235002)(8676002)(70206006)(70586007)(5660300002)(54906003)(40460700003)(36756003)(86362001)(16526019)(7416002)(356005)(336012)(26005)(186003)(1076003)(426003)(2616005)(81166007)(110136005)(44832011)(46800400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 19:35:08.1320 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cbd1c42b-6738-41c1-d280-08d9ed959c92 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3290 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: Hans de Goede , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Mario Limonciello , Andreas Noever Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" `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. Suggested-by: Mika Westerberg Signed-off-by: Mario Limonciello --- drivers/pci/pci.c | 12 +++++----- drivers/pci/quirks.c | 53 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 9ecce435fb3f..5002e214c9a6 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1064,7 +1064,13 @@ static inline bool platform_pci_bridge_d3(struct pci_dev *dev) if (pci_use_mid_pm()) return false; - return acpi_pci_bridge_d3(dev); + if (acpi_pci_bridge_d3(dev)) + return true; + + if (device_property_read_bool(&dev->dev, "HotPlugSupportInD3")) + return true; + + return false; } /** @@ -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; diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 6d3c88edde00..aaf098ca7d54 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3756,6 +3756,59 @@ DECLARE_PCI_FIXUP_SUSPEND_LATE(PCI_VENDOR_ID_INTEL, quirk_apple_poweroff_thunderbolt); #endif +/* Apple machines as old as 2010 can do D3 with Thunderbolt controllers, but don't specify + * it in the ACPI tables + */ +static void quirk_apple_d3_thunderbolt(struct pci_dev *dev) +{ + struct property_entry properties[] = { + PROPERTY_ENTRY_BOOL("HotPlugSupportInD3"), + {}, + }; + + if (!x86_apple_machine) + return; + + if (device_create_managed_software_node(&dev->dev, properties, NULL)) + pci_warn(dev, "could not add HotPlugSupportInD3 property"); +} +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LIGHT_RIDGE, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_EAGLE_RIDGE, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_LIGHT_PEAK, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_4C, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CACTUS_RIDGE_2C, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PORT_RIDGE, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_REDWOOD_RIDGE_2C_NHI, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_REDWOOD_RIDGE_2C_BRIDGE, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_REDWOOD_RIDGE_4C_NHI, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_REDWOOD_RIDGE_4C_BRIDGE, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FALCON_RIDGE_2C_NHI, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FALCON_RIDGE_2C_BRIDGE, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_NHI, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FALCON_RIDGE_4C_BRIDGE, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_NHI, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_2C_BRIDGE, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_4C_NHI, + quirk_apple_d3_thunderbolt); +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ALPINE_RIDGE_4C_BRIDGE, + quirk_apple_d3_thunderbolt); + /* * Following are device-specific reset methods which can be used to * reset a single function if other methods (e.g. FLR, PM D0->D3) are From patchwork Fri Feb 11 19:32:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12743815 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 8FDF8C433F5 for ; Fri, 11 Feb 2022 19:35:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A6B0110EB11; Fri, 11 Feb 2022 19:35:18 +0000 (UTC) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2060.outbound.protection.outlook.com [40.107.95.60]) by gabe.freedesktop.org (Postfix) with ESMTPS id DAEA010EAFE; Fri, 11 Feb 2022 19:35:10 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i9iKGUx3rvrnz6oNlc/u3UXx/GDjdTtxVSZ8eaxFzgAm9t3ShyWOcwksBsi8enMxL3bgj3VqnjfGUInAwfTh+CCFxMwaVhnys6ZRTfcvzZPmkURwA5KubnmPKgV5xudAhVotmdxmhpX6U5KQAvEC6dIDnb2RH+ALhCpK0/upBfl3wL901mL+D0N8+Q6dLQm7YNmsL+0MkgL2x+DWJF5LQOQBzQkjoM1EXynpmZh3kKWlb93NlpcS2QgLxjOiO35k6HfMB1tnmSmME5IV45lfH9MhkUAPyf+Z6TcWyv0DDxasae4RtHGJtgo8oo3eMVg0ZyadOXFXQ/+24GfKo1IoCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4GInF+4jDPMzFbvC2bfL1BskZl6bC44vdJYSXzUx0z0=; b=SntlumdgxgCSHksDUJJQ/BVPFv4CXnc9gj0kV1MDXeT9xLxMlb0RQK8ufmlJo4PXZZR8ho3ql2h91Sl9Yd50aYXuSgBFOcGZwXh9/c37ur76djgakm2JLZQVIgluofKP+ohMH9SgjPckMnd4jiNpDpHn9Oa/C5xtHujJwp75eVtDVx0X2Yt4chK2l6iSDW7mBMrtsxNdxl3GGPDm9x5XqMMFbsBiSa+RgKMkebr7aasegeM2ErajyVYJhd8jNbKytaNMHd8yYMNsJSUixWTfP7G05MYG15M7Z+CVRh5jcTBTKc5rwnLtPXg+gKALafMZemZQayd+gew2mOS3TQK6Ug== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4GInF+4jDPMzFbvC2bfL1BskZl6bC44vdJYSXzUx0z0=; b=eXpWv9eGQg9p0n6AOlVl2dVrxLeMuNJgjVDi/JaqFO0X6wz6zwAlitUl2o7MgbsDjL8q9vvOFVem0B9aM3+2HJWOigGr7QiiaeoOXV9iARz4MWBrvtnVMEGy6mvzw0Vwvzg4D3EgMvCXlLBnZeSgVSnD0uvLxhUtXxxMc4WeWcA= Received: from DS7PR07CA0022.namprd07.prod.outlook.com (2603:10b6:5:3af::24) by DM4PR12MB5745.namprd12.prod.outlook.com (2603:10b6:8:5c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.18; Fri, 11 Feb 2022 19:35:08 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3af:cafe::da) by DS7PR07CA0022.outlook.office365.com (2603:10b6:5:3af::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:08 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 11 Feb 2022 13:35:07 -0600 From: Mario Limonciello To: 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" Subject: [PATCH v3 04/12] PCI: Drop the `is_thunderbolt` attribute from PCI core Date: Fri, 11 Feb 2022 13:32:42 -0600 Message-ID: <20220211193250.1904843-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211193250.1904843-1-mario.limonciello@amd.com> References: <20220211193250.1904843-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4b8b486b-4acb-47db-b8f2-08d9ed959cdc X-MS-TrafficTypeDiagnostic: DM4PR12MB5745:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0bJNmPIYuNM79xTB0p+neeUTrYXkI+rPUgAfPV8z4egujRWJX28CosLYVdpyxnp5hEMr4S4U+rseaKZBLs0XAn8wiX2xDMWQhW0I8gXUCvOpbdJ9S7jLs1SyCfIz9LRVk3x+EIfh1FrPzs1d8ZohDUxw4so++dh1Np+kYdm05HV9878zIDNeUKTVSy61/P9fuAnxZ8eu/3tVFokn0qizro4BAZ6S/u6wSOBZ2Rgj5qMnOj92YrfCVGCruw8GbPzDLJ8AkJuLlkydrwQRYXIUPb2fhLYDWLYJ/CR9OB9eZ4fh7NRUl056sfBZPCLMuDIQnPWPwA30pliEGvu8HftzIr3uxzE2qrV15Fe/4zf41qGAbZqb6l6JZdyz8ZGMKHy+zQZwVXlBOLVn8erG3a2euhAU0F4kz9tGjXi/0SyR2n5KQxI0Saf5glUeldIgAJKdBNABPIJOAiUSTPdi+2zB128YsnO1RUDlptK8Pbwc0b+bwTpNxmfGPOF2nHfYETsfUdxJpoQF3MwSdpUTqm3BEM63dPe0wq2UXdE9ztI/CTmSstJf6CzbipWBMWx7/HQautvY7V43Z5mGzqDasBZLSMQIHM5MLZUQnWVFKWuQC1yIOphKlnU0FMSlQQ68EUwVU0UxZXIPpjWU0v55cRA8I8tEqYuSmFB+SRbxiBcu6MYch67D0smLHmOvs9zCbpoPgVoJIc6vp2mDcRnM5MTtFmhawXEQVL7KoJ0I6FVNzBM= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(82310400004)(5660300002)(54906003)(508600001)(356005)(86362001)(316002)(6666004)(36860700001)(8936002)(81166007)(47076005)(426003)(186003)(40460700003)(83380400001)(70586007)(70206006)(2616005)(7416002)(16526019)(1076003)(26005)(8676002)(44832011)(2906002)(110136005)(36756003)(336012)(4326008)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 19:35:08.6319 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b8b486b-4acb-47db-b8f2-08d9ed959cdc X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5745 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: Hans de Goede , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Mario Limonciello , Andreas Noever Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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/probe.c | 20 +++++++------------- drivers/platform/x86/apple-gmux.c | 2 +- include/linux/pci.h | 5 ++--- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 17a969942d37..e41656cdd8f0 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1577,16 +1577,6 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev) pdev->is_hotplug_bridge = 1; } -static void set_pcie_thunderbolt(struct pci_dev *dev) -{ - u16 vsec; - - /* Is the device part of a Thunderbolt controller? */ - vsec = pci_find_vsec_capability(dev, PCI_VENDOR_ID_INTEL, PCI_VSEC_ID_INTEL_TBT); - if (vsec) - dev->is_thunderbolt = 1; -} - static void set_pcie_untrusted(struct pci_dev *dev) { struct pci_dev *parent; @@ -1603,6 +1593,10 @@ static void set_pcie_untrusted(struct pci_dev *dev) static void pci_set_removable(struct pci_dev *dev) { struct pci_dev *parent = pci_upstream_bridge(dev); + u16 vsec; + + /* Is the device a Thunderbolt controller? */ + vsec = pci_find_vsec_capability(dev, PCI_VENDOR_ID_INTEL, PCI_VSEC_ID_INTEL_TBT); /* * We (only) consider everything downstream from an external_facing @@ -1615,8 +1609,9 @@ static void pci_set_removable(struct pci_dev *dev) * accessible to user / may not be removed by end user, and thus not * exposed as "removable" to userspace. */ - if (parent && - (parent->external_facing || dev_is_removable(&parent->dev))) + if (vsec || + (parent && + (parent->external_facing || dev_is_removable(&parent->dev)))) dev_set_removable(&dev->dev, DEVICE_REMOVABLE); } @@ -1860,7 +1855,6 @@ int pci_setup_device(struct pci_dev *dev) dev->cfg_size = pci_cfg_space_size(dev); /* Need to have dev->cfg_size ready */ - set_pcie_thunderbolt(dev); set_pcie_untrusted(dev); diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index 57553f9b4d1d..04232fbc7d56 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -596,7 +596,7 @@ static int gmux_resume(struct device *dev) static int is_thunderbolt(struct device *dev, void *data) { - return to_pci_dev(dev)->is_thunderbolt; + return pci_is_thunderbolt_attached(to_pci_dev(dev)); } static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) diff --git a/include/linux/pci.h b/include/linux/pci.h index 1e5b769e42fc..d9719eb14654 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -442,7 +442,6 @@ struct pci_dev { unsigned int is_virtfn:1; unsigned int is_hotplug_bridge:1; unsigned int shpc_managed:1; /* SHPC owned by shpchp */ - unsigned int is_thunderbolt:1; /* Thunderbolt controller */ unsigned int no_cmd_complete:1; /* Lies about command completed events */ /* @@ -2447,11 +2446,11 @@ static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev) { struct pci_dev *parent = pdev; - if (pdev->is_thunderbolt) + if (dev_is_removable(&pdev->dev)) return true; while ((parent = pci_upstream_bridge(parent))) - if (parent->is_thunderbolt) + if (dev_is_removable(&parent->dev)) return true; return false; From patchwork Fri Feb 11 19:32:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12743812 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 6542BC433EF for ; Fri, 11 Feb 2022 19:35:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EBEF410EB13; Fri, 11 Feb 2022 19:35:16 +0000 (UTC) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2051.outbound.protection.outlook.com [40.107.93.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A93910EB02; Fri, 11 Feb 2022 19:35:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JJHAp1QTmU0914EHx1wivwcgeL+5tdtaBJmvm4TvOJ9MqdPry1Cbo5tdRbNq/RxSVNYPj5+meRCQ30G3sH3wYdfyNhbzEqD7rFgozxp+KFWEcZQd36k5hY8H2rchuMEIfw/laCuRjxMO3mOzojpxT8exTdod+jMjDgQACaMApEzyvfdtTdYqGXVtDbKkQTFRkKDDRNtv8a2I47a8FWL3VZP+Z+VMa1hPayf7fuUDfY+Vq7z9t/uoG3Ps0KvAsfHGB0xngpWxnGGjOfQa86EHY8/9wnvhotTYcJn/7GjkAOM/wEpnaeHjgXP/9rIAraR0ETb39V9d45eOYdCDLPBXIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vIkldd+mSTMirDIwTkL7+B9408OpGjYa1NXGn5+sAX8=; b=FlH1+Q7PtjEPze/EM1cfc8n1SgReT0cKU77cOCD9B372L5P/3ep/pGZUjnByeq6JK/hYFwYN1wSCSYI7RVSEOcX0jIWxYky7bfZLm1B/XDZJXXOcFoK6Jmx5fR1/c0vYhnMLumzJyrGjQgq6wbyVCAOONXnFaHcBCOYObYOhW+uzGQayQ0cDwSThEHaj6sbjo6CUvL3R8jLUTJKV2tmWdkRPDs1srLV0oRJb0Ds7gCHCcrNkeK+IU52FOBMLKoo0G87LBisf0ZytpRgnj9GOkupTXWelO2hAZlowVscpHmMenlwMNCubNq4POc3d0JATJbvQXKZBDVB3VVeZ8xoN7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vIkldd+mSTMirDIwTkL7+B9408OpGjYa1NXGn5+sAX8=; b=achVuAZezkGvig3Mi6+2rYdbkQhhkl59dUKW3tY6Uxr6CNoolebvJ8vkJtCTeZbjzDFsnL0fptJJcfsnPR8Pm+degvcqbxV0k50qoUklJLVHNGdFmIU1SYEU2n+FwcCvmLnNKIKtK/oxyDQvT0v2NwWWwCgZkc4+nqEi4pb9PUQ= Received: from DS7PR07CA0008.namprd07.prod.outlook.com (2603:10b6:5:3af::21) by CH2PR12MB3734.namprd12.prod.outlook.com (2603:10b6:610:2a::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Fri, 11 Feb 2022 19:35:09 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3af:cafe::7b) by DS7PR07CA0008.outlook.office365.com (2603:10b6:5:3af::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.13 via Frontend Transport; Fri, 11 Feb 2022 19:35:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:09 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 11 Feb 2022 13:35:08 -0600 From: Mario Limonciello To: 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" Subject: [PATCH v3 05/12] PCI: Detect root port of internal USB4 devices by `usb4-host-interface` Date: Fri, 11 Feb 2022 13:32:43 -0600 Message-ID: <20220211193250.1904843-6-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211193250.1904843-1-mario.limonciello@amd.com> References: <20220211193250.1904843-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e5cd718b-5a36-46f2-6404-08d9ed959d2b X-MS-TrafficTypeDiagnostic: CH2PR12MB3734:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Agiafcea96UVy7gUXN6a8r6jgp4icQQyx6kmdM6mXKf+dyRpVfjZuQ4dZioc0ZkIucoWsRuCs4XSMGyaVBEQ0D3q2Vlt+Vt5gtpOnhFak883MM7YQgG5qVR3z8TAb5RV66UDGTvHJGvSf1rTDaZuNNXoak/NfnBQBh9Xbk40odhS1DUTNG8d2xXI97Q2ohMp77G2ETEkyPsNUJanCv/WHEecEzI7oxxMnajsfzmmmQwQB1L9TqjVUV7sGFVlzyVKAirnure5AOugk1Nf4YjEKJW1YJiq1VubmPxDlp7mIQML5jdxYQtDcmnMMHKKZFF5AxmQ7pjuWyW6cjkF9PdpPFb7CjahF6zu1jpUcGeZDzMt+Au2S2onK89Yrhh3yREvtgfsZtarXCcxOipyhUXBSUS1uuP331COAmPN84SwDRLqK1dTBoNxaurTsu7RJRScJ5m2Rlt3h40JKJYHFPEK2nh66DQ0NVkNTD8IJLQj6p0mTeNk99mqagC1jSaLWFADhSVl+enFewfxJERGp2AgibBUrTnDX3ZUK6KG9dZ3hSRNHiPZ3jZH8Lw4Amdj8BVkzqZt3ysnAvDu8aF2qm3rs5KI1BS/91e6n1yfNtjk+tGWysNYhQu2MgTF5RXg9HrmSR3MoPWQmn/ZGDFzhBsnhWqJpW1msJhCTRfPrzz8WuDr2QSgXZZSC3nbQLgv2spvHubudXz0vgeHfgyZU13Y0qAYdUgGdd18tNYSDMeHrMnsQ4l6cQ9Lpg+wBisv7Yx9tyUD8PnWCZ7xV3AnsSpISTQs++NOr9yKCTP9Ql9Z9q5oAiEVcz0ZGurnUoL4/D2p X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(26005)(186003)(4326008)(336012)(426003)(70586007)(47076005)(8936002)(16526019)(82310400004)(86362001)(2616005)(7416002)(81166007)(2906002)(8676002)(1076003)(70206006)(36860700001)(356005)(5660300002)(110136005)(36756003)(44832011)(40460700003)(6666004)(966005)(508600001)(316002)(54906003)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 19:35:09.1318 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e5cd718b-5a36-46f2-6404-08d9ed959d2b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3734 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: Hans de Goede , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Mario Limonciello , Andreas Noever Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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"); +} + static struct fwnode_handle *(*pci_msi_get_fwnode_cb)(struct device *dev); /** diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 3d60cabde1a1..359607c0542d 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h @@ -695,6 +695,7 @@ void acpi_pci_refresh_power_state(struct pci_dev *dev); int acpi_pci_wakeup(struct pci_dev *dev, bool enable); bool acpi_pci_need_resume(struct pci_dev *dev); pci_power_t acpi_pci_choose_state(struct pci_dev *pdev); +bool pci_acpi_is_usb4(struct pci_dev *dev); #else static inline int pci_dev_acpi_reset(struct pci_dev *dev, bool probe) { @@ -734,6 +735,10 @@ static inline pci_power_t acpi_pci_choose_state(struct pci_dev *pdev) { return PCI_POWER_ERROR; } +static inline bool pci_acpi_is_usb4(struct pci_dev *dev) +{ + return false; +} #endif #ifdef CONFIG_PCIEASPM diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index e41656cdd8f0..2693211d31cf 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1610,6 +1610,7 @@ static void pci_set_removable(struct pci_dev *dev) * exposed as "removable" to userspace. */ if (vsec || + pci_acpi_is_usb4(dev) || (parent && (parent->external_facing || dev_is_removable(&parent->dev)))) dev_set_removable(&dev->dev, DEVICE_REMOVABLE); From patchwork Fri Feb 11 19:32:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12743817 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 A6987C433F5 for ; Fri, 11 Feb 2022 19:35:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C6C610EB1A; Fri, 11 Feb 2022 19:35:19 +0000 (UTC) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1anam02on2084.outbound.protection.outlook.com [40.107.96.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8AC7F10EB14; Fri, 11 Feb 2022 19:35:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FxY0LC6z7N5OnIo+N+Lz2GEG7B8Aji5qDcMkmDgrfkxweh4KWlc/oQxUoIlshgnd3qHRGwEi42LRO6S432KwOPjpVGKRG5VJnP5WbmWcEYzBQvEJQ4C2jmzTjPr4P+BsHS91tHQj2ZZAobMW/ydcduIBcypD2BzQgWxQ2TbL/mfIPj7igsrv1QdHg/ZwnZqJIxxQEKjZvn9AO4wCjcsf9H8MUGB2UNUtD924uzNLYbjWQN2JYGUDJTKQbtM6YhURhA8zuR45tvSWdD5V7Mu6v7lP9TsEDpidyLmJiHe9Bxnyv5x4x9Qo30+Y4IqdTbSIQqabugExa+AVEmCCMxrC2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6GLsw+AS8+IaNmFkIGRwFaDA0jXIGrT9HwpGpUb1w1k=; b=VosXFoIdDIiDVzqTjXjBbgypJ32PVvrFBgCRzCuZfN1EHSZnDxyTRxGQt8ULEbBLC5dNEXMrFwxD7r19QSMnwZWwUlekNf11DYbFSyK1ycVlxhS52yCIawu50NTGsJOgTmHbuKdcp0U+h4XVWsj8J1d09ISunpPalv5gAkUWaXwoa2lvRDHwTECNdysri/W2FYhVEhMO34Lo5szI/B0w+6QFfAQ974Zm46+98ojaG2I+7e7ArFODXz0PGgciUhsdegUpLZXdp0ML7O8q8wKyC817p+HR4KViz6kuK0M1hcrrBHdiWaFmJrpNhw0mjT4Phcyw5J36Zps31vOyi8dT9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6GLsw+AS8+IaNmFkIGRwFaDA0jXIGrT9HwpGpUb1w1k=; b=JPy01sdVy7lCEqxgYR4A7eX7eOWoFtpgDzMG2meiSBAlBzLyUsa2KN4thRVxn8KWcubYUXkfUf+arX/zOsmvQ9AZrSrJHO3PB73m7TTs0KFZ1VfOjREIxMfdapxga2BPc9qMjuKhVuVkDtjS8FRgDlF1lMn20q8ym9Qzl3ZBvfM= Received: from DS7PR07CA0023.namprd07.prod.outlook.com (2603:10b6:5:3af::28) by BL1PR12MB5064.namprd12.prod.outlook.com (2603:10b6:208:30a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.11; Fri, 11 Feb 2022 19:35:10 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3af:cafe::a7) by DS7PR07CA0023.outlook.office365.com (2603:10b6:5:3af::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.12 via Frontend Transport; Fri, 11 Feb 2022 19:35:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:10 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 11 Feb 2022 13:35:09 -0600 From: Mario Limonciello To: 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" Subject: [PATCH v3 06/12] PCI: Explicitly mark USB4 NHI devices as removable Date: Fri, 11 Feb 2022 13:32:44 -0600 Message-ID: <20220211193250.1904843-7-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211193250.1904843-1-mario.limonciello@amd.com> References: <20220211193250.1904843-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 416e20be-d78a-408b-a852-08d9ed959db5 X-MS-TrafficTypeDiagnostic: BL1PR12MB5064:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e593qcCLTj+XFA0gZ3IKTC/i/+Y+U+woS1BG4W4RPOguCPg2oazsTsHlvW99Ve0zRlUH2DuiuhAtLba3BREKcTvFGSrPIJop+i9C9eGQS3BuU89b6lP2qcDTJxqpg8stMbIMdNkuFr77IneH2+klcoUMGMh9MM9SyEGu7v5D+n9XrkSKghRYLW7gWCwet7mkzQgXVeCbEdQoPOCuvDicrv6qzbs15rWd1g/Q2HZi9JVnRciFPxNR+Q123R2FL7wX+NbbbNdsahDgNTylz45C3GGDZL5brNKh3z6TRfkQmcvAHNZh5LMhK78XHjcqcuQ8tSeAXOd+9GcoNLWBQGzrUoDKa0+Je5wzUUeufGyXba3T3ANqTkj4Rwd+VMui5v+1u6UJCLetFos1Lgxp67KOKiAxEmQI8dNl7s3YP6mQMRkY9dm6NB1e2SvBCPVPAJJrwkn/oykIbMedi7css2besxI9yklvt7YjetIPKwlNFHrIZCYUueL1MOU/czCu9h7BzmIEbg6FS15SzrWF62zCLPCaAzS0MovHS/SVLz2gMnGXFRgmKru/XOpo4IsPnLg5XAZXiDOhG+MaSv7U60/4Y7gw2yG5RwvtZRZbdCb7MgzsFIF6/MVMRpv2BuDHE0WeODo3BXly6DGAAjXpsf7ZeRyKv1YQ9LX365LBm32T6muN8ctXA8rxtq3zZoN3UddzAh1oFQ2ENkg70+hl3WHEfg== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(426003)(5660300002)(4744005)(44832011)(40460700003)(1076003)(2616005)(336012)(81166007)(186003)(36860700001)(6666004)(356005)(70586007)(70206006)(7416002)(8936002)(8676002)(4326008)(2906002)(36756003)(26005)(82310400004)(316002)(47076005)(508600001)(110136005)(86362001)(54906003)(16526019)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 19:35:10.0380 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 416e20be-d78a-408b-a852-08d9ed959db5 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5064 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: Hans de Goede , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Mario Limonciello , Andreas Noever , Macpaul Lin Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" USB4 class devices are also removable like Intel Thunderbolt devices. Drivers of downstream devices use this information to declare functional differences in how the drivers perform by knowing that they are connected to an upstream TBT/USB4 port. Reviewed-by: Macpaul Lin Signed-off-by: Mario Limonciello --- drivers/pci/probe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 2693211d31cf..67ca33188cba 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1610,6 +1610,7 @@ static void pci_set_removable(struct pci_dev *dev) * exposed as "removable" to userspace. */ if (vsec || + dev->class == PCI_CLASS_SERIAL_USB_USB4 || pci_acpi_is_usb4(dev) || (parent && (parent->external_facing || dev_is_removable(&parent->dev)))) From patchwork Fri Feb 11 19:32:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12743814 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 D7417C433EF for ; Fri, 11 Feb 2022 19:35:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C8C410EB10; Fri, 11 Feb 2022 19:35:18 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2088.outbound.protection.outlook.com [40.107.243.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id E80C010EB02; Fri, 11 Feb 2022 19:35:12 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oZy8MyFSrkZHOFgRxq0cIWARgggmesxdgc7UR3jVZTYntAg1OmvfhJFIKd8Is06RX7lh5VDAP/Nu3XQPkZSeKW/CVDKkp8P7J/mbTUIugnVuhGvomFLI/JzAMwu8KIQxQt6Pt/QziaJIknlDaTRARbYDBqRPb3sQsnfjJ5sbOuLOrYKEAIWj+XoP3sqXtbW8/V4uY/W8oB73o1mVm3y2VOtuOXwPWeFIqCPSpvFTiQVE6zeBoKqIs1qpItFeJTcPDyDScoaEK/AtMyPuGiNSAunyZQIco+XFlX+D/d62lT9UQnNz88R7UbfmvGjCvdx6pblsXnfLUTJgpMedfHJUeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=j+yYlcNVjrRyhSY8nGocSvKs3OLExLa17+KyA6OwVXE=; b=Au9/ivhg143laH0TyCcBqcTFtFc7oBOzWhEfN42btTVtSlkHzZ7Pyh6vdo8wD23potuVIRrJmrYrQtGHp6P+Pnze/0LX0wAjanex4QiTHjR2OcF/0i43TnK/M1ZegufURRbklaQ5pqXfWdlkhXewJop6825GJdybn6uyBBVtLf+qIsIFdfnlEOVWCghRU1ObFkJ43VI8hayEaxMyjbHRKkG/QGjDo6vBD6Jh/KhX/DgX+/7XdPUn3ejilziqJVw3nT41dNmo0wVjblp6anLMH5jwQf2BmjR5Y8REhdyq/1ddjZaa3q/ZVCwXxQMAO5K3atzZeAz7GtGd3TgYrPWIHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=j+yYlcNVjrRyhSY8nGocSvKs3OLExLa17+KyA6OwVXE=; b=nTSWaxHPNl7qxo6ThxyLTOHcZUtskH6/eUZ78AEeJ3drOkksbkcIpt79KBgm0HJ+ZmOMwRs0vtxm2XwW6cTeykq314UQW+3vVa1zVPXzT1MuxW4ijtmHgWL+ExC8w/QBxHPJhR/Xws2z4MEL8udS2Z5+AmQHvPYuHCam83wnZtw= Received: from DS7PR07CA0008.namprd07.prod.outlook.com (2603:10b6:5:3af::21) by CY4PR1201MB2548.namprd12.prod.outlook.com (2603:10b6:903:d8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.16; Fri, 11 Feb 2022 19:35:11 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3af:cafe::ec) by DS7PR07CA0008.outlook.office365.com (2603:10b6:5:3af::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.13 via Frontend Transport; Fri, 11 Feb 2022 19:35:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:10 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 11 Feb 2022 13:35:09 -0600 From: Mario Limonciello To: 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" Subject: [PATCH v3 07/12] PCI: Set ports for discrete USB4 controllers appropriately Date: Fri, 11 Feb 2022 13:32:45 -0600 Message-ID: <20220211193250.1904843-8-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211193250.1904843-1-mario.limonciello@amd.com> References: <20220211193250.1904843-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 434e9cb5-fad7-4bc9-c74c-08d9ed959e19 X-MS-TrafficTypeDiagnostic: CY4PR1201MB2548:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F5O6+QgxGR36QvHLaPGl32x5V8Y/U1B3WT1YxOi7BZAcMYe4vaeY/vvm3PHY295srBCocPGFAm1whwu/Hb7Q3ED17b8G+OlG++0YRY6HmtsedICbsn/116k3zGpJn7LUE2EZnAJDgFO4hmLpZgQ2fpjLvU0Yl0y6Fo1pbD2A9WOtCNWkkdzi1mrZlUQHV9JNVFUzovdcbuMOri3J2KrNOTF5/V3qBB61VxuOnLsoY6b7Y5efFQhM1WDLJAU5S2F9qZS23hT9hX1C/e89Bw09Js4L1rHjXr3A8bEa8ohBu5GnQc3hI2JPwyFaFzmVkvIkSP9rV7uBX+MpCQ6XZdBf+7diFkNcLgushx746Ikh4DDkys/4SZEyJuAqMgRZvHaikKaWI1/pqfYiAxAVNYbD8u7cJxXTsIKMH5Z67J6UMQkcDKdH687eptkhs6reRVm9CDjc/96FsFzOo2a5Xkrd3juJbDCAPSF/o/fJYW3orpqYuqQz2ZwI9XDKV8c5/F23vzZT/e19wkvGF3rCz10apnPsS0AfAP8qVaHvuOeZU0fbrtrmmgQgg8dbjTD1HSj1DWSazCCCcS3trBXZHbbXN7hROsIImmM8oAIJ7EXuNnyg0xMnUI+qcVs6Wu5YyK3GomnRIekuezHTx06IWpfxE/91ZH7TJUz1TU6v/RvdHpR5COWiKAKiupVOw5ureuUTViI263y/2ydmc5v6KHPxT+GHrpfrf2dvWrihoJen7TDIXd3bOyG8UzVopyEIRu+SNsXdgH3O7PlWd8gN0KorYl5LIejA9AjS82+97Vnna8E= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(16526019)(336012)(186003)(26005)(1076003)(44832011)(316002)(356005)(2906002)(7416002)(47076005)(81166007)(966005)(2616005)(36860700001)(426003)(86362001)(36756003)(8936002)(70586007)(5660300002)(83380400001)(82310400004)(54906003)(110136005)(4326008)(8676002)(6666004)(508600001)(40460700003)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 19:35:10.6941 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 434e9cb5-fad7-4bc9-c74c-08d9ed959e19 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB2548 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: Hans de Goede , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Mario Limonciello , Andreas Noever Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Discrete USB4 controllers won't have ACPI nodes specifying which PCIe or XHCI port they are linked with. In order to set the removable attribute appropriately, use the USB4 DVSEC extended capabability set on these root ports to determine if they are located on a discrete USB4 controller. Suggested-by: Mika Westerberg Link: https://usb.org/sites/default/files/USB4%20Specification%2020211116.zip Signed-off-by: Mario Limonciello --- drivers/pci/probe.c | 33 +++++++++++++++++++++++++++++++++ include/linux/pci_ids.h | 2 ++ 2 files changed, 35 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 67ca33188cba..1ed3e24db11e 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -25,6 +25,8 @@ #define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */ #define CARDBUS_RESERVE_BUSNR 3 +#define PCI_DVSEC_ID_USB4 0x23 + static struct resource busn_resource = { .name = "PCI busn", .start = 0, @@ -1590,6 +1592,36 @@ static void set_pcie_untrusted(struct pci_dev *dev) dev->untrusted = true; } +static bool pci_is_discrete_usb4(struct pci_dev *dev) +{ + int dvsec_val = 0, pos; + u32 hdr; + + /* USB4 spec says vendors can use either */ + pos = pci_find_dvsec_capability(dev, + PCI_VENDOR_ID_INTEL, + PCI_DVSEC_ID_USB4); + if (pos) { + dvsec_val = 0x06; + } else { + pos = pci_find_dvsec_capability(dev, + PCI_VENDOR_ID_USB_IF, + PCI_DVSEC_ID_USB4); + if (pos) + dvsec_val = 0x01; + } + if (!dvsec_val) + return false; + + pci_read_config_dword(dev, pos + PCI_DVSEC_HEADER2, &hdr); + if ((hdr & GENMASK(15, 0)) != dvsec_val) + return false; + /* this port is used for either NHI/PCIe tunnel/USB tunnel */ + if (hdr & GENMASK(18, 16)) + return true; + return false; +} + static void pci_set_removable(struct pci_dev *dev) { struct pci_dev *parent = pci_upstream_bridge(dev); @@ -1612,6 +1644,7 @@ static void pci_set_removable(struct pci_dev *dev) if (vsec || dev->class == PCI_CLASS_SERIAL_USB_USB4 || pci_acpi_is_usb4(dev) || + pci_is_discrete_usb4(dev) || (parent && (parent->external_facing || dev_is_removable(&parent->dev)))) dev_set_removable(&dev->dev, DEVICE_REMOVABLE); diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 61b161d914f0..271326e058b9 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -3097,4 +3097,6 @@ #define PCI_VENDOR_ID_NCUBE 0x10ff +#define PCI_VENDOR_ID_USB_IF 0x1EC0 + #endif /* _LINUX_PCI_IDS_H */ From patchwork Fri Feb 11 19:32:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12743813 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 1E0DDC433EF for ; Fri, 11 Feb 2022 19:35:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C10A910EB17; Fri, 11 Feb 2022 19:35:18 +0000 (UTC) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2082.outbound.protection.outlook.com [40.107.220.82]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3C13810EB08; Fri, 11 Feb 2022 19:35:13 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=guTxax8IAaV2yPQlgRCaTgAxMM41DMrhDxHnSFAKIcaKPSItEl4uWCbkUEHXx1sJYzmz+0ZHfjNUqkTe+nTkzFHv1oFbryfu8TX+QzGNf2ZEThMJ45pP59Dz2DVkXwxtnCcUWqGDY0IMn7DvATkrXLfsmS2GtcHAPKR1e8kJppX2e/SXvlGUMVhzNYQhANu2XxhB9pSVQWcQQo22BojMpeyLW1imJ1sNGxp5x8tcQEQjw5ptvcwQ16baYVaabqYIoLJidzsfbjWEnIe49/mhWVTGtgBdiBwMzGKxpgKZqkOKn+r4ilBqpRYKgGR6YYLYu2tSsP6SelWXYaxu5TU2CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=G4yk8hvDmhzfiKFK+3l63Ar/Gg2nsFdd8RGrNekuAok=; b=Bz1OzRDCbGxAiwhrfFNQm30jBq1YG4o4XOrbqd0MFrmBVCC9Fw74Xvlfc7vuZhp5dMNi19M7hp8r22ErnzdLARDmAHaHYH8cPPLTTC21flcWbh2yzQP1rwlLCewe0y17V5d7ddBvhzcxt1LSnHjxG+nbdYidzmGJYFwTgkSvVrG9w0icIAP/pO6ke0SbvQaTowENM0vcM44H+zxJk5n2ye8QefbvWYzFZxxZhYPTQ1s0PmKjR2e6H/npqNxCX+HHrdH/Ue35kl3VPoG/Hu8mCzC6X9ShE2Gfvejlhixgbs6YCE+ed5x+aydlCvTXcJfNMlqheQzLwB06aVmhmNZwhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=G4yk8hvDmhzfiKFK+3l63Ar/Gg2nsFdd8RGrNekuAok=; b=zPQzEyY2VkAIyt/DzmjYFcqPlFkjqqK+n+FSasL52EMFc1S5bNxN2kywOJLQPMsystKhVf1ydslwHvHL/vw3deds/jEQbnZ9QADpjRtSVDPJzSVkA7olA4MA4UOPFSuwO4tV4JCzuH+3p1DT+647YgQm+d1AM7aQtAnef2agrss= Received: from DS7PR07CA0024.namprd07.prod.outlook.com (2603:10b6:5:3af::6) by DM6PR12MB4155.namprd12.prod.outlook.com (2603:10b6:5:221::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Fri, 11 Feb 2022 19:35:11 +0000 Received: from DM6NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3af:cafe::b0) by DS7PR07CA0024.outlook.office365.com (2603:10b6:5:3af::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.13 via Frontend Transport; Fri, 11 Feb 2022 19:35:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT024.mail.protection.outlook.com (10.13.172.159) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:11 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 11 Feb 2022 13:35:10 -0600 From: Mario Limonciello To: 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" Subject: [PATCH v3 08/12] drm/amd: drop the use of `pci_is_thunderbolt_attached` Date: Fri, 11 Feb 2022 13:32:46 -0600 Message-ID: <20220211193250.1904843-9-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211193250.1904843-1-mario.limonciello@amd.com> References: <20220211193250.1904843-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b703fca4-0194-4a77-9918-08d9ed959e6f X-MS-TrafficTypeDiagnostic: DM6PR12MB4155:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:590; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZrVuK1jDjReuRyJNtH94sPOFI6KoCSR0cKRsTvcgVppCVwPMzkMJUqcy2M02cT8nJiSmrO3myxpeudN5H5B+jXau2dYw1XeW4AQJ8gck/Cyj0JcJQQg51ROQZNbVWElKaOOplyUUIBcT3Nt69cwGx33uD+if/Z1skvbeIVh6A8CBzuBBGbUlAS6afiah0kGtSkkEb6SlcfQzXFB4cw9eoVEolmaqpTk62Pb0SxjrjcJb1K2UUDR8o8dlC3z7oEvtT4mPV2kLi2rl7H+/uu6zdLu3hzSMNbzpIvrH1ShXporR7xerjyUGXyy3GAYbx5/gl6D/lF1iLX4RFnaOk9amPql4DbYEe2pTGmaxb7hQbnBBxWAAmgoB7jbEQbbIRDT5JPoLmsRSkStcIGYE1nNjpVahqwfaCpISTb6bglK1ZWmJSLtWhMVpNHZRT7z/n1fCW1THjtYmgzF9bHpmZ8DWikgtukpNGAa7k+tMtZg3vljamprfNZbdbeguzbreY6M8DyN5ffCcaEZh/V4EwC9mpHLPLaauXnHT5oUBV0rkM66BFO2woTbB+C7CBmX7/gz1FfWrXrUuygpTQwtto7deQVS3QLi7odct1SEPFfluy3S8qPi8zDv1B8XcRcHTGJsUS/FgtiUkEExSDUZ0Ojn2VXmrBrmXf+TYHqz0a/dZc7XpiCX77/FFcvX+UWoPSch3qpvAC+ou+BJgfIsdKF0dFMlT0LaRgq06WiUrlKDvkgc= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(36860700001)(336012)(16526019)(426003)(508600001)(6666004)(316002)(40460700003)(36756003)(86362001)(8676002)(4326008)(70206006)(70586007)(54906003)(110136005)(83380400001)(47076005)(356005)(81166007)(2906002)(5660300002)(8936002)(82310400004)(44832011)(1076003)(26005)(2616005)(186003)(7416002)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 19:35:11.2566 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b703fca4-0194-4a77-9918-08d9ed959e6f X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4155 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: Hans de Goede , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Mario Limonciello , Andreas Noever , Macpaul Lin Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently `pci_is_thunderbolt_attached` is used to indicate a device is connected externally. The PCI core now marks such devices as removable and downstream drivers can use this instead. Reviewed-by: Macpaul Lin Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 1ebb91db2274..6dbf5753b5be 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -161,7 +161,7 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags) (amdgpu_is_atpx_hybrid() || amdgpu_has_atpx_dgpu_power_cntl()) && ((flags & AMD_IS_APU) == 0) && - !pci_is_thunderbolt_attached(to_pci_dev(dev->dev))) + !dev_is_removable(&adev->pdev->dev)) flags |= AMD_IS_PX; parent = pci_upstream_bridge(adev->pdev); diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c b/drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c index ee7cab37dfd5..2c5d74d836f0 100644 --- a/drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v2_3.c @@ -382,7 +382,7 @@ static void nbio_v2_3_enable_aspm(struct amdgpu_device *adev, data |= NAVI10_PCIE__LC_L0S_INACTIVITY_DEFAULT << PCIE_LC_CNTL__LC_L0S_INACTIVITY__SHIFT; - if (pci_is_thunderbolt_attached(adev->pdev)) + if (dev_is_removable(&adev->pdev->dev)) data |= NAVI10_PCIE__LC_L1_INACTIVITY_TBT_DEFAULT << PCIE_LC_CNTL__LC_L1_INACTIVITY__SHIFT; else data |= NAVI10_PCIE__LC_L1_INACTIVITY_DEFAULT << PCIE_LC_CNTL__LC_L1_INACTIVITY__SHIFT; From patchwork Fri Feb 11 19:32:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12743820 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 B2CEBC433FE for ; Fri, 11 Feb 2022 19:35:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D4A5B10EB06; Fri, 11 Feb 2022 19:35:24 +0000 (UTC) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2050.outbound.protection.outlook.com [40.107.236.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 03C7B10EB1A; Fri, 11 Feb 2022 19:35:15 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H3Nm+pLvLM7JUoVINRHw1flHUqWGokCESOKSexwyPsMYRMcC3agWNj58OWMCymuOLrNv5Dvyuk8RgVshdo5/JXp6S04fItMQ+ZYnC6UIMuW2PE5MobvwpdXwXAmPxzCLHrynkvlBFQVAAjDD5A6Td0cYdbEUggUn7YRJzK25iL+uQYIoUS80eKcqsxZeUyH+AdKFeisRz2zSp9ugkV5pBpG2VU9wvxvS/8wFkUR0qEihzsqz7sLAc+uRY0UlPA3vknd818IQDLaTxjukgm0j4N0PlaA2H+2qV1grqhF9Pem+zZzd1wmxQeLBimPJo+EmqaF9AL/bzGQIjIZVob+UEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7oUyybnOX7Vt79s+4l5CYxIr3J/OX8sZXo1FzadUCHY=; b=SPqZpkLfIvU22luMGXk2z63CtK4wKO7Q6yyg2l1sG9DC3B36UYX08wyNOrlidx67QmbRT/6bZsYgW58ITZNjYCt9F3pPGV3OPQP08P6VECRHuoc/74FweI9L7ha7hsTRCX1AsoAdXhCbI+BAE9i6HM+Q80Ce8TTLEeOtpoMohCAvH7U96cgWNJmdHsNPOk1pm3z/xoMjQ4Fp/HxnoJU+TVFpZy/d2fWfHJ700S7cral3IvNZbRV8Hj2rcBDWk6KIr+VpzpiRd8FcPqGgEy7/ibED/dReZHURw2u3735lFExImj3ss0MjbNWYXrxuY4IPXdieerIL06efV1ceK66giw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7oUyybnOX7Vt79s+4l5CYxIr3J/OX8sZXo1FzadUCHY=; b=lWLvs9/jHetJrdb6YsK4Pp/Y6kJhYIQ7Zv/yuP4utCLPKU/80aUZ6i3uzLu8hv5qdZQJjUd5ELtE22eI2wugfGXcYXwXotrtaYz0uoYlhDFTOgGAUt7TV8duP9fjOaqWSXgCD456por2Bswgxbgofl/C7BFYKnfOoYotmiSw6MM= Received: from DM6PR08CA0054.namprd08.prod.outlook.com (2603:10b6:5:1e0::28) by BYAPR12MB3430.namprd12.prod.outlook.com (2603:10b6:a03:ad::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.18; Fri, 11 Feb 2022 19:35:12 +0000 Received: from DM6NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::b7) by DM6PR08CA0054.outlook.office365.com (2603:10b6:5:1e0::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12 via Frontend Transport; Fri, 11 Feb 2022 19:35:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT029.mail.protection.outlook.com (10.13.173.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:12 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 11 Feb 2022 13:35:11 -0600 From: Mario Limonciello To: 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" Subject: [PATCH v3 09/12] drm/nouveau: drop the use of `pci_is_thunderbolt_attached` Date: Fri, 11 Feb 2022 13:32:47 -0600 Message-ID: <20220211193250.1904843-10-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211193250.1904843-1-mario.limonciello@amd.com> References: <20220211193250.1904843-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e2c9e7d-25f3-47b7-a7da-08d9ed959ef9 X-MS-TrafficTypeDiagnostic: BYAPR12MB3430:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:883; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Oks8c4dnDTzc29kdlxj/DU4krUsj/MEuXBnocG25yvjdVnaUWiJeIwL89JcdQJhM/WXG8baiZ7UfgIhwGi+R2ph8mz5XYd9XhVhTOEchI9n5uKPA3Bv/c7xHRjddcz16jjua81iyDFHc8AbPB11Fx5l8gAIhv7N1+wNWuLc6PS12zBA9OPV74dcaPKp+ZQUYCDGGeOf+zdmuJluVdR3YAnxT6F78qhxCWvZbXGYFE2Za03zP7+qFMAJsTKzFoKNHBD6tI7nK5TzRGEWGhgmn3EUsT0kSkCTcPaPX8pbJoltYEkzCx6mswJ/eakaQMXqCaTNC6XuwfnIf9RJMODmOAKZ3hxdlyCBRq8VLs28n+2olowNJY2u/rTlH3O15XkapoKKRLJNBhQt6cZH5apzGqEUYj2hA1iFReKpt1NXktI+R9Qghrg8knDGPJ+6rW8+IxW0PQMQtNKIvke3NAvIasf7C1ceFmuRmXEVnlkwKODPKC3JQy6l+HoEn9q4M5XbifOV7Z0GxRVR+lF6/f2AcI1CuW6GhF4TSSHEYzfHrr96jLWjcdWTRXg1WLRDwTbjNk/WmmbJAqe1NXoxSyRUUzZ98XOHL4iVnsuHR/mqisUvEw2tli19CtwicSl3LN8uyWkRXfzJacka6Vqyq63Ihn2yOOxdmYC66W8ejNNGy8l1bVSV+FUIWc3J+fWgzUnm/cQ7O+AL9dE6rfFV1tffgOB3HCTTlehrqLItfi+chIo8= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(46966006)(36840700001)(40470700004)(8676002)(70206006)(70586007)(86362001)(356005)(4326008)(8936002)(316002)(508600001)(110136005)(54906003)(81166007)(82310400004)(6666004)(16526019)(47076005)(7416002)(36756003)(186003)(44832011)(26005)(40460700003)(2906002)(5660300002)(426003)(1076003)(336012)(2616005)(36860700001)(83380400001)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 19:35:12.1769 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6e2c9e7d-25f3-47b7-a7da-08d9ed959ef9 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3430 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: Hans de Goede , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Mario Limonciello , Andreas Noever Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently `pci_is_thunderbolt_attached` is used to indicate a device is connected externally. The PCI core now marks such devices as removable and downstream drivers can use this instead. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/nouveau/nouveau_vga.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c index 60cd8c0463df..2c8008cb38e0 100644 --- a/drivers/gpu/drm/nouveau/nouveau_vga.c +++ b/drivers/gpu/drm/nouveau/nouveau_vga.c @@ -97,7 +97,7 @@ nouveau_vga_init(struct nouveau_drm *drm) vga_client_register(pdev, nouveau_vga_set_decode); /* don't register Thunderbolt eGPU with vga_switcheroo */ - if (pci_is_thunderbolt_attached(pdev)) + if (dev_is_removable(&pdev->dev)) return; vga_switcheroo_register_client(pdev, &nouveau_switcheroo_ops, runtime); @@ -120,7 +120,7 @@ nouveau_vga_fini(struct nouveau_drm *drm) vga_client_unregister(pdev); - if (pci_is_thunderbolt_attached(pdev)) + if (dev_is_removable(&pdev->dev)) return; vga_switcheroo_unregister_client(pdev); From patchwork Fri Feb 11 19:32:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12743818 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 30627C433F5 for ; Fri, 11 Feb 2022 19:35:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E17410EB21; Fri, 11 Feb 2022 19:35:21 +0000 (UTC) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2045.outbound.protection.outlook.com [40.107.244.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 25E3F10EB07; Fri, 11 Feb 2022 19:35:15 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OnSCG2T3OHVct8KbuHPzVzCtjROjY4XSzjs94Y1D6pFxxwgsvrJjbb/Z3FPdl6C9AoegJO26xml+2KE6w+2uMlA/o2Cg2Sqz+JDQx5yZDEAf6ZgHigpsfyjt6Z9YzHdb0ye9G8F3L4Tlk2xwSJ5HG3y7aCqK0eN22N/o0Cb5CAAG7GEDPr9wt5JsnkbO3lhlxM63AxMt25HVSdCL4h4a5aJW9N2kmEzKa7rNuekZ93ouK7r3lddkF2xCGO2zN/cRwLaarVprvcmFDDoDn+2wJ6M+oV0E5+ANf3RudpwoNjHShdLdjZtCLQYBkdVlC8OeBNq7OK5ic5i1LY04IDhrsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=neyootgBRunSQAJPnXb1dPCfoyhMOxPxpCnyWraQL7E=; b=hT2EaqHv2hUqBa0+cfUScQ/pwOFqpJ0LBVSUtu1oRIjY7BqHai57psMdxE0gvTb0IMSl7cPXPdXb9ppJCmMKhddY4egbKmqD8JCNLJjv9RSFEJOw8zcR83afjSlz0IOHy/wvEE0tKa64SlPXfCeFXwrHUYHbKbe/6ZmnX3MIZO4PtyGUShr+4ru2KgdJZZQmk5CSned5VNbCV2xn8nz94SpCbsrCDrrD3Wo5o9Bz/s2RWR8W+kgFH49ZIFT3vqbwOCXRk33V+9rirB6V1ramPq877F1JBHajbHRcmzw1hKfOvbjYSz/CnkgwAWBWuHlJiYrsMOpg0Ebs+guPKRqufg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=neyootgBRunSQAJPnXb1dPCfoyhMOxPxpCnyWraQL7E=; b=ZOYR2zRmfdr6d2S1Td0UvbH67Vig/Tmj0WJORF3zyI3v8Tf1hFTzhoGPwqrZjY9iNPDuymACGJ0sjQuLfonL8cplPvC6wmRxXedbLTxAfH8XC2T0XXykNPU86A24Va10wiaHS1mmqEm8GDF730XQ3Vb+LcSfFpFJUVU95faOLjI= Received: from DM6PR08CA0042.namprd08.prod.outlook.com (2603:10b6:5:1e0::16) by PH7PR12MB5999.namprd12.prod.outlook.com (2603:10b6:510:1db::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.18; Fri, 11 Feb 2022 19:35:13 +0000 Received: from DM6NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::9b) by DM6PR08CA0042.outlook.office365.com (2603:10b6:5:1e0::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.13 via Frontend Transport; Fri, 11 Feb 2022 19:35:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT029.mail.protection.outlook.com (10.13.173.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:12 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 11 Feb 2022 13:35:11 -0600 From: Mario Limonciello To: 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" Subject: [PATCH v3 10/12] drm/radeon: drop the use of `pci_is_thunderbolt_attached` Date: Fri, 11 Feb 2022 13:32:48 -0600 Message-ID: <20220211193250.1904843-11-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211193250.1904843-1-mario.limonciello@amd.com> References: <20220211193250.1904843-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ff62401-94b5-4128-9ff2-08d9ed959f75 X-MS-TrafficTypeDiagnostic: PH7PR12MB5999:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:514; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c2nXe3SBRvAlKvPWpIsRM5CIKNd5JtqPxcLSuW7b/iPx58l5R8260YJc4JXkyVlUq2PGZjomcVIHSA5Y8rLpLaHV35U7VdF/P+xv8oocTSYgjsdwlazqi0SxV2UjVwbG1MM2RWkA/4m4ITAk7SgTdfu0DnqAp9v1dpbU9Ws7BGt7smTqUgrODnZJh/Kq36bPrLjiwcc7GgXvgjekVyc0Wz8DCeh/S3z8MreDcvk991e5QxY1adZyz22jUMbjOpuwbOD6Kbo5gkTGxW2bn9BQl7+B/ZYt+ZtbvLu42nkH4BKY0pIori0OHSiY/fu9BTbIEehjT9wmEWEKrd83dfsZM0MCelG0QVcIpOrKqNfQGZo0CMm3rmzxWgddVvs3gw9qHCVt+0skxraDb+Ri58BvUWtcknS5jMCNx/rOTwdLhBlQRha6qf6J8Ap7VeB+F1auv6XdPu9ACuKdSKRXvQcUnqOV5TuE6Xnqa2U3KFUbIQgvlUE1CdEkjlhTsSgIkjlJ8rlnUpSanRzYB+gKNrYGo3UaH6Sif1D0YVGxWjhgGFpf7QbUIiCPt6rLaoYm1HgpZENyDhJtIcTXcl0FmmCTlMWkjAuOS37LYVHN8W/zEHOYl6C2+UR2Zx57FWFZb4lLpChmqPngds7XtRKDlARCyBH468MOPjUOFFA4SDq2tipareTcSnfoc05h4rTxxae5+gCt7Ah4MFnxiE+H7L1R0Z69OxOYcQQTXEfuphw4/oE= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(110136005)(36756003)(508600001)(54906003)(316002)(6666004)(40460700003)(4326008)(47076005)(1076003)(2616005)(7416002)(70206006)(8936002)(82310400004)(16526019)(26005)(186003)(356005)(2906002)(5660300002)(36860700001)(8676002)(336012)(70586007)(83380400001)(426003)(86362001)(44832011)(81166007)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 19:35:12.9738 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ff62401-94b5-4128-9ff2-08d9ed959f75 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5999 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: Hans de Goede , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Mario Limonciello , Andreas Noever Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently `pci_is_thunderbolt_attached` is used to indicate a device is connected externally. The PCI core now marks such devices as removable and downstream drivers can use this instead. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/radeon/radeon_device.c | 4 ++-- drivers/gpu/drm/radeon/radeon_kms.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 4f0fbf667431..5117fce23b3f 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -1439,7 +1439,7 @@ int radeon_device_init(struct radeon_device *rdev, if (rdev->flags & RADEON_IS_PX) runtime = true; - if (!pci_is_thunderbolt_attached(rdev->pdev)) + if (!dev_is_removable(&rdev->pdev->dev)) vga_switcheroo_register_client(rdev->pdev, &radeon_switcheroo_ops, runtime); if (runtime) @@ -1527,7 +1527,7 @@ void radeon_device_fini(struct radeon_device *rdev) /* evict vram memory */ radeon_bo_evict_vram(rdev); radeon_fini(rdev); - if (!pci_is_thunderbolt_attached(rdev->pdev)) + if (!dev_is_removable(&rdev->pdev->dev)) vga_switcheroo_unregister_client(rdev->pdev); if (rdev->flags & RADEON_IS_PX) vga_switcheroo_fini_domain_pm_ops(rdev->dev); diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 11ad210919c8..e01ee7a5cf5d 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c @@ -139,7 +139,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags) if ((radeon_runtime_pm != 0) && radeon_has_atpx() && ((flags & RADEON_IS_IGP) == 0) && - !pci_is_thunderbolt_attached(pdev)) + !dev_is_removable(&pdev->dev)) flags |= RADEON_IS_PX; /* radeon_device_init should report only fatal error From patchwork Fri Feb 11 19:32:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12743816 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 3543CC433FE for ; Fri, 11 Feb 2022 19:35:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D9EA810EAFF; Fri, 11 Feb 2022 19:35:19 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2075.outbound.protection.outlook.com [40.107.94.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3409310EB13; Fri, 11 Feb 2022 19:35:15 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JyiljQrC6Nzi9JUzIVHbU2koLdDuHbcNhhS+3RGw6U/DNJ6QY4Jik99RScpXiQT9xQ9vYWpg9WNuuv+AQ6LlRBtMLS8emIqxs+SKOuLwBt1J+8gZagJ3mI2fXAND6DnDN++T/coRIwv/giHUR4bcnaz6kItu7cgyi+MCU47lZWZpHwXLZXFPdsrt0XplrEv5aEMnnSI/GoV7h34cfkZz8ddxFuXaT7fXmpQQcEHKW3mzKIAbpN9nx348hv+2wmJ72tGud2VNPY8fNr9RQkQef8c4lFRJasTHMO7g7DYO3fy0Crz2q58YP+UIXxS3gLn7H2n1tgrrzD9UQo53HjPt3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rqZ4dsvyH1pE+Blj7hAu+u+8lgM31K2/MMjKabJ8mIk=; b=AgGB86wXHopeaRElrl0JylPGNqbsfXF8lmOsX2vMF0mD0th+C1lLFNb97ihHA3W1O1m8QNWoodHs0HdysKfRsBASuT1XSxks3cdCtulWA2/abW8hKf/rTbuPjZbtx613ZBy0HE4LiwqWUcNniLcBk1OatpRhm6SdWRGe1zy0LE842hmaA1IGBRwP13ecrthRq1a1ksva+Ura8nfYTjz4numSrYRUa0pl4fDELIdJ5/iP89KafQOnxmPNzQL2/QBdC4VGKJ601dyu69s3kaq4F6CL9exiUtkWlWylNFlT0zmuQBZnYP8aCiog11/dn4F9uYFdlJqDMkL1UVUfTBMaUg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rqZ4dsvyH1pE+Blj7hAu+u+8lgM31K2/MMjKabJ8mIk=; b=cH5+0Aonjv6gLOHmwN+xhwLQd3F24LY7I08O8FQB3kKc3gjJJfTj5NgDhWCdqvsPP49SDN8cmMvJRncf4/3kIjdqQujarn5TOGFddaR8SWHkYbmZr86twKHAGlhSZpQ3GAAfT1D+Pelf0nl9J/3/PHl+zP+qFAcKIz97eo5qbB8= Received: from DM6PR08CA0043.namprd08.prod.outlook.com (2603:10b6:5:1e0::17) by BY5PR12MB3937.namprd12.prod.outlook.com (2603:10b6:a03:194::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Fri, 11 Feb 2022 19:35:14 +0000 Received: from DM6NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::65) by DM6PR08CA0043.outlook.office365.com (2603:10b6:5:1e0::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT029.mail.protection.outlook.com (10.13.173.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:13 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 11 Feb 2022 13:35:12 -0600 From: Mario Limonciello To: 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" Subject: [PATCH v3 11/12] platform/x86: amd-gmux: drop the use of `pci_is_thunderbolt_attached` Date: Fri, 11 Feb 2022 13:32:49 -0600 Message-ID: <20220211193250.1904843-12-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211193250.1904843-1-mario.limonciello@amd.com> References: <20220211193250.1904843-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2fa93ab2-6528-4a58-d377-08d9ed959fec X-MS-TrafficTypeDiagnostic: BY5PR12MB3937:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:854; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M/b2eK9QvKW7DVabXCYww0cR7joqIEYmt7MyPYi5kxkzd1RU5O5inT7M9y4gmNEQQq0U8V5/GK9tcsqsykFZoCel2/KEc4N1pFoPoohU2fhoLYz61wjEWoKq0MIzrxYBH8SSlXcLSI0hZVPEyADp724g31f5TQ6bj/qM2m2npqrzy6c5yU9/rJcgVFoD+nT3PR+m9/H74KEvP1RuoD4U092v6nwcOgYg4jcmCP7pIL5bN/LBOTU8I1Uvf3iBMy56AekTufAcBmlyZ5Q7p8/cZ1p/3e/WXEU/76C8WMyMSpGz4Cyesyi+xQiAMl82pBXe4KdNMhJtWaNEnQhPN8cxFx0VwJ6zy39eIpQRVBHX4Fr9Ojr1ohbWy2nfgfWrHRobHM9RtJMvzIckzgUf9UzvTIPqrMQvTODHXMD7puBb3I0GF47dByYMxkMdw4yKk+A+NsF9jK1Lx/TcgEbejk3GUfpgf/S0+EH5kNA3MnxG/fusu2Q10ebIFEuQ6JBipEl2BkfcjlV/45tmFU3VfH0cIleaWlD3JOAe80qM9uMF5ayYMkdsyZOFU7VTn/+EoHI/sGaeTEb+uWFjUKue2/9ys1wkeTot0aNvxv0v8fSmwIRvZdf85clLdizM71WpBWxMBR/GtsNiT3ZtN/YQKZzYsDx4WoW/pPYRNcwggp9P3xU2gcstQ3rkkQq+pb1Ia2kTKGiYcGU47bLveMwRdsRwnUZ+dwG0fmudIieTzpYbJxc= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(8936002)(86362001)(4326008)(336012)(316002)(426003)(186003)(70586007)(110136005)(54906003)(8676002)(82310400004)(81166007)(356005)(1076003)(2616005)(70206006)(26005)(16526019)(2906002)(40460700003)(508600001)(44832011)(4744005)(83380400001)(7416002)(5660300002)(36860700001)(6666004)(47076005)(36756003)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 19:35:13.7550 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2fa93ab2-6528-4a58-d377-08d9ed959fec X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB3937 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: Hans de Goede , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Mario Limonciello , Andreas Noever Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently `pci_is_thunderbolt_attached` is used to indicate a device is connected externally. The PCI core now marks such devices as removable and downstream drivers can use this instead. Acked-by: Hans de Goede Signed-off-by: Mario Limonciello --- drivers/platform/x86/apple-gmux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index 04232fbc7d56..ffac15b9befd 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -596,7 +596,7 @@ static int gmux_resume(struct device *dev) static int is_thunderbolt(struct device *dev, void *data) { - return pci_is_thunderbolt_attached(to_pci_dev(dev)); + return dev_is_removable(dev); } static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) From patchwork Fri Feb 11 19:32:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12743819 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 6EC70C433EF for ; Fri, 11 Feb 2022 19:35:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C52E010EB22; Fri, 11 Feb 2022 19:35:22 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2075.outbound.protection.outlook.com [40.107.243.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id D7E0310EB17; Fri, 11 Feb 2022 19:35:15 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QrdGlFlTd59C8EeF4xZuPj8io65+qvWprhfcs2BcN9AyecTtQQDlXaoAqTa7NjnkcpOPBuhdIviq5XjTUqKzc/fLPyTt7tDHV4Ak0eMCssC6arkjZU1hyRgKYGBe3o6NzzPFhQjfqXW+2UOZKVzLSJ0tbdk3g1/L0Dwmn/ThtsM9LzZqBWeA0bnECmXXRppP5oUS//tlBF5ew/JSG9O3GKF38vd3CBPs+dQ0StVhZORhCnrTiN0KBDY6oBZViEBHjyYouecc/4OrhvMPqa7jnfUqPz46JlfOjtHtXX2AWm5ugZdX5q+96fep75Xy5fwj/DGUeYNiTlqZX+nUZBKSWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4CJsbT/uQNbCLg3zijkw2HtWNygmK8JRosfQfMJvjsA=; b=H/8HNQpHDoLF6bacvGSi1N8AxbbfaA9o0r2Sx+eYlr/Fd/yAjH1cW/GucVz1JNCWssmA17ZvA2+6Ks6hd5dfyQhoI3xeYCVN6rJZxjEe3n+UOY/Qi2kfWFnbpkIaRT+JGeaAuoWk+T0keFCoIyIietbYsk0QsJ6occa2+60UTZfZWSuKnzhcenJ2/r7EnzBPohJSXoLs9zlY//v2zJrxZd2kVEMh5SsKTJzfgclSTAt673WyBBll4OqZvQ8XN/Agk0zbOLAuCo0LW32tU5KlCDIzoF5i/re6xyEVBYmbxr6+Vf69sLn0Zn4U5izzwne+hH+/+eYF/Ts/Ij1bfo/cww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4CJsbT/uQNbCLg3zijkw2HtWNygmK8JRosfQfMJvjsA=; b=PrK0qRrAMbou2WlvABH73rvLcr7OcwkcF7z/xS4jE+5f1jVXdpFwQxq4gGylAcA9jXd0sicOGrStOEcKMMNo1likRhq32uZ4AnkYrkGG0YnDiAC1o5rH7LFBvPijY6i2JR/IPCOrf1VIz7/le5RdhcnyVjBdWt0t76NTmmEtOi0= Received: from DM6PR08CA0040.namprd08.prod.outlook.com (2603:10b6:5:1e0::14) by DM6PR12MB4577.namprd12.prod.outlook.com (2603:10b6:5:2aa::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Fri, 11 Feb 2022 19:35:14 +0000 Received: from DM6NAM11FT029.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1e0:cafe::4c) by DM6PR08CA0040.outlook.office365.com (2603:10b6:5:1e0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.12 via Frontend Transport; Fri, 11 Feb 2022 19:35:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT029.mail.protection.outlook.com (10.13.173.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 19:35:14 +0000 Received: from localhost.localdomain (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.18; Fri, 11 Feb 2022 13:35:12 -0600 From: Mario Limonciello To: 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" Subject: [PATCH v3 12/12] PCI: drop `pci_is_thunderbolt_attached` Date: Fri, 11 Feb 2022 13:32:50 -0600 Message-ID: <20220211193250.1904843-13-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220211193250.1904843-1-mario.limonciello@amd.com> References: <20220211193250.1904843-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2cf0a8b6-2408-485d-e1f2-08d9ed95a03d X-MS-TrafficTypeDiagnostic: DM6PR12MB4577:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3O+zenQpDQG4JKvuq9k2YnSKgyS2LJ57D5Gm2oIyyfIIt+vO/poQZGm4YJwjtWwmLr+m8CvcWdDI/B93SDZR7tDpyHeC29qmY6bhq+Sz3K24ZVfRJDq/9O6KoARDSflcB4cTC0oQno7dEUqmxyVm/BiSaeLSIrATz7Qw8AbTp1BptMWCRWVYUADQeTrGiJl0aKpC3CX6OmP6AkrPRdiZvvdP5mE1HjRnCAARBeNFpwLeb5j6l0FlKPnSL2dJTcLoU9J4e5ZxL0iQVIr7M31e4NfAW5wR5Kr6uv4s74Bqeoin54EQVo16mcjt/Rwi1I+gIdWpA0h1Bzik3aLwsmQGgATDfoeameJZm2xwq9ZeIxqQZJX6nS9DLl3KjPNPDshVy+fdp5WRHzYAg/xHQ6bgqhfhR/AcE7DGt3jcp9ZUeWrgXXrMAgjvsyPOYHsldU2yze82F6rpsVtjOVHIdxl0q9msck9blBhtlwwsQyTmn6trkDwIIDzLwiTcZ5/ijVMdJww3LvHVbllIH/3QmMt8t1ajHN+L2wzU6X1jWJeomcWZ9QwEZqM6kqvqzpCOZlabSS8SL8qcvvkQbg7fMbZFs8SVxY3yv7OD4JCn/KC6o0ELR226EwiZuKAsu610thBALM3flrbK4PKEEAU02p8Yl7jptXOGnq17B9dmTOrPT08lzxR10KpI/+7E3SDzzqRFbMPC/wfJ/Do/yRDxJFKKxBm7p+9XUcwL8inE0E4pSmU= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(4326008)(36756003)(86362001)(26005)(8676002)(8936002)(336012)(356005)(36860700001)(426003)(70206006)(83380400001)(82310400004)(186003)(70586007)(81166007)(508600001)(16526019)(54906003)(40460700003)(316002)(2906002)(2616005)(47076005)(110136005)(6666004)(5660300002)(7416002)(44832011)(1076003)(81973001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 19:35:14.2862 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2cf0a8b6-2408-485d-e1f2-08d9ed95a03d X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT029.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4577 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: Hans de Goede , Michael Jamet , Yehezkel Bernat , Alexander.Deucher@amd.com, Mario Limonciello , Andreas Noever Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Currently `pci_is_thunderbolt_attached` is used to indicate a device is connected externally. As all drivers now look at the removable attribute, drop this function. Signed-off-by: Mario Limonciello --- include/linux/pci.h | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/include/linux/pci.h b/include/linux/pci.h index d9719eb14654..089e7e36a0d9 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2434,28 +2434,6 @@ static inline bool pci_ari_enabled(struct pci_bus *bus) return bus->self && bus->self->ari_enabled; } -/** - * pci_is_thunderbolt_attached - whether device is on a Thunderbolt daisy chain - * @pdev: PCI device to check - * - * Walk upwards from @pdev and check for each encountered bridge if it's part - * of a Thunderbolt controller. Reaching the host bridge means @pdev is not - * Thunderbolt-attached. (But rather soldered to the mainboard usually.) - */ -static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev) -{ - struct pci_dev *parent = pdev; - - if (dev_is_removable(&pdev->dev)) - return true; - - while ((parent = pci_upstream_bridge(parent))) - if (dev_is_removable(&parent->dev)) - return true; - - return false; -} - #if defined(CONFIG_PCIEPORTBUS) || defined(CONFIG_EEH) void pci_uevent_ers(struct pci_dev *pdev, enum pci_ers_result err_type); #endif