From patchwork Tue Feb 15 00:01:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12746224 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77FB4C43219 for ; Tue, 15 Feb 2022 00:04:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232005AbiBOAE0 (ORCPT ); Mon, 14 Feb 2022 19:04:26 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230167AbiBOAEZ (ORCPT ); Mon, 14 Feb 2022 19:04:25 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2056.outbound.protection.outlook.com [40.107.236.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F07A74845; Mon, 14 Feb 2022 16:04:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hnjYhfw73lzaTfGyAzDYWYRCOy9vAqgSicOs8FuCddWeT4j5LigGyMcd3owez4i1v6W4OP0A3xKNrBMRWOLvW7ev1KhhKlSMK1/NB3TSsW10aL7yfpPy905uUxLP9Q0TYkhbvUhCAmT2Q5+KTtcu4VWFeuGdzmaGXXn0M2W8d4iWv/jeJ0uGm22stQPGYH3p7aZnzc8KCXbpuDR6G5Dimzazi/X9eQAG6aVbOCDFmb1A3R+1f0eGFLV8HW6NilWdHxroSBpfFpDDwTj/pekcdRXzg5dytARCzOj+pBzTNZ7TXTfQR4AArRheNSeAjbzdYTsgQZhKLM7xkOEF5/sKRA== 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=pUs2DrPQ483G4YzvDc/WjKUI+wmsntMR+fQHTJ74TrY=; b=TUKXfP9ZWsTrR+zhJf1APabnKcDNWgppeClY4qUlCY0+EhOdD+3032sNCoQXpvH9Ul5U1fvk6ieiLjJRBHei/3MIfyDk4jUDf4L4zjQCG6LcutZE2vIf1XPMq4V75KUrV3mcj5S3Z2LFu6bvBbNEQIvPBorzN/atwIeyAmvrUHGhuMIQk1utDhb8lXu+BdfHrkMN+alMHk8Cpt2aPVZKCM+k54Vxuh5fi6JPziI7JFUFA03MNZpMucjnXzv5VeMW9xc+RDGqBhq1pS+jTkoJUYPIkU9xe/6BL6xNrsTrrrFED5EEcKEY/2/L+Y2+n8KJh1aNu/hNHo3ANEgWU7Xb0Q== 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=pUs2DrPQ483G4YzvDc/WjKUI+wmsntMR+fQHTJ74TrY=; b=R9MUM+sAz1QrzLRukw4mSzhSi7GizesUH0xi2ZMFMLCqC+J5hQUyBC0eKJE+JfxUwE6wErupX9l/nyFtmbUtym7E630SAQ+d2RakHPdALAPFPPr3OVWHkRVN468GwXBC7i5vDxC+yqyBVQo7yasYVFcSOYmw6/LKEr4EjsiOPLo= Received: from MWHPR12CA0028.namprd12.prod.outlook.com (2603:10b6:301:2::14) by DM5PR12MB1882.namprd12.prod.outlook.com (2603:10b6:3:112::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.18; Tue, 15 Feb 2022 00:04:14 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:301:2:cafe::a6) by MWHPR12CA0028.outlook.office365.com (2603:10b6:301:2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.14 via Frontend Transport; Tue, 15 Feb 2022 00:04: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 CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04: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; Mon, 14 Feb 2022 18:04: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" CC: Andreas Noever , Michael Jamet , Yehezkel Bernat , "Lukas Wunner" , , Hans de Goede , Mario Limonciello , "Alex Deucher" Subject: [PATCH v4 01/10] PCI: Add USB4 class definition Date: Mon, 14 Feb 2022 18:01:51 -0600 Message-ID: <20220215000200.242799-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215000200.242799-1-mario.limonciello@amd.com> References: <20220215000200.242799-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: 8db77d3a-2d37-444b-55c5-08d9f016b39d X-MS-TrafficTypeDiagnostic: DM5PR12MB1882: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: hnktZX8JBDloQKdr93gMYT5knXVCw7Tx6uquaR9c97yTxph8pwjr7bqyjuzufVJgJbDIGargI7OzPQ7Is7dQvZdAg2EqqJ/gB2IMkxH8XMXPYohg/OInF+JWyETcoNYWPHULpa5a0PlHkoTtvsJNy2E2B1f4Wmhss4uttfa9rLsXd3Gbj5gh21nxj1hLOVAv9O+11KvtFUSP14e1cz2vB7mywZTvxTOr7YmYVhOQPAjrayBqTMOvqpPiHNmHzrYlVYZ+82tkbehC40JNKImLgA/QMGvbl06+GY7h55esP0c1vKvKY/s02YoNKfoQFqz7Jg6kfgj5IFkQeIMC89zxdL4B0RWq/TpgqJpnN/WICZHsZBeCcRSu4QMxAvisjdpDLs6bnP/CCWjS4hBv4zlJ3mcB3oWANUY573ekDjWJKiNq2Um7ZhwaQZmnpDO2uQuAowxvkuE0Xy7Pg2VHDrUuyRW2Ah6zM08LfhoFGAoIB73S/Nl8sjhST1WXYPG7SqSpaXLaLkG5tm/gg4azeL8doS/bFZBTOkAlCQXwmPL5j89laDHaklJDsYu/AecwJ59vg7XDAUgvMzv2CuVXnGouie+XdMeMc0ox/H/QdLP+iY+1nVlTxgLIBsyF0SkJQ/i9qX2jM83d6wkBUh3jWz5cqdA/EJaxAO1IhQRDWM4x7zaZiT1w56X/Vz8w6km5EZxU5JkqIc4YvjuvJQW4MKxZSQ== 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)(36756003)(40460700003)(2616005)(1076003)(186003)(2906002)(44832011)(16526019)(26005)(8936002)(5660300002)(7416002)(8676002)(4326008)(81166007)(70586007)(356005)(70206006)(110136005)(316002)(426003)(508600001)(54906003)(47076005)(6666004)(86362001)(36860700001)(82310400004)(336012)(83380400001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2022 00:04:14.1452 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8db77d3a-2d37-444b-55c5-08d9f016b39d 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: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1882 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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: Bjorn Helgaas Acked-by: Alex Deucher Acked-by: Mika Westerberg Signed-off-by: Mario Limonciello --- 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 Tue Feb 15 00:01:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12746226 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11457C43217 for ; Tue, 15 Feb 2022 00:04:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232035AbiBOAE1 (ORCPT ); Mon, 14 Feb 2022 19:04:27 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:53944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231996AbiBOAE0 (ORCPT ); Mon, 14 Feb 2022 19:04:26 -0500 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2077.outbound.protection.outlook.com [40.107.101.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5581A74842; Mon, 14 Feb 2022 16:04:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TzUqH7cZyo9iKW8KEdWZvCv9t7/ADTPgBVvH58VIAixf8O3jUe9i1OxmUq/4UY6zhDBldLlI0WhoC8VloVFeeTXtid9+Jvqs7OxRQCMWZU6dXA6lSSegldnQCR7Qh3ub73K/TbdMc9mfXAQv78tZ/Xqd5XuOXiTqcTYS0x9p/PXDiYgjx/v4ZSbjsRtc28tmoYaN4T4Cv6WDnuJfxudOoqXM8UFERgC44fq2LIO65ibZjNNrH99u0S9xUb58zAb9VWY9F8h1KIS+08T+TcVcijI1+qz9Ms86mqokez0/riGv6xBa6JP6NAcSxxfazOAkdUWN5pL2Nb+2LIFbMekzwA== 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=TnthCXFErxGiQUjgomwKrQPj8iM8+V8nPULwptxn0iqLbaHPldPFDRB+ZSj5wseKfk33NDn13ZOrGR9m9Nr3egQXi3zKrkbGa6kdmXPrSxqSPKVKogknhy+vUck8F0NwKhYFldMFuvCacGqu8eJZ1Z2q9ksfq4TDbTuxjMWMlI3t+cT9c7pVDsBBxgR3TNPURFgiMAHVS+mLPt084syXe3UNFvFrkxYO1ZIFb9S9gA18rrI2JjMIVaOkzoS8NsKmMRqJ60C9Dc1jdjQlpYwGDfDMDrfrbUoKOzj6kVuGEREf84tZMCXW5kuOdoHGNmjJxarZcORCgQ7wWb3UpwjDrw== 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=0/l6wkrJzPlHVr6yGGbwOWSRvM9rVNcUoAxG1IbZGe/XgOzFN9JF4sx2v+8PJUnFV2LoH7rjrOnBROwMP/bS+QMPJrZt9/RNZZhSSblerzS9Xbv2uU93LbN7rigAkVidkY2Z12NsnyU4/Bv2yrSRDHBaCkCY9QIME9YLwCDi9hQ= Received: from MWHPR12CA0040.namprd12.prod.outlook.com (2603:10b6:301:2::26) by MN2PR12MB4319.namprd12.prod.outlook.com (2603:10b6:208:1dc::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.17; Tue, 15 Feb 2022 00:04:15 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:301:2:cafe::8c) by MWHPR12CA0040.outlook.office365.com (2603:10b6:301:2::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.13 via Frontend Transport; Tue, 15 Feb 2022 00:04:15 +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 CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04: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; Mon, 14 Feb 2022 18:04:13 -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" CC: Andreas Noever , Michael Jamet , Yehezkel Bernat , "Lukas Wunner" , , Hans de Goede , Mario Limonciello Subject: [PATCH v4 02/10] PCI: Move `is_thunderbolt` check for lack of command completed to a quirk Date: Mon, 14 Feb 2022 18:01:52 -0600 Message-ID: <20220215000200.242799-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215000200.242799-1-mario.limonciello@amd.com> References: <20220215000200.242799-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: f3978f08-0c6d-44da-8829-08d9f016b433 X-MS-TrafficTypeDiagnostic: MN2PR12MB4319: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: hW542G2wyaydF/z6YxFne4hMw1TDKqvj+33ePdrrUWWPSjNjSNC6ABt/hUPEHol5l+SvtJlxpb17yOD3Vp1mjSmZdeixVx9z6Ohk3hmuiMMUtDaiML3c5IHpwTVDk4OSYmo6iUDzthLmO8BSyAt87ES+g/oiY4U5xV4yqlnXNgLZeCvyol7P4szliL/j618ESruulLfwmHScrxy5cxE7f8EDmyuuyNRYrTPP1GAxwuPaXG7vGCn8vD85YYm2HIR1T0b9xRTphrZfXNlOBDhHD4FD0YQGscPlQ+wUIX2WLuwUR0eLoCM36PVHapNGXey5OQTY5gqbgI00ZSVCCflXEF5cU3Yog4vvVAaY7wL3nmBfao6/+cY4/yb6iXYkpC9/Im1jKxAMTt3DqBGRj1nu0+ckwGHhYt+68YiNEBmXJdP7DtYI3lbXvD2sEI+6Eok5WR1jRjHdJyhQj4G+9MlXqHfO09nQqC3sePk9NrEx9v9Qte/+eNbIhJD75tvjeBL355eDtxC5P3QK5jHn7+CtGnmpUmQR9IP8wME/IjeEuBxrNzrWty1E+FI/KrmlB19Bc3ol9qqbQ1CcbHyXo4k6duh1S5J4LyQiNF6VjR04yKQhTS6IBrNVsE2dFeFaQTrwi6bwqgA310afnE73C87JJ+xtBilFIDsUya8wP2vKeJHeBBWfsEHI3yO8J0OEiRnY9hW3rpQoXiuN5IAVWyHedKKnFu+GyfxG9xjg9pLq0rY= 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)(44832011)(54906003)(16526019)(316002)(186003)(47076005)(5660300002)(336012)(2616005)(110136005)(7416002)(1076003)(26005)(36756003)(81166007)(82310400004)(70206006)(2906002)(8936002)(86362001)(8676002)(36860700001)(6666004)(70586007)(4326008)(356005)(83380400001)(40460700003)(508600001)(426003)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2022 00:04:14.9108 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3978f08-0c6d-44da-8829-08d9f016b433 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: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4319 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 Tue Feb 15 00:01:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12746228 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A637C43219 for ; Tue, 15 Feb 2022 00:04:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232328AbiBOAE3 (ORCPT ); Mon, 14 Feb 2022 19:04:29 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232160AbiBOAE2 (ORCPT ); Mon, 14 Feb 2022 19:04:28 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2046.outbound.protection.outlook.com [40.107.244.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0E5E74DE3; Mon, 14 Feb 2022 16:04:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=idfP9zzLlVbpcaQt/8fsJ45pGfkuMlzqlu9pUafTObOltm5uc38LOJKUSXWEl5TZmzddFXWIqhiYEIRK0sTkMhIHhUH8S7J2/dxNFeTsbOhjpSByAXQOgKPyO5fwJ3Mrz2nid/K5t7/I5vJzDxIwBFy9VnMIJ5KhUhrnSCU/qOLHsDcGOLEzb8RwsbMRMoS4ZUzT5xsjG1Qdw/evWlHuu5SKDHvTdCoVqFVin0nFR4K6Lk88nQ6laGb0PAu/Q+iDf3iT4NVr8CcRihWVFH4rNtE4/pvBtyMU0EACvR9R9s4tb/b5858yhNE/UQpuaTyUV5FaC9pYJuWyYM4h3EMbEw== 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=HVAtGBdhTr0nI9i7P/d3nAmXfs2p7P1Q45lR0BGzgGc=; b=Kleyc8Ix8IYnc4tLUTxtUpzi6g2UQdbbY+KroJgRSmwiwrZT/5liH3EXyv2YaisvjgD+S2nXLjY/bo54lHbdCPd5FrlO/kYCmeLKIi8N3Q0pS8UINJySH51LysNzyfclfqdR1BppLy6cWLHFIDGgta2ecJWWRB3s20UzWAK93dACvenGId2qDT2Li96sQNcjjTp0p+VSJX3E1JcjceB17eVhh56fqaWV0g/DAnBIBrhHrr5gGYts//P3JwQ4S6vSat+/qzANw8Mc0Tf1qu6UPhehSaZhz3PUuRw29s9qeP4yR83zfJ2b/gI1edQWxu/+Dj4rkG1tsJkEWQ6bYsfM7Q== 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=HVAtGBdhTr0nI9i7P/d3nAmXfs2p7P1Q45lR0BGzgGc=; b=OEAuS4XSmV9PerykY/9XUxfwiODrC7ViMLmSdU8Ln+gMhPcqCj8P4RLrt8lgmoVLVXXnTs2xFfqCzrGm4bJbXR1owJ1P3Q3lqj94B6XWH8NOGsPjZGpVUzgQs7lZLpGRKWKH0C1G2jasuMZpidzBAXH6fJl5NpN3uz+M3uzQoAI= Received: from MWHPR12CA0025.namprd12.prod.outlook.com (2603:10b6:301:2::11) by MWHPR12MB1360.namprd12.prod.outlook.com (2603:10b6:300:12::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.19; Tue, 15 Feb 2022 00:04:16 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:301:2:cafe::43) by MWHPR12CA0025.outlook.office365.com (2603:10b6:301:2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:16 +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 CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:16 +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; Mon, 14 Feb 2022 18:04:13 -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" CC: Andreas Noever , Michael Jamet , Yehezkel Bernat , "Lukas Wunner" , , Hans de Goede , Mario Limonciello Subject: [PATCH v4 03/10] PCI: Detect root port of internal USB4 controllers Date: Mon, 14 Feb 2022 18:01:53 -0600 Message-ID: <20220215000200.242799-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215000200.242799-1-mario.limonciello@amd.com> References: <20220215000200.242799-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: ba65af27-8c13-43fa-cdaa-08d9f016b4dc X-MS-TrafficTypeDiagnostic: MWHPR12MB1360:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WeKwIVssSW2binO3B6WwxmmeOlBwJ70yRXidbPpOJnQjBxtgg2HQbImRxv9eqWS8OaOejpUHYf2MJLV0z10hm2UmlLh+Wxl78s/sdOGyvi7FNHkAufGeq+Po98G/4otkottQ2Te8m+2KSLCHa58h4ba9cU6Lr/MZtcX1pxLUlJlAQLgVFX0OI4RXQcyuentcKSHwwZn45VhMwT/07Eh+6HLrBDorBaHzp4vOOvC4OsKvqjn7c1eQgEVISL6NdY1v2eNdEW+jpzm4XdiIFZnnTq6PjoElsYNFJ2lT/4W776aMkjPlJOZp/oqgIBq5yNoZWNm8ZkvlY36Aoch1xpyDEwW/9n90D0VDi1wp4ttIO6TgcHPm9d6nVl9/g3E1tvEvat7avL/VLZMRFQ+hHwfumwKexDA8mR2Sgw2Br9aoNuTRwFDAkMDtXAQdrTnUcP6EplbR3qIBdzO7xd+kcLB8KVA/jVuXw8qJ2+VySrDANN5gsxQDEv2uJWLfNl6zfkWmFcLc6qkjlEKyqp9hxf0l7iPqcZZEB7my08Z2OtYg3U5fy50UsQ34bAKURN7kCxER8JJsQOCx1cd2txzhb1CwmEBfTlyY5iRXlbHMyMssWhJz22jwSkSGdK03GjDY/7RWlZ3g9FSG1i9ESpYpIzGqqvz55FGcbNYIez2s8WMLPy+ms6eXvdKel4q29yXABEdA4w1XJB6lY5XkyGZHWnwnI6WOg9NpGvRM+WPaSq6z0VF4opKh1P5SS2Q08eQ1IDTASdP1A9Q2r2B4D7Z6mgHORKEktfg1w6LGrkq5lOvfRvo= 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)(316002)(5660300002)(16526019)(47076005)(110136005)(54906003)(70586007)(70206006)(4326008)(426003)(2616005)(336012)(8936002)(36756003)(186003)(26005)(86362001)(8676002)(1076003)(83380400001)(7416002)(6666004)(36860700001)(81166007)(82310400004)(966005)(508600001)(44832011)(2906002)(356005)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2022 00:04:16.2076 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba65af27-8c13-43fa-cdaa-08d9f016b4dc 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: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1360 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The root port used for PCIe tunneling is the root of the hierarchy used for all PCIe devices that are connected downstream. Tunnels are created and destroyed by the USB4 SW CM. So this port should be marked as external meaning all devices connected to it are appropriately marked as removable for downstream drivers to detect. 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 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index a42dbf448860..695dbd88b8b7 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c @@ -1335,12 +1335,21 @@ static void pci_acpi_optimize_delay(struct pci_dev *pdev, static void pci_acpi_set_external_facing(struct pci_dev *dev) { - u8 val; + u8 val = 0; if (pci_pcie_type(dev) != PCI_EXP_TYPE_ROOT_PORT) return; - if (device_property_read_u8(&dev->dev, "ExternalFacingPort", &val)) - return; + device_property_read_u8(&dev->dev, "ExternalFacingPort", &val); + + /* check for root port for PCIe tunnels on integrated controllers */ + if (!val) { + struct acpi_device *adev = ACPI_COMPANION(&dev->dev); + + if (!adev) + return; + val = fwnode_property_present(acpi_fwnode_handle(adev), + "usb4-host-interface"); + } /* * These root ports expose PCIe (including DMA) outside of the From patchwork Tue Feb 15 00:01:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12746227 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7F40C433F5 for ; Tue, 15 Feb 2022 00:04:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232257AbiBOAE2 (ORCPT ); Mon, 14 Feb 2022 19:04:28 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231996AbiBOAE1 (ORCPT ); Mon, 14 Feb 2022 19:04:27 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2077.outbound.protection.outlook.com [40.107.223.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50B4A75C2F; Mon, 14 Feb 2022 16:04:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HEyDvGVzALHNnMvdr4Up55or0/s/W3zqVaBuzHG+o4rTP7PxwL3XnRvhPgG/qOzf9S/mDPa+aq0Q+EgPTZNu8WqWv7HWojMWHcdvSzz6Bfed68/dGGkFAHIpvSTrw5VLy9eRhh+YmvE4vmy4vtwwMkbdYvFmWzACCCC8zMPzMmM+E4C3vfhcxDZXBirZ8bYsTnm4sSPSypKzJKsMiHwzDP5XgF3Mu3WCzXIBAqrKOG5rU1kap11QhcEGmrQW5yW7JxsPO0mLptK7/w+M8CT2boRb12VHx2+gqosq4jDaNmDCAjrOfbhhrBysgLlzoa4r4dUWuDZQKTdap1QJbttP6A== 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=DHM5UKATDv0xKSJDXCgTqORdpQMeR1biIgOSMO3LziE=; b=j5RU1bK/hgHC9ob4Ne7lcs0Vq4oNPAJY/QydN6KsxpWBky1z5Xz04AoHG0t6tPlobQsf+8VmZzga2HS6FgMU7mL6EtzMF1lOmIXVFY261Yk9pcLiEhlCBr/44/96DZrQxPig+lHHGlmztlfagGr3JBcvNbky5bXoB0cVtBU9C2Cn8aDDfvu8uT96TkcToJjXMMwBLcd6D+Ld/Ktm62PgnhYivF+UG+NWfcmACPYe4wyxi1TT3K9m/aqyuV6bXKl78G+g3H8M6vBDbYeRVyLqIc82hMUw9LFTWdN8UyeIGsnqPNzwjcwdOY8OLQuPoS9e0/bxVBoVs6t4tpz1CAB4mw== 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=DHM5UKATDv0xKSJDXCgTqORdpQMeR1biIgOSMO3LziE=; b=ciyBlECE22lNm/rtiL8XoQSgCK0ufKLTsFdDAjE9FT4rEwVuarKWnVkGUAlJW9KNV9t8kUxjENx9EM6O9rcyoMiAx4J2tN8zORolF0UrPhi/tM/qnurn4yjFEgmFW1IVT4HdFuiT4QXuDW5Vio4hAGqnFPFit8iDglxG5Kow0UM= Received: from MWHPR12CA0030.namprd12.prod.outlook.com (2603:10b6:301:2::16) by MN2PR12MB4989.namprd12.prod.outlook.com (2603:10b6:208:38::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.17; Tue, 15 Feb 2022 00:04:17 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:301:2:cafe::6d) by MWHPR12CA0030.outlook.office365.com (2603:10b6:301:2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.15 via Frontend Transport; Tue, 15 Feb 2022 00:04:16 +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 CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:16 +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; Mon, 14 Feb 2022 18:04:14 -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" CC: Andreas Noever , Michael Jamet , Yehezkel Bernat , "Lukas Wunner" , , Hans de Goede , Mario Limonciello Subject: [PATCH v4 04/10] PCI: Detect PCIe root ports for discrete USB4 controllers Date: Mon, 14 Feb 2022 18:01:54 -0600 Message-ID: <20220215000200.242799-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215000200.242799-1-mario.limonciello@amd.com> References: <20220215000200.242799-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: f15d4654-f760-4442-f086-08d9f016b521 X-MS-TrafficTypeDiagnostic: MN2PR12MB4989: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: Yk2HLJ7xznm+eAcQE6Cs5/Z8F+1YQQjxQchAmlERNwEoQu7aQLG64waJiA2f2UGNQVaEcjHslz76B+qSz2fe/WiIrUGcQVui3XAL9e+BjH8+wSIKPENP7iGM/davhjSJjl3GM7cIw7CWStitnI6x+n+O4SF0VT0G1o3TEUKQ479rzu6jBxpQ2L1DO+CbtGpBJVJL7/WEzx1QqbjvG9hsgILPpCca1Xr7nou5kkvn+M31BN6bkC49646ppEOXfHd7FKLlFpFsLfIzW8HVmL7diNwZq2c4VoM00ooOcXMJl19EUVaewS/t6SV3bNscensel4kPjhubyYNhpEh9PEYO/1hNswOmwyEcVHN0F6+bsGiTaVM8wnORrv5P6yh5cx5g0sWYjjaDagcaymX1cfSWCB0np6VHJHNBXKx8JhR12mX+TCp1A4lScfbOJwJBohjQxfBvhDTMrTetkX/wMXLKmdyU6wKDMGaRsIM2VYF8IKl1wWyDYgs3BLwqF4VH54m65rovfTpa7mWsD0wAJ8zCB502pBXmPNDuVoJXuNHKdJg8+bo9k+6uJTJNTKOB+aeeYdUG+cbPdMDa6i5yD+TcQsm7OaQP9TCKaWekuHjoKNpaH+tfSZUlW9FgXoiGfDr81hbA2XmnE62xgLLeQa1dy1v4oIlTVAUCIL4bkVYKP7h1up6dQT5vzln2SYe5d5T9GbE4hjO/bTFHp5zTDjFU5tvWJRDtOPpc2u2lYdnSoY+NdJGpUJxJKEom9FZtQSJh7681AFPp0amUrvNusUClKy/IMDOmpdn6DXpAbqbVw7M= 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)(40460700003)(86362001)(70206006)(70586007)(54906003)(8676002)(966005)(110136005)(316002)(4326008)(36756003)(5660300002)(8936002)(7416002)(356005)(81166007)(6666004)(2616005)(83380400001)(2906002)(36860700001)(44832011)(47076005)(82310400004)(508600001)(336012)(1076003)(26005)(16526019)(186003)(426003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2022 00:04:16.6920 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f15d4654-f760-4442-f086-08d9f016b521 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: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4989 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Discrete USB4 controllers won't have ACPI nodes specifying which root ports they are linked with when the software connection manager creates tunnels. These PCIe root ports should be marked as external so that existing logic will mark tunneled devices as removable. In order to set the external attribute, 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 | 50 +++++++++++++++++++++++++++++++++++++++++ include/linux/pci_ids.h | 2 ++ 2 files changed, 52 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 17a969942d37..a07859c8675f 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, @@ -1600,6 +1602,52 @@ static void set_pcie_untrusted(struct pci_dev *dev) dev->untrusted = true; } +/* + * Use the fields from the USB4 Designated Vendor Specific Extended Capability + * (DVSEC) for Power Management 1.0 to identify PCIe root ports that are for + * XHCI and PCIe tunneling + */ +static void pci_set_usb4_external(struct pci_dev *dev) +{ + int dvsec_val = 0, pos; + u32 hdr; + + /* + * Table 3-1 "USB4 DVSEC Header fields" says vendors can use + * either the Intel or USB IF vendor ID but should look for + * the appropriate DVSEC ID. + */ + 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; + + pci_read_config_dword(dev, pos + PCI_DVSEC_HEADER2, &hdr); + if ((hdr & GENMASK(15, 0)) != dvsec_val) + return; + /* + * Look at the port type field for the expected bits for PCIe tunneling + * and XHCI tunneling + * + * 0x0 - Native Host Interface + * 0x1 - PCIe Tunneled Port + * 0x2 - USB Tunneled Port + * 0x3-0x7 - Reserved + */ + if (hdr & GENMASK(17, 16)) + dev->external_facing = true; +} + static void pci_set_removable(struct pci_dev *dev) { struct pci_dev *parent = pci_upstream_bridge(dev); @@ -1870,6 +1918,8 @@ int pci_setup_device(struct pci_dev *dev) /* Early fixups, before probing the BARs */ pci_fixup_device(pci_fixup_early, dev); + pci_set_usb4_external(dev); + pci_set_removable(dev); pci_info(dev, "[%04x:%04x] type %02x class %#08x\n", diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 61b161d914f0..3faee1af9ace 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -2567,6 +2567,8 @@ #define PCI_VENDOR_ID_TEKRAM 0x1de1 #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 +#define PCI_VENDOR_ID_USB_IF 0x1ec0 + #define PCI_VENDOR_ID_TEHUTI 0x1fc9 #define PCI_DEVICE_ID_TEHUTI_3009 0x3009 #define PCI_DEVICE_ID_TEHUTI_3010 0x3010 From patchwork Tue Feb 15 00:01:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12746231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 33B6DC43217 for ; Tue, 15 Feb 2022 00:04:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232336AbiBOAEd (ORCPT ); Mon, 14 Feb 2022 19:04:33 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232346AbiBOAEb (ORCPT ); Mon, 14 Feb 2022 19:04:31 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2064.outbound.protection.outlook.com [40.107.244.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68E767A9A9; Mon, 14 Feb 2022 16:04:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JEg1KBtZDVVqnv8RV4Z5K8bjWDQguV32i+NYqLQT9LODEKGRcs4U5c/a6T396cX3LzrkWXZEtUODARYoo2NklNMDs/2xh5Nmxdc6NoneOa/Shkuonla82tAjyi/EfAwKQDIIyUe8ZO4hZbqIwnv99+wBvG/qydrnGmKgT+pAXJnsdlc0TYp0KdEa624OKFzO5HJVa1Vf6WwUa6ZuEBt0duOhIJY55cPfk7tRiOrYW9+8h3yFlpqzR27a9Suw88aAXyjj9jVQUnXbA6nD/NAkV3gkxgiBpYYpI51SNAHEc7DtoSmnL21ovRAVukhiptYxOSgnxDaxnnaCCqCpVcO1AQ== 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=XeE83JfgHgB/32cif9l8AB48aQIpSH6VPWc3bbjjKno=; b=XqKGedUkYbRHj+ztiZLWQWPNuuHebIPJ6bup5q71Ohv8tl8o32P/FF8CxMO490np5sWnynljMW5vta0gxDPMtnyIV9snIBifNmEGYNh/8KdVZWyV1OZRKaZRyhizQMonRzAFs8KdnYgDTJYYhiX+mIBxhK/J5ItGP3xp8K6lEW67WzbQybl5I32Zi7xXwJQqjgrDhUQjJv9+iv+w28iLl5As5af7BT9FcowBG1laYy3aD6Won0JU8kek68Clc/VEMOQ2DVOQ403eoRf4okekyG7gvEiIP16kK/Zg1mXawktVKGmIvF3JsqBtG3SVoSYA+40RdnxUcvruMsfsEQ9KlA== 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=XeE83JfgHgB/32cif9l8AB48aQIpSH6VPWc3bbjjKno=; b=GmdU8u4CURVfN4F6m17gXjsQfvlARVNJN3oXOmNYBuXrL2B1BqPbzwBWvWCpZ4wcEGAVzji1PXxboI6vuZdx8XjiDtTbePmNecmhPO8SgR0mh+dCNHCmlB4w+i8jU7ZeZYU7bN+zE17gTfAFQYsXHhwN/TdoiQ6FhWPqB6ANPXs= Received: from MWHPR12CA0046.namprd12.prod.outlook.com (2603:10b6:301:2::32) by MN2PR12MB3550.namprd12.prod.outlook.com (2603:10b6:208:108::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.18; Tue, 15 Feb 2022 00:04:18 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:301:2:cafe::e5) by MWHPR12CA0046.outlook.office365.com (2603:10b6:301:2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:18 +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 CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:17 +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; Mon, 14 Feb 2022 18:04:14 -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" CC: Andreas Noever , Michael Jamet , Yehezkel Bernat , "Lukas Wunner" , , Hans de Goede , Mario Limonciello Subject: [PATCH v4 05/10] PCI: Move check for old Apple Thunderbolt controllers into a quirk Date: Mon, 14 Feb 2022 18:01:55 -0600 Message-ID: <20220215000200.242799-6-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215000200.242799-1-mario.limonciello@amd.com> References: <20220215000200.242799-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: 3a47bacc-5837-4e01-210e-08d9f016b5d7 X-MS-TrafficTypeDiagnostic: MN2PR12MB3550:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: KkoUKbjZcZo2hR2it9dTu9ymTpCTPkAfDAwsgqX8IWM16hZnu54YSK1fN52dyxpSZ8PGW9PshqR2sfkTf5kRqMtogxXjL99awStn71QJCzrYeaveGp3wuOAhHM4142/Pb2xU2Swx+S1ktzyBNFhpnF4f/aXtIT20swSdGWYQ9kjBD9vA87LNgCfCHcxjLodoRmvylFXY4DgYdP//0CCnxvgEhJYY59BZJGhC6WxbOfY8K8egER/ojfthdz6cUGLN7BWqX9c3aBvv2JtqH/Y/B16kcE3r3XekK676EqogMPYOehHaWf0Q1duIcBgHnCGupcJT/ZiQi6YbHVlnoGdySF72hNJLm4rztC/S6AnqxaJWXQpsBFs6koUgP7dsRBd8k1aC9kh9dow7fnNW9ls/FgOfNjFvDb4TdQAa0uDabHbd8DpXXr6vo+rcGgbN6AxFtKsYfeNdghu/uMJIrdopx7DDh3PPH9g8obKpYfJqwJvtoM31z/tMOhmLtMADrSFg8vY8p7PEahprTs/pCf11c7Do/gdkCXWVYgA6jvi3M00i6XW/3j0WD1CCbUzWFIIRTsg2BOalqTxjV4J0z+Z/4OO3Cgk/tekUQZSiE+ES/9r7aYmyoD294/7Yuzkd2yquRLhg7S6IHsRd53j42OJ0nCj1cF1n5Tgnlg6U1Te/pRuW4ooCCq7du/J1eqFRtbdBns3Quod7g8EUX6vrToVH3tUdmYjmuP241khdG33tXyZpORGAad7V99GTKPO11h7q 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)(36840700001)(46966006)(40470700004)(54906003)(110136005)(70586007)(19627235002)(316002)(508600001)(36860700001)(8676002)(47076005)(4326008)(26005)(1076003)(186003)(6666004)(2616005)(336012)(426003)(16526019)(83380400001)(36756003)(45080400002)(70206006)(86362001)(81166007)(5660300002)(7416002)(44832011)(8936002)(2906002)(82310400004)(40460700003)(356005)(46800400005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2022 00:04:17.8794 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a47bacc-5837-4e01-210e-08d9f016b5d7 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: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3550 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org `pci_bridge_d3_possible` currently checks explicitly for a Thunderbolt controller to indicate that D3 is possible. This is used solely for older Apple systems, due to a variety of factors: * Apple used SW connection manager from the beginning, other manufacturers used a FW connection manager (ICM) * Apple supported D3 initially, other manfuacturers didn't introduced this until the `HotplugSupportInD3` _DSD was introduced in ~2015. Apple has stopped creating new machines with Intel Thunderbolt controllers, and all other manufacturers now support D3 via `HotPlugSupportInD3` so this should be a fixed list. Suggested-by: Mika Westerberg Signed-off-by: Mario Limonciello --- drivers/pci/pci.c | 17 +++++++---- drivers/pci/quirks.c | 67 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 9ecce435fb3f..01557c950c9f 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -1064,7 +1064,18 @@ 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; + + /* + * This is for Apple machines via a quirk + * Non-Apple machines will use the ACPI property with the same name + * from `acpi_pci_bridge_d3` to indciate support. + */ + if (device_property_read_bool(&dev->dev, "HotPlugSupportInD3")) + return true; + + return false; } /** @@ -2954,10 +2965,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..97793cfcd8ff 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -3756,6 +3756,73 @@ DECLARE_PCI_FIXUP_SUSPEND_LATE(PCI_VENDOR_ID_INTEL, quirk_apple_poweroff_thunderbolt); #endif +/* + * The first machines supporting Intel Thunderbolt were released by Apple, and + * supported a software based connection manager including D3 support, as far + * back as 2010. These machines don't have ACPI companions to declare D3 + * support. + * + * Other manufacturers introduced Thunderbolt shortly after but notably did not + * support: + * - Software based connection manager + * - Runtime power management + * Power management was handled via the BIOS when nothing was plugged in. + * Runtime D3 was later introduced in ~2015 and Microsoft declared when the + * `HotPlugSupportInD3` _DSD was present that they would support D3. + * + * This list is expected to be complete and not grow in the future as Apple + * has stopped producing new x86 models with Intel Thunderbolt controllers. + */ +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 Tue Feb 15 00:01:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12746229 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47557C433EF for ; Tue, 15 Feb 2022 00:04:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231996AbiBOAEc (ORCPT ); Mon, 14 Feb 2022 19:04:32 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232339AbiBOAEb (ORCPT ); Mon, 14 Feb 2022 19:04:31 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2070.outbound.protection.outlook.com [40.107.92.70]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58BE27A9A4; Mon, 14 Feb 2022 16:04:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gQnpfNxVBvelqkyVnu5vU4XpnySVucBDMGVII+FwNDZQTxHgCxMdTxsZwgmsHmC6gVXaijNxukiZkCOWcJzJiGHy5vONuVJGpUCYi0qOgVm24/jxe/USsOxiGyG7qMEjSJjqNJIW6EsvvWf9t32qAIM0RHxlM4yqqL4ONx5kAL/FzjQzj/uFqwx3C8iAi5QlHKjoMJEvO8ZGy+tvw3E4/KLqlSoZsRNI5Dg9E/J4fU6NoZCv2ZRBekbVR0JQMzKvifNGHouoAXjcQ0DoASm1oqNOqajV7ITJmRyOcpy7i9Q3M30tb+h6DsxMLD6SxOPdrkAs0TxFIyjL5IbwfOJEzA== 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=efh9YeuFWpMrxh5YIDlHa6hvJsEsw/+/2ZVDNnREI14=; b=OsH04J5VlpExUMEux1qMVCwYbjWsy/ToVIxgXydLonl2TY0yp//QzqENyn3rpeE7bOVMhGqeaAOlZrb9f27SudGQ37hlDP7cNFCP/oZ7wY6f+KED4wDzepFoUUsd0DQVi8gp7OyNicyS2RjmenyNwMVgpZx2qACIey9Ye7Q03Tka6INnyNk+itApT1483Qx9g05dZtrGL9ZV6zc9Wv3YOSjhCXIFgfgRbK/D5lDNz4AX43XcrljeweawHTctqK2705fwBKGZONTiYwCVud28L/SRN5IhDrhtNuZ0AIgY8ZEsJGRJNwEBlIxuvKoW17mlNJ8lbF/7ISS7STeiXb1ZYg== 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=efh9YeuFWpMrxh5YIDlHa6hvJsEsw/+/2ZVDNnREI14=; b=nSY/yFtuav58gaWOomq8+s1Xbkf+Eo9fSf3rW9JSlm0ecpdWqz20UrpMiRwp/rQ5K2ZwfjdM8ibzMe6OSaO1L/x0w7HpOrH5l7eSnHCjJNy5/RqCNzbftjEfLPehV2BheelInYf5oo7siCTPTFRCCfz9czNPdvzUgksLB9ZnjHg= Received: from MWHPR12CA0044.namprd12.prod.outlook.com (2603:10b6:301:2::30) by MW2PR12MB2538.namprd12.prod.outlook.com (2603:10b6:907:5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.17; Tue, 15 Feb 2022 00:04:19 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:301:2:cafe::72) by MWHPR12CA0044.outlook.office365.com (2603:10b6:301:2::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.14 via Frontend Transport; Tue, 15 Feb 2022 00:04:19 +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 CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:19 +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; Mon, 14 Feb 2022 18:04:15 -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" CC: Andreas Noever , Michael Jamet , Yehezkel Bernat , "Lukas Wunner" , , Hans de Goede , Mario Limonciello Subject: [PATCH v4 06/10] PCI: Drop the `is_thunderbolt` attribute from PCI core Date: Mon, 14 Feb 2022 18:01:56 -0600 Message-ID: <20220215000200.242799-7-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215000200.242799-1-mario.limonciello@amd.com> References: <20220215000200.242799-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: a25325dc-29c6-45be-ed84-08d9f016b6a8 X-MS-TrafficTypeDiagnostic: MW2PR12MB2538:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: S47AP//RgwiWtohUy5gU9dz+OXPYO/dtRr9V6VV+6IisI99K1uuzklvWGufMlg4qG8jQW+OvDuFMEHOzax2fKGNTbPbHlBS4b7kd1G50PEGDItwkCZ/YEA45PVil4D8CoQeOLpvD1G6vYsnnmb+LrZPEQ6m2IXzAcRjl5aVfrj91n7cbh9aMTTBQycFNEwxaS+5GIJpxjxEFKDNBOJVbHX80GL4ltmbAHNrTm42m6BOXJqKYpaTDI7vjJBuQH2txGR3E3gwOfY9Cka1w5v+2Xwykc57rKVSzGiGr45KqBcSJHoQRxghghYnZ3aF3YWzGa7B6nlRAdxLCaXQFVW1EXmx5ywvPKy4q29/XQFP2IyJi5xFYL5Q9lEYXiyS/z1+1oOgfo0YKpKbYsQG4DkPBcpLuhLVvwdp2g3eHOXC6496zc7jH0nnrvvKltr9o/XOaui6yd/UT8ZZFSD5VCHT0Mx0wxL6ESIWCuDuaCZNXIAhfW27ohfyMgVr6H6cVZIYJ3xKC1QHxnDwzf/9LvQVuFFN2FfvQUYd3aP45KOImxiGuXiq6ieHNKE0GmtHKa/Mp/X3rxrf8abS3QfxBn5wTuB5/L4ccZWw4mbYzd33Q4gzOTQ9/ZRk5OzMln7micP3+3DxXllbjJuC0seP9mAxIfx8gFxlYwJANTlzvfV/+KmwhoWjH9hYP7R0NOcCPQSCmsMJ8lnwTSdTy8Jg2cNAUr6p5dDNvd+bC766X4WGx8jI= 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)(8676002)(47076005)(70586007)(6666004)(70206006)(36860700001)(2616005)(83380400001)(508600001)(1076003)(26005)(186003)(110136005)(54906003)(4326008)(82310400004)(316002)(2906002)(16526019)(336012)(426003)(44832011)(7416002)(86362001)(36756003)(81166007)(356005)(8936002)(5660300002)(40460700003)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2022 00:04:19.2544 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a25325dc-29c6-45be-ed84-08d9f016b6a8 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: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2538 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The `is_thunderbolt` attribute originally had a well defined list of quirks that it existed for, but it has been overloaded with more meaning. 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 | 2 +- drivers/platform/x86/apple-gmux.c | 2 +- include/linux/pci.h | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index a07859c8675f..fe49175770a1 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1586,7 +1586,7 @@ static void set_pcie_thunderbolt(struct pci_dev *dev) /* 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; + dev->external_facing = true; } static void set_pcie_untrusted(struct pci_dev *dev) diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index 57553f9b4d1d..4444da0c39b0 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 to_pci_dev(dev)->external_facing; } 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 Tue Feb 15 00:01:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12746230 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A836BC4332F for ; Tue, 15 Feb 2022 00:04:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232339AbiBOAEc (ORCPT ); Mon, 14 Feb 2022 19:04:32 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232336AbiBOAEb (ORCPT ); Mon, 14 Feb 2022 19:04:31 -0500 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2044.outbound.protection.outlook.com [40.107.94.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF0597A9AF; Mon, 14 Feb 2022 16:04:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lMb+6XIZOwz8L2seRikZvYTke2K98XTmKguxRkPTLekwh4eT9rrZ/xaZzjTy9tMikcjTQX7CgT3+4HhCWC02VpI/49k8RCbyH2k8k9pd2hnO0ew+a2MpMCHXBdWFwB9JBMM5xWUobpnN3BRwIdWAZqyokKTFoDRQF8UDENL9j5eRUMJ4WNJdjWoVSpuU1d3aWTbWgCs9w4ynQyHxgEn7QQCjqm1JOoRQIedlQRqRiwRiy2gaKAcPtvbLVORc7cWay7N0uoiG66ePtGKtsDatTO9ZoeDEMRl/EVeiDF7xCJBOpNcIyCEvax+JefojiU/dTLlikHiQrsagTt9C/s+PZg== 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=TrFGLsMEyeQx+UTNBhDF6lrT4DQcgx+EE8yesIRPN42MQ1VY1i4QSXgbpfGCkZe5XvI7fHwJK4+/WN3IbZJXLCv6kjka0MISiYdhBDnRBmOL3MhYMkv99TsUHTxUSk00VplR1sUrdvw9q1wA2U4QvhmG5AM1hQ5fYNLUgXybyzohztYXoLbugqku5jxF35aXTK48fXpFMzeDsssvIaAZhOcGVY2v9C9URUZIaa8I2CRIvm6hqmEm0IyRtExePBxlPMAB5PlcO3gJ+j38F4DFnry1OYlzko6mKiOus+DnQZ5+n4R9glkGF1uCJo1Qsi8uRSdi1S7LgbBUUL2YMmWneQ== 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=Z1q1k/D8eJebdqP+EGW29Y/6sQk3OaDB7mChuhNMAjqwxK098h0JJ74grEUfhoU1AnqNycpvTWNyaZsUxpoLhfvdWA0fLNH+zR1kN8HJyuVJ3QLdhiVOAKY6RTcESabMJmNveaJCi7z6RA0jEQxIfuPbbON7BH4Vos5O3hCLYMs= Received: from MWHPR12CA0039.namprd12.prod.outlook.com (2603:10b6:301:2::25) by BN9PR12MB5209.namprd12.prod.outlook.com (2603:10b6:408:11a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Tue, 15 Feb 2022 00:04:20 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:301:2:cafe::b0) by MWHPR12CA0039.outlook.office365.com (2603:10b6:301:2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:19 +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 CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:19 +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; Mon, 14 Feb 2022 18:04:16 -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" CC: Andreas Noever , Michael Jamet , Yehezkel Bernat , "Lukas Wunner" , , Hans de Goede , Mario Limonciello , "Macpaul Lin" Subject: [PATCH v4 07/10] drm/amd: drop the use of `pci_is_thunderbolt_attached` Date: Mon, 14 Feb 2022 18:01:57 -0600 Message-ID: <20220215000200.242799-8-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215000200.242799-1-mario.limonciello@amd.com> References: <20220215000200.242799-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: 876067ce-20cd-417d-c12c-08d9f016b6fe X-MS-TrafficTypeDiagnostic: BN9PR12MB5209: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: kk2P+juuQEP1Na60Bb5ELSQp1ELRyVpVZbnC4cOA1++18HpARLJ6lxJz8PxpChXllgAGGg/xolbKRPQxWR0fHPiPKuiRWdIHq8g2dcUQkhY9UPOHTYLhvj3ExzrO+BuNEKNrp0tuMAI3zr3JoQvbkl1uzULFN4UfhIB4V5t+98WSOj4n8pVOy5g8d2AK52ThzC5GVKXJzN2P4l2U87HptrXYbn8xHlmQ0LXCS3uODsscGGCNETyOhqWXToUnBJWt/2XMJQtnAn/QZPIguOMbX5oBOAL5ZH+QNqMwnmhxW74LDJBVaUho9qvOeVlUvf9si9jcn/k6+BxMcW9+5lvff/u8n8rBNWZ2RGk0Ub9xv+GzZ1s+dUr6/xgbN58wp6wDrQU0gNxNd6gJfb9M2Y3v3fbNSR4ZpfQlMzoYHcPf+gcaZfEHWDqkXY3wL2vBEAx6+EpvpCtY/rMv29/Hl7gnwAo/PqlVL/7G5DzeluqT5emCMhzGqckpuAyOHZO3YSo0WDuPXRT22n5422FrOdQtJTi39PEJNBoy3cdjommWq2eqqC4oLCp07KrY+zYmTTwB0Z1F8FXTS9TpNwJ+jpHNx/Q+EECmw01+9/qIv42/ro4N8MZfC9dyCm+Zp2iL/OVVnNhbGO2ZTIHTOYQ8HxqiQvH2vuHCnNpFVMDYRhc1f4L+a8UwSs0hbrkfUVjQKuV7mns1nfT73Zek2Exv4ND0yBoumURNo182p13wJBAKqwM= 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)(83380400001)(36860700001)(336012)(426003)(86362001)(47076005)(356005)(82310400004)(40460700003)(81166007)(16526019)(70586007)(70206006)(2906002)(1076003)(36756003)(110136005)(316002)(54906003)(8936002)(44832011)(8676002)(5660300002)(4326008)(7416002)(508600001)(186003)(6666004)(26005)(2616005)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2022 00:04:19.8169 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 876067ce-20cd-417d-c12c-08d9f016b6fe 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: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5209 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 Tue Feb 15 00:01:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12746233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCB32C433F5 for ; Tue, 15 Feb 2022 00:04:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232346AbiBOAEg (ORCPT ); Mon, 14 Feb 2022 19:04:36 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232358AbiBOAEf (ORCPT ); Mon, 14 Feb 2022 19:04:35 -0500 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2085.outbound.protection.outlook.com [40.107.95.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB9107921C; Mon, 14 Feb 2022 16:04:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jAQTTymP/KarmpHKxOw/sLXh1sALFVbiQBtKd6ug4V3u4OxK2/nFIOd3ZTUQHh6D3uiH6yqfZCDOr/H4rZxWAfpFAwsHQ1RaBLnpPubdS6w9pulauTMcf7ya336W4SysD/jcAa3p9Ng1s3KQrgHdIX9+HvUTjic0mN/K5PlrS1oMp2Xxi6kSeDIGmR7d/grbVjQr0RWxsj+Rgt9iQT28l9P7BYSqP68EkzVX44MuDfIXyv2QAm1dZWs8DFBwegyi0ZcR/ayFPJsMR+154R0PBnbsguDpBYG9W0eiFgvlKMTvuXHjy3JTV9HZ9JgMdpvGnQtS+q2O49EjoCBEG8MqYg== 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=S5TdssPVBVqgjcE3DNREbYMMWGNgPOwUCoucI9qBhjW92wTuCi73ArMPpe8xbTF4W9DGdgb7REsVxfV21FmHsXGmP7NiuFrip7dGkIqZgSMvf1PgShH9Fulel54FUHjzsp+rwfGK8B0NDtfEPR02Ysv7ZyzILd82xxS6Ds7V0fOHMhjKq2LOVQz1Baoi7wWC6Poz04GMiHrxO1bPZxW1+9o29u9cBJ+h62P8ojlYGzUARC4WbiHtspGweXalPtOneKkAteyzskAhQBYD/j50ANTe/SY7953ttAtT3LTdXb/yaeAjuY34zUqtpF/8F4Sbm3cM5xtTKJwL95yT4EdUgg== 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=ouwfa662AlNp8R18fg2OQNb6vBJvk0c59RSFe3rzyyuFxYSxOj6X+QXsBMAu3B6tJo6IDmZO+Dv63HOw0AN55MNYbKSrPTF2oiGbbXGJ1VDjkogPplfYt4Trbnil04hR3VTVJFYDBePXCmpdOC25S7Ptv4wODPVIx04q8V9cZ/8= Received: from MWHPR12CA0047.namprd12.prod.outlook.com (2603:10b6:301:2::33) by CH2PR12MB3927.namprd12.prod.outlook.com (2603:10b6:610:2d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.19; Tue, 15 Feb 2022 00:04:21 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:301:2:cafe::c8) by MWHPR12CA0047.outlook.office365.com (2603:10b6:301:2::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:21 +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 CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:20 +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; Mon, 14 Feb 2022 18:04:16 -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" CC: Andreas Noever , Michael Jamet , Yehezkel Bernat , "Lukas Wunner" , , Hans de Goede , Mario Limonciello Subject: [PATCH v4 08/10] drm/nouveau: drop the use of `pci_is_thunderbolt_attached` Date: Mon, 14 Feb 2022 18:01:58 -0600 Message-ID: <20220215000200.242799-9-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215000200.242799-1-mario.limonciello@amd.com> References: <20220215000200.242799-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: d19e3263-f4f8-4a3d-cac9-08d9f016b7ac X-MS-TrafficTypeDiagnostic: CH2PR12MB3927: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: TLGXfGOFImTbRs+KsvskQ38TamAjxZwB9IySlRQQccvNLpiclyS1o3sYhg8DfrLYo0zePT0/S38k2h++iUl0JU4xeXhZe0uaHLlN9oXtjL4b12Srji28qMbkNZD1ix1Yc9NdUJ8SK0ysXb3CPEQuXBbnOSoiPqlv+ndKUkye47jhOFZQr8Wqw21X7x9gT2zhFVjbNlyFJBvFzlJPpPDvAMEDjEghRO6IEeWfuyfRW4ZQxi9Q8I+niDsg7tjn8fDZW0E/Ny6qGhUpW680EwYokONTY7dfx+L11LXmK0KzZxrnuhgKQJ0IxrX3mTZRaazsYKsOuN5Ub+YC8peiEJjO7pbFUvjEKImU0FKf/abdIVdjWvJm11BLvYvFsHy602hKI5XcWhHPS+ONyx5BirDBSD67s8RTAGgETEzoSmhjftQnjh0YX6wltRaC4QwvGVUe1q+oQaExfHpbdTnyqOPjA2xc8qYKxVCiTenPpR5FlQCqE2QPwzO+uqHAv6tHOLR3kBdFgix/m/92CyZumpSJ78G454OB70V1f5z6+xEB84w7yL7k6t7AeRS5oFhsL/h7r/az2zKJNNkTGRbx9QLC7e8vHAGJNbIMcOp1XvAgZl+pLpjVawXUcE9fFus8TDr/nDP5tmlpOzzlQWYv9thyilUbwD12/GhKj7acn3SolDVjjXpf3j4nUeBMBDCZd+97jrJ6zDCNbrsQdtkH3fFGFxe9mahZ7ZGclDV5n+I01Kw= 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)(36756003)(5660300002)(40460700003)(2616005)(356005)(26005)(1076003)(2906002)(44832011)(186003)(8936002)(16526019)(7416002)(8676002)(4326008)(81166007)(70586007)(70206006)(336012)(508600001)(316002)(54906003)(110136005)(47076005)(6666004)(86362001)(36860700001)(82310400004)(426003)(83380400001)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2022 00:04:20.9731 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d19e3263-f4f8-4a3d-cac9-08d9f016b7ac 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: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3927 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 Tue Feb 15 00:01:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12746232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E3E0C4332F for ; Tue, 15 Feb 2022 00:04:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232360AbiBOAEf (ORCPT ); Mon, 14 Feb 2022 19:04:35 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232357AbiBOAEf (ORCPT ); Mon, 14 Feb 2022 19:04:35 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2057.outbound.protection.outlook.com [40.107.244.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55BA17A9AF; Mon, 14 Feb 2022 16:04:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B7SDydtPsm8NwwlhElWLH440O4nJKOpENInPvCKt/YhN/d6eMKLt2D6HtlTWCmDAkn6GNYvA1V36m9cbiCLTwkCWfJsz4e/X1zqUoXEcZ3+muPFw8/ZSveaPhd9xteyJr72n0YDdSDIwlvuEyrpDppRfimRSZM8Zku9d24BTxa7tOFOVhNr/TPm235KXFqXGuI4B2r4YHWfUrtP+X3eJQOUkDAmESkMECdEcurs0W7CAct3iP9Fg8GHU4vRL3t2tSOkcjpciij+6ncjo1a5l7VRlmYqEcRiwhaKxdmBrRuAf2OB+xenWJXOYI+kyOig3bxPO9XXUIWHuy2rnQGL0bg== 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=avx2os7OBH1D98HtvZ8ehIl/WHaqLbfKmbd25pswlQt06kSjf2/UBoMxrpsLPsM7iuTkU7MCOeplpnak6VHF+OsggoqZHsvOFPQryr51oUdoUhWOY82CjcCF1/qaDW/R4U8DrgeznLEEppifmWn6EtW5vMPHtIXBbZV+x5zGy7vm85A8GnmS++w1uSjHcfzPfaoZ5X9ssUgafOcltQ7neXWtpgClIYuBOoLDpfVa/PtKdPmHfYAZvIa5HkvoGmu5DBJaJCKI2ZnEC40yssd58ZVntU7R4ll6i48zqi2ATZCDb6vvD3AcU/nz6q5k9D07r483s/619Hk/t+L2qHCisA== 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=Lcy08OtthC1oKd6/6J7dRb7xsUE9+yos/MAG9XiYU416Y1mu+o3IDIDX/dCMdBxUX76312Y1LsVYX04Pv0JP1ekdjO0U1A7NL61rISSY/ahcXNnjPmHdBntML/YEscEW6oqFhY8nL69grJZEabzuRW2RCVKnxHVoPY30ptlCdIs= Received: from MWHPR12CA0046.namprd12.prod.outlook.com (2603:10b6:301:2::32) by BN9PR12MB5307.namprd12.prod.outlook.com (2603:10b6:408:104::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Tue, 15 Feb 2022 00:04:22 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:301:2:cafe::65) by MWHPR12CA0046.outlook.office365.com (2603:10b6:301:2::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:22 +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 CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:21 +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; Mon, 14 Feb 2022 18:04:17 -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" CC: Andreas Noever , Michael Jamet , Yehezkel Bernat , "Lukas Wunner" , , Hans de Goede , Mario Limonciello Subject: [PATCH v4 09/10] drm/radeon: drop the use of `pci_is_thunderbolt_attached` Date: Mon, 14 Feb 2022 18:01:59 -0600 Message-ID: <20220215000200.242799-10-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215000200.242799-1-mario.limonciello@amd.com> References: <20220215000200.242799-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: bf652107-504a-4938-c1c2-08d9f016b847 X-MS-TrafficTypeDiagnostic: BN9PR12MB5307: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: eXXYW+k/WOevwzdz4z7+mhwJxqCctucaWkfR4WqQynPxOVi1rTGv42iBQLB73x2BOkmwz9rfMN9uXQYMMFqS+jstE4Q8mcFiq4dZhFKlm/wr4ox0sIVQahZwlstENM27W5dgbCZ2PhQhrw+266UZ7qZPGPvy5p+g1pGPOiVg1K1y6nhfsaQp3jxPyfFYKw7NqIiF2V78jlwUOWo+vjLsegfw+Jd7Cq+ZooaTdsVK5fjozvR47Y47tKzcFIE0ALJlqYK2goRjzsxH1hhBL5Os7ii0junstZ39irUO9S4fRAoIhZ48mcF04HAlQ940Yh25pcNqMi1iV+eTmPO/Hht0bsQjvQ/MRAttUrzbIIhOC99UzYO+gca4ZfGWynz54mq1HkLK+V0xadaJlS2DBCcupAmc24NpZmRHI/1xWxrDVVnPaS917ErGDhcs+WPvEvF9ladY3nCqZURbisGn/XFgV6m9xFhawW/If0PSPqG8L+Fl8zSTX+Q6JmTMl65Te2DLqCT9U9eTvfCji+A25omrNisBg5AopsJ507JNphMAhKPh7zEfThZHWOKNYavG48iSwC7zt4c2rIa+qxMuRSIbESt+Q4atVMlmGuDZ5haED8l5sP/4Kaw1hvHIgjJbNfsQorG56pd3xv3aVXgxyM7pwRu5mW5FxonlNgitMC1qj2+Bz/BLrJzGXpvzloxJUqIU1KOecefyMxvRu1hMxLqK4d40gU0DAito4WF0k95RVQ0= 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)(7416002)(5660300002)(86362001)(81166007)(2616005)(16526019)(8936002)(186003)(26005)(44832011)(508600001)(82310400004)(1076003)(6666004)(356005)(2906002)(110136005)(36860700001)(40460700003)(316002)(336012)(47076005)(54906003)(36756003)(426003)(4326008)(83380400001)(8676002)(70586007)(70206006)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2022 00:04:21.9886 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf652107-504a-4938-c1c2-08d9f016b847 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: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5307 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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 Tue Feb 15 00:02:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12746234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4800EC433EF for ; Tue, 15 Feb 2022 00:04:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232366AbiBOAEh (ORCPT ); Mon, 14 Feb 2022 19:04:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232363AbiBOAEg (ORCPT ); Mon, 14 Feb 2022 19:04:36 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2088.outbound.protection.outlook.com [40.107.236.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C65627A9BB; Mon, 14 Feb 2022 16:04:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QdgdN7h2PgDth7zICPStagOzypgEU5198WUJa8n2PvC353IsVqN4vyUeH3mCHVwomSSnW3upzQQlT8aG88Gq67js+l0r0Pi56/LFVwVUWEcWsKUHhoD1NzL981CnjPgw3+wHjGZcwSH8ZkGxQxIqHt2qIFOzZSzluvn7LM95+goW5nxCm9f97azFo0nDpGBz3QYCShR+YBSMTjFA8+3V6vxJD6/VZW8tvjMSPR149vOjkiH9QmHfIVBC/7RJFLezIP3sYoOh7xa3wTqUIZqkuTqbewHjVlw9/PPT5gyfIerT9M4gH9zqJI8a2pGB/WV0Jdope/R4iXd/U1mjQ3p8lQ== 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=Im5nUSC8vLb/k4c49Tt1AGH5EXWfZOtNq5NRIiMeZBY00GFpDtniojrDLkRCRgZ8VDdICyPc64cZ4dLZWN5BizNGLwySpyioLgDmtVMjZOwklLci0ELkDG2GFLdqeK1dIm4wlshshUGjNuozHDiOs/EqAlTk4HY/t9hRO6JK7FR6U/z0lgV8EYJ1FXFHpTHhAqIfTXFAEoVijtYSZAYQtT+6xy/86VyiIki11G6r5vRVcZ3VNXXUg2MiToKiMDcod/0eGt59mDjvYUILGwPL0B4FdW+GSgCOZgiTiHxJD7LqjRHNATHLaf3lmhIuSOlz+0/NeXrSLIZIXtUMjWHhPA== 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=CA+NBKqYgJK9y0zqatUIdnZe/qz9Z4QRyRAxdYqNI171HLqLWmmR156hddnnGlXR9nd0tvvlnAvnBkC027NOLMbgiYXQ+C27DxQYK965fHLB9PmZ5B6DzZqRN+ocMLoMw/01i9VB2MeBmCFe1GOloZlqSF783s3tpS/H0TU+jHY= Received: from MWHPR12CA0038.namprd12.prod.outlook.com (2603:10b6:301:2::24) by BN8PR12MB3267.namprd12.prod.outlook.com (2603:10b6:408:9e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.17; Tue, 15 Feb 2022 00:04:24 +0000 Received: from CO1NAM11FT015.eop-nam11.prod.protection.outlook.com (2603:10b6:301:2:cafe::16) by MWHPR12CA0038.outlook.office365.com (2603:10b6:301:2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.12 via Frontend Transport; Tue, 15 Feb 2022 00:04:23 +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 CO1NAM11FT015.mail.protection.outlook.com (10.13.175.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Tue, 15 Feb 2022 00:04:23 +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; Mon, 14 Feb 2022 18:04:18 -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" CC: Andreas Noever , Michael Jamet , Yehezkel Bernat , "Lukas Wunner" , , Hans de Goede , Mario Limonciello Subject: [PATCH v4 10/10] PCI: drop `pci_is_thunderbolt_attached` Date: Mon, 14 Feb 2022 18:02:00 -0600 Message-ID: <20220215000200.242799-11-mario.limonciello@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220215000200.242799-1-mario.limonciello@amd.com> References: <20220215000200.242799-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: 826b7417-dd46-4f74-c994-08d9f016b914 X-MS-TrafficTypeDiagnostic: BN8PR12MB3267: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: 4BU0upFeyyulbVyS1/GE2fwcgOcMTMu6li28j7s3SS5R6feUSq3F2u4pIFnuidmXuA3Kmohq5HzncZswcJ4D9oKh+VHPJSYDVfh0uE2fbzE5vRNtE2gBfDiL6keLyYaHJSwwd5H0d2gXJrCCPLxoU4F2MFePWyaMM0nIg7NFqMU/xL4Z/VodvTo3vhVb+7woLx+WNWb4C9dGp4qco98h+6/2OEjEEZpGJxL7SKf00VHo4IKZWmL16Lo5KMXCjcQlBfDlASBCSASmKF0c2ZJUtcuzCNHVf2PvpJUgunPyzfjCImp9KpEW5/mEH3+huejT8yhjmcq5DYX0Dgyf7GEOUFXmFTyrxqW+DwxXuaLotQoTAfkEmE+tF44UuxjhI8YDGJ7y6WfQkRRK9z3JdoM4ODbBRMeZpYjZRDwoImivOA9cAzR4zPsEG+Wwx4TOGUXKLN5pvnBKZVZ5g4js0KMA55yuBbfA3iUz2XLh0/FvbSsMaUBHiYkBSq00t1qSa2EwAMyayUIHSD06QrDz/ZJ96dqroiDEoR9vMaLX7dnxjL6ftFlMrD4DGEhYu+/umcCoFhJI7SScjnRuNaAw1JEIn4HjbdyqavgUY4UO3Zyvw0v/UPJtEtLTNMbI/4DJrTlrEfyobLaqraix81BTaMowZpMYsobdKm3nMD214WlEp5IHsoepoxjZUH/GBFbHviZ4oLVGoGDjC/tQF8kBfjOscozIVSMRfdSQ9GoKf0Pk7fs= 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)(86362001)(2906002)(8676002)(6666004)(82310400004)(7416002)(5660300002)(8936002)(44832011)(83380400001)(47076005)(40460700003)(54906003)(110136005)(508600001)(36860700001)(356005)(2616005)(81166007)(4326008)(36756003)(316002)(70586007)(70206006)(26005)(1076003)(16526019)(426003)(336012)(186003)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Feb 2022 00:04:23.3167 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 826b7417-dd46-4f74-c994-08d9f016b914 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: CO1NAM11FT015.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3267 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org 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