From patchwork Thu Feb 10 22:43:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12742515 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 92BACC4167E for ; Thu, 10 Feb 2022 22:43:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240545AbiBJWnz (ORCPT ); Thu, 10 Feb 2022 17:43:55 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345106AbiBJWnx (ORCPT ); Thu, 10 Feb 2022 17:43:53 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2053.outbound.protection.outlook.com [40.107.236.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 546875F4E; Thu, 10 Feb 2022 14:43:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dTACaF+1k37Qab/csqB2pQUlkj8hdSc8Ft60z61/pKsZkRcKP/65ItuMlFa+mlNxi4TQrVb0mhuQ1utMHpP7Hhq5/mg3nkuwWheYsTWBwwNRtvAkgZD9j+Yt0khEStujMTc3oApXj26doqFwvceEu03+Xjfx6ggABOuSnJ8rUG2bEHsc4m3XlJZn8kJDBIm4vro3S1IxMPo3gaA6FFgW3cxx/gouSFlUaolLs+HqRfzjNBW3MpWycbELc7zJeyH5egWsV8OCg7WkK/r9PbwH7efM1Q0EM2JuWekLYhXwWfyOoKom7KTL2gncBuXxcm4GCvw70OPp/AstpM+CWEdP+Q== 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=J3rsSxnYcUqYPsVn9PI4AcjR+Cp+g6/xXV+YqOwAusQ=; b=b0e9L2nZIAcQR/ifu7RRCgZWvCGcZQRdGtqniN6dqGh9y4P3T2baDfcM8qJySRwPzhHd96MruOtiMPocD2Hp6mg+g2pzjukVm65x7oKzYdTZjk+0QgAxO+r2Pu0YD+EeVSjGb79tHNUKll4OrEj5Ux6VVRT7xAEVXyAcM0NCVkD1P6RIfXqTMyhbmpX9jJjSSnFiVKALpcrR1gHlNcBGHQvNweLpv3/5O96jNiamEPAxsDKo/aykDOeO2HVbyehhC1tOMpM3MR7Hx2084P4q3hiapGuOsFa5uuivq4SxrfF5wJD06f0Zxk1bdll6E6E5Rx6eL4Te9FqPzr4/YTl+lA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=temperror 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=J3rsSxnYcUqYPsVn9PI4AcjR+Cp+g6/xXV+YqOwAusQ=; b=Tl4OCaEGSlRR1NpmNuurgVYJy+Xixsz5ayzFr/KyG7+44N2sJ9FugaVB8IhFqkfTSamNkKRXOmrjLgLIHWZMfd4YOzzowRE4fjxTFB3GSvAyQA/LngKOHdE54B/YU3+QUCI6tJUlUUaCdlZfsafCHiin9PG5ZbRt851eyZl2ZFg= Received: from BN6PR2001CA0044.namprd20.prod.outlook.com (2603:10b6:405:16::30) by BYAPR12MB3416.namprd12.prod.outlook.com (2603:10b6:a03:ac::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Thu, 10 Feb 2022 22:43:45 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:405:16:cafe::90) by BN6PR2001CA0044.outlook.office365.com (2603:10b6:405:16::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.22 via Frontend Transport; Thu, 10 Feb 2022 22:43:45 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=temperror action=none header.from=amd.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of amd.com: DNS Timeout) Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 22:43:43 +0000 Received: from AUS-LX-MLIMONCI.amd.com (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; Thu, 10 Feb 2022 16:43:41 -0600 From: Mario Limonciello To: Bjorn Helgaas , Andreas Noever , 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" , "open list:X86 PLATFORM DRIVERS" CC: Michael Jamet , Yehezkel Bernat , Lukas Wunner , , Mario Limonciello , Alex Deucher Subject: [PATCH v2 1/9] thunderbolt: move definition of PCI_CLASS_SERIAL_USB_USB4 Date: Thu, 10 Feb 2022 16:43:21 -0600 Message-ID: <20220210224329.2793-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210224329.2793-1-mario.limonciello@amd.com> References: <20220210224329.2793-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 61c9260f-ce24-4846-b372-08d9ece6ca82 X-MS-TrafficTypeDiagnostic: BYAPR12MB3416: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: rB2Q3sfT14IQ0IFQX3uD7fhn7prXjeUmQTxxgiJAc38tKHT0r2jhO7svzJd5f3sZ8aWickyOIjcSzMthIRx3r8zT0wY9BLHFt2nVezuSr9B6nREp/RgyrfYXbcaeglBIrTCMc/nSSia59YRA0PTI7vvy+sMTXtYel0f94tTlWldgR7+9KXG9hBvpEgQWsREra25xuzP+z+yQJmhTgYJKnNgnZBbkClNP+jGLHLd4mUr5sYxb3JnIbVjoY+FT3gjHmKWWvCIYQSPm7KPERmWfPIQLcbeFPatVoy3CailD08W5XnOYyDcSr6NwMd6DjuEDhLaXGTTzNKY/GnywXtxq21H1lvYPdRHWkvigxqv/dtg2niWGKH7GrIidlN6vx9UgvGa5rl8bLadB0NREhehFQiAHwSJg/Qe2Kdsb+n43luLmFPIHrjO77fHSZ8620pXVKk/UUFsW7wpU7T0V1k6J6M+rQQfSrVngEcpJnErcUsirkLEhhXU4RCFI+ZJY5pvXXk5Ro3RPQkENnNnCdaJW9kiZePTkakxFqxUcKR3J/FbQvD9gCTb2ngAf/XhlGQgwaQnaBtfjgST6ATqAM9VGmGSzmQefk5kUYsKMuULjgj2s4bainHgTbJqHaSH32tW/vi1EfDotdnjiPGfzp+kp2O/k/UZilzrJT2EG1PGdh0GDlMnxPhQnkpPz1PHAbydDLaJK97iHGalwshxUgEj82Q== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(356005)(110136005)(81166007)(2906002)(36860700001)(508600001)(82310400004)(2616005)(8936002)(5660300002)(40460700003)(6666004)(44832011)(336012)(426003)(186003)(70206006)(47076005)(4326008)(316002)(63350400001)(63370400001)(1076003)(86362001)(16526019)(8676002)(83380400001)(36756003)(26005)(54906003)(7696005)(70586007)(7416002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 22:43:43.3207 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 61c9260f-ce24-4846-b372-08d9ece6ca82 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: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3416 Precedence: bulk List-ID: X-Mailing-List: linux-usb@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: Alex Deucher Signed-off-by: Mario Limonciello Acked-by: Mika Westerberg --- 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 Thu Feb 10 22:43:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12742514 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 C24A0C4167D for ; Thu, 10 Feb 2022 22:43:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345100AbiBJWny (ORCPT ); Thu, 10 Feb 2022 17:43:54 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345097AbiBJWnw (ORCPT ); Thu, 10 Feb 2022 17:43:52 -0500 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2081.outbound.protection.outlook.com [40.107.223.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23B8455BE; Thu, 10 Feb 2022 14:43:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PUbrBwpvI9X2owi1t6xrD6JO3afih/6e5Mst8LyqQaw+Sb0TCGUUxjdMfyslom8sOMeCTuK1cF2p55fA3vxroGS6ndcCtrB5AV6vekq1thRXP9XGzoidx9IOAWLQncdhZGNrAEz3J9rEWiSe6ZL957MUeTazO6IPqvXdHUteb6VIuzH4okanQGge2p4PfFJ/VYCWxAKIPtd0Obvgf0rtuY91DZYsAr6fgjOtWJP7PcAt9PecGPUybvKMJwNKqliqCUgxVGz025hdQyEwqzRl5aRCsswFu4Mp9QxNBB3XS0UzCeEFdxzIAyLISK5yYBwQ4FYp3RqntjI8DVkd/roKfQ== 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=HVy2ckDU7Jzzv+zRGc7QC+y5gBVHjJ2/b6eMFu7dT0UNmtxMOMWq8RknXtztyOBdPP3jot/EgpKRajfSTh5hfuB/MadaKpx5vPRrvjOS6ck2FMLG4dbzxxGYKpCOdIutpnhNE8Lym0GrSdW124WcI90CRUfmpVkXG6HE8I0W6p3bo0+MLbAf4FaiGkX+G06Xan6ohGVYPJcwg7ShoIdP3COvcReKeBO6tQdNjT9EDwY5LA5f3JqkXDOFzhx0eaT2V9s3Uk9Y762/I0i+08b5lf5yKkIJeZPxRRRmqL9ZtfU1fbEcDoH+/9Fk0bBmBQ81IVOcl45nssOjZXte8iDsWg== 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=I392jh4grvM5MgQWP4zP6Xr98schbboSlDIz1P3yP6NolwFyxwRxwPdPcTj1L8CaFXwYWJords8nzqLsw7UV7v4LQd1ZdyZtu7Lx5RAyld78Hu5V02it7guDn5P64FHMnXwu88XVW00uFy21bQX6Qu77aSoqPsicaFYY0HWpF8g= Received: from BN6PR2001CA0025.namprd20.prod.outlook.com (2603:10b6:405:16::11) by CH2PR12MB4956.namprd12.prod.outlook.com (2603:10b6:610:69::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Thu, 10 Feb 2022 22:43:47 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:405:16:cafe::27) by BN6PR2001CA0025.outlook.office365.com (2603:10b6:405:16::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19 via Frontend Transport; Thu, 10 Feb 2022 22:43:47 +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 BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 22:43:47 +0000 Received: from AUS-LX-MLIMONCI.amd.com (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; Thu, 10 Feb 2022 16:43:42 -0600 From: Mario Limonciello To: Bjorn Helgaas , Andreas Noever , 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" , "open list:X86 PLATFORM DRIVERS" CC: Michael Jamet , Yehezkel Bernat , Lukas Wunner , , Mario Limonciello Subject: [PATCH v2 2/9] PCI: Move `is_thunderbolt` check for lack of command completed to a quirk Date: Thu, 10 Feb 2022 16:43:22 -0600 Message-ID: <20220210224329.2793-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210224329.2793-1-mario.limonciello@amd.com> References: <20220210224329.2793-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc5e1948-74b8-4b5a-3db5-08d9ece6ccff X-MS-TrafficTypeDiagnostic: CH2PR12MB4956: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: iGdaJQhHtChN7G2cuIt/OFbBr/Ni82Veq5a6RA06urCR7lTO4D+QV5XLPzMmFE8pwObp9akbAfIwTkEqi1J3hTgOxmdbYynyqmfaQBjVHkgwdSX+T/iYcAiVoAOjt4vGtVqZptsgiVGiuo/gUaIfdxknNZ24WpRFMJcTurlZD62DIzVt8yGIfZVyV2ZnHhKV5jkNjzt4is6IvtPXOJtOe247GEdUSoDpPiuU/BeNxfxcWESdak9h6LCvbsvw+8yigtukxQm6ZbPNBkTXfzejGAaJ/Dt3Jk7VGoiwLksTcAQgW4C8LXVBAKnBK066OSZHDKidIqy/5YjpZ1w9+ZFXa5FxlqQgCCBkoEADgMwDs2HwItdO8AcYiYYVaxXii2x4UA1niG7CkjZd+TxxQgRIiujMJig2WF8EyGKoAsv4dvOvthcbCdvN6XvfIOYPqNxEh7peGPvUxMdLHipGkqrKj9hPpvVdWNSV+ViEAqBQDITN4kFOVk/xftbayGxSWB1i1vZKJcZY0nz39geGDhBJItHF7tNctH6ToOPR5rmoy4no6CKUxPnEO/TmEjLnbRz3x/ueRGOUarvKF3zPliRHRPN9usAbshjS4tKAM6ZRjilWuxcK5zjRM3yOaHTAg1PcIysn1DUuZUt76+0T4sD42RAArTQ6uX0buXv36sLI5vPJQx7nrAs01hJDHKEz9RiH5u+G+omTPUcBH67XiEniM63AQo3TEBocKNXHl2as6MM= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(82310400004)(8676002)(7696005)(40460700003)(86362001)(36860700001)(70586007)(70206006)(47076005)(8936002)(36756003)(4326008)(426003)(186003)(16526019)(1076003)(5660300002)(26005)(336012)(44832011)(2906002)(7416002)(2616005)(83380400001)(508600001)(110136005)(316002)(54906003)(6666004)(81166007)(356005)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 22:43:47.4767 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fc5e1948-74b8-4b5a-3db5-08d9ece6ccff 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: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4956 Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 Thu Feb 10 22:43:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12742513 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 CF586C433F5 for ; Thu, 10 Feb 2022 22:43:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345098AbiBJWny (ORCPT ); Thu, 10 Feb 2022 17:43:54 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244866AbiBJWnu (ORCPT ); Thu, 10 Feb 2022 17:43:50 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2076.outbound.protection.outlook.com [40.107.220.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D89F72737; Thu, 10 Feb 2022 14:43:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jNf3FgrjPRwCvoQMi/fbH38buFrOTribL6pChYYmXydFEblGFIW6POU/U7UhU6qjW5K3f8gTKxCAFGAawZUwE2SGA0c+MqIRQFWNxaUz6l6wFjDX5iOwoc0gPKWPnBMGIt1YC2U8ppmepm85V+83chmGKRTy+MFOHSvPHBi3O2FYNUkc8Ur9TaidkIa5HL6xnqH+YwIKcx7POcRY/JUBZjrs4TAh2MojUdSq4wuxszcY26NetgnoWVens9xS3YqUAlvqY19FJQsNS0A4e534gF4hUId2rMaQVo3YTd/oQlugzbRSnCkKULokQuibA37a27F12NjgjdcNSi1YvDdnYg== 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=ilvoqIeDqjDHXRzKEBSZM9Hopg/4mGCxGCmTazngJnQ=; b=LqtONBno4BNr+RqbRN7s7dGPyOqajmeBCrKQPgHOAI0ycRymVa5+T3WMeNPNPVdpp4M9EsMrHnhxtPL59R2N69Jd2CxWkPtMbXDNr8F2NPzqQV6Kgmcgaaxom0IlRgVSWyRQ7dCyTs91U6DkCPWPicVuBHomWt7UCTmk4cI+2rfao2D8AJ7tpAeb+XS4QXktGoJdLIvk+DvdzHYf0Pp42Y7QTOSP98JIB7hFi++zcGEM5ddA+h3BsvKb0XJbLOHn+S8nIBV2btC9zcbMpjiSrE7avgugJ20VU+0hPyDd5aUwV6XsoGy9S1CzXsW8FON+nYvqyEOCCHfwFaFHUKggUQ== 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=ilvoqIeDqjDHXRzKEBSZM9Hopg/4mGCxGCmTazngJnQ=; b=XKcXJCkbP9iB66MaN4Wgf5W1T/G3mZSDl6/8KsPIKu7Lir1cpIYYQgepcBV2axKX5n7eAmZ9/+rrVxxMPbJpmfj0jaw2Ebz1aaIboE6kP9aBp8CNTEbDDXRNu2k64GxnW3L0OKm5QbwzwyfIQQxY5ih4q78zN7gio9VGqfs3lYo= Received: from BN6PR2001CA0027.namprd20.prod.outlook.com (2603:10b6:405:16::13) by DM5PR12MB1754.namprd12.prod.outlook.com (2603:10b6:3:10f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Thu, 10 Feb 2022 22:43:48 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:405:16:cafe::49) by BN6PR2001CA0027.outlook.office365.com (2603:10b6:405:16::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 22:43:48 +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 BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 22:43:48 +0000 Received: from AUS-LX-MLIMONCI.amd.com (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; Thu, 10 Feb 2022 16:43:43 -0600 From: Mario Limonciello To: Bjorn Helgaas , Andreas Noever , 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" , "open list:X86 PLATFORM DRIVERS" CC: Michael Jamet , Yehezkel Bernat , Lukas Wunner , , Mario Limonciello Subject: [PATCH v2 3/9] PCI: drop `is_thunderbolt` attribute Date: Thu, 10 Feb 2022 16:43:23 -0600 Message-ID: <20220210224329.2793-4-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210224329.2793-1-mario.limonciello@amd.com> References: <20220210224329.2793-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d249dc4-6750-4474-d5b1-08d9ece6cd59 X-MS-TrafficTypeDiagnostic: DM5PR12MB1754: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: OsGS5wQZdTIo29vg9EhpPjGDYWEbzwF5qPTuUS0xlfq2GcxY0ytS10v8K7vKECggAtQ29gMyriEs0/2wk520JttPS1P/QqCH/IHLsplbRMIKtrXybTssADUxqYZD1nlqHJb3bADCYAdDS5o3mLbY+SVkZSNNbmSgE/tvwG8CpLlB0FJpCRw1nskvk5qfJyIIUpmi+X+GD5sDoHFAZ0lE0zLfDR6heANqwHDD0CShPHxVWvaijHlLX7/lUHjpi2TyQvvibuscxgyEZKUu3riIcy8ze2hpxkE4kiK3nU/+FIhI81en7jGf6JYaOpxcWwJNc/EcdU322mXuiYGn/9xxTGSteWBxcrPkKocvhxN+hKbH7W3YKnXdLWHWj10rxUp4FE1tx4GG6tH9S+1S8S93zmYdnDLwKc5sZeKMDldXf786SzUpqTRszZE3M5OcjvSkODeg7GBc8HJTHUCOcA5rlA0fDVZFAO3jnaWOHt/1oAglkWzJDLHC44b4ORdAByKwppyCa/FoYPwC9SIzpFzGe5f/3MB0j5g8mHp8mB9y6NRw4uPCZh1NF+uBC7PbvZ45v06+Andyl29qGNAD/6Nmqpc3ZpaKh8s93DiluC3Eub8dpaPG7bvw1K4BelfucXf1OHkdwW58yJS2AlBiG1ddEYlsM0FoM/9G54Pm3wAvQF9abdymnvLxY5IeI1iKe9xQ2RRUWZPbvR+2Hl1lw95yrWIg66X1JTjTqyKN9W343fA= 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)(110136005)(83380400001)(316002)(1076003)(54906003)(36860700001)(86362001)(2616005)(336012)(26005)(186003)(426003)(16526019)(47076005)(508600001)(7696005)(6666004)(82310400004)(5660300002)(4326008)(8936002)(40460700003)(81166007)(356005)(7416002)(44832011)(36756003)(70586007)(8676002)(70206006)(2906002)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 22:43:48.0704 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1d249dc4-6750-4474-d5b1-08d9ece6cd59 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: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1754 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The `is_thunderbolt` attribute is currently a dumping ground for a variety of things. Instead use the driver core removable attribute to indicate the detail a device is attached to a thunderbolt or USB4 chain. Signed-off-by: Mario Limonciello --- drivers/pci/pci.c | 2 +- drivers/pci/probe.c | 20 +++++++------------- drivers/platform/x86/apple-gmux.c | 2 +- include/linux/pci.h | 5 ++--- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 9ecce435fb3f..1264984d5e6d 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -2955,7 +2955,7 @@ bool pci_bridge_d3_possible(struct pci_dev *bridge) return true; /* Even the oldest 2010 Thunderbolt controller supports D3. */ - if (bridge->is_thunderbolt) + if (dev_is_removable(&bridge->dev)) return true; /* Platform might know better if the bridge supports D3 */ diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 17a969942d37..e41656cdd8f0 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1577,16 +1577,6 @@ void set_pcie_hotplug_bridge(struct pci_dev *pdev) pdev->is_hotplug_bridge = 1; } -static void set_pcie_thunderbolt(struct pci_dev *dev) -{ - u16 vsec; - - /* Is the device part of a Thunderbolt controller? */ - vsec = pci_find_vsec_capability(dev, PCI_VENDOR_ID_INTEL, PCI_VSEC_ID_INTEL_TBT); - if (vsec) - dev->is_thunderbolt = 1; -} - static void set_pcie_untrusted(struct pci_dev *dev) { struct pci_dev *parent; @@ -1603,6 +1593,10 @@ static void set_pcie_untrusted(struct pci_dev *dev) static void pci_set_removable(struct pci_dev *dev) { struct pci_dev *parent = pci_upstream_bridge(dev); + u16 vsec; + + /* Is the device a Thunderbolt controller? */ + vsec = pci_find_vsec_capability(dev, PCI_VENDOR_ID_INTEL, PCI_VSEC_ID_INTEL_TBT); /* * We (only) consider everything downstream from an external_facing @@ -1615,8 +1609,9 @@ static void pci_set_removable(struct pci_dev *dev) * accessible to user / may not be removed by end user, and thus not * exposed as "removable" to userspace. */ - if (parent && - (parent->external_facing || dev_is_removable(&parent->dev))) + if (vsec || + (parent && + (parent->external_facing || dev_is_removable(&parent->dev)))) dev_set_removable(&dev->dev, DEVICE_REMOVABLE); } @@ -1860,7 +1855,6 @@ int pci_setup_device(struct pci_dev *dev) dev->cfg_size = pci_cfg_space_size(dev); /* Need to have dev->cfg_size ready */ - set_pcie_thunderbolt(dev); set_pcie_untrusted(dev); diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index 57553f9b4d1d..04232fbc7d56 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -596,7 +596,7 @@ static int gmux_resume(struct device *dev) static int is_thunderbolt(struct device *dev, void *data) { - return to_pci_dev(dev)->is_thunderbolt; + return pci_is_thunderbolt_attached(to_pci_dev(dev)); } static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) diff --git a/include/linux/pci.h b/include/linux/pci.h index 1e5b769e42fc..d9719eb14654 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -442,7 +442,6 @@ struct pci_dev { unsigned int is_virtfn:1; unsigned int is_hotplug_bridge:1; unsigned int shpc_managed:1; /* SHPC owned by shpchp */ - unsigned int is_thunderbolt:1; /* Thunderbolt controller */ unsigned int no_cmd_complete:1; /* Lies about command completed events */ /* @@ -2447,11 +2446,11 @@ static inline bool pci_is_thunderbolt_attached(struct pci_dev *pdev) { struct pci_dev *parent = pdev; - if (pdev->is_thunderbolt) + if (dev_is_removable(&pdev->dev)) return true; while ((parent = pci_upstream_bridge(parent))) - if (parent->is_thunderbolt) + if (dev_is_removable(&parent->dev)) return true; return false; From patchwork Thu Feb 10 22:43:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12742520 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 CFD55C4167B for ; Thu, 10 Feb 2022 22:44:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345157AbiBJWn7 (ORCPT ); Thu, 10 Feb 2022 17:43:59 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345099AbiBJWnw (ORCPT ); Thu, 10 Feb 2022 17:43:52 -0500 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2044.outbound.protection.outlook.com [40.107.93.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 053155F45; Thu, 10 Feb 2022 14:43:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=idHSwBDmOGW0+HwlpQBTfMPFJqb1nchNpaKN6VFM7tWZkgTqwCM3655wtLppC+hZJ0b0YEDrH9x+IKdds7NvuSB1GQy3MFdNyvv6DnjyJR6F3dWYpu3lPYjRhTG79txBCz3mii1Vw6vyNPBoGh6caoas0n9dEpTNERhn4x2gVNm45QMio4RxUPRjNRbeHRGOqQ0QGzgil4c4mh3mqIDEnPOoaBOK3JvyLldeOIN2+79jAxyRkSNOJUdQmuiv1/nnUvp0Cf7uef0XPdOlwbm1ZKMUR4AeZA8sEQ3hATRyqkoHa80u2KbAmIskVROq4o3hS1R8On6XukMUQU2J3B395g== 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=8I9wA4fSQYCyzQLcndlkzty2V699ReWQKSTO5W4ekZ0=; b=UEhTtJT+GzR1FvhPDEVIf9MlMF3Px9sHuIQb4ow5ajKrBap9sgzAPraxk/+LYayCcdz5dkm87JfTXHfoGWvVU6zkWHC759K+Hqla7GpBmCtqnrGs9ZbnDV/W+n+vCJM2lI3y77EKHN9UEuFppuLN7gPeON1+GucnwSn+s1oeh7oYYuYym7vVISw0EruHFjm/C4KfZ8Zebqxr1AMIZhtiu5i8u0G2gbfjScOIhjZEHfr1lIzQmbvNDe/uDHqDHUo2CTlkpv+hCIpfPUh9BsUsJTM9tmbvLa+UKTUKNfZP412kPnMmfsmRnmXLs0DEJv7/hfbItSfstMu6gg6mEIY2qg== 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=8I9wA4fSQYCyzQLcndlkzty2V699ReWQKSTO5W4ekZ0=; b=qiG440SUoa1ivsjMPkWraDqAwqco0Gctm/4OQMK19SGOWxaAOb4OJfxPoDy+/hYQdksp4iG472H1qIG1rJXqUUmTttCqnsHIzmFbG7pYaNqI/oaSlEYhxnussTaPefW6/wf66GUyCB1UIvh7DrXE/CrvaktXpRomyplQFy9o4L0= Received: from BN6PR2001CA0048.namprd20.prod.outlook.com (2603:10b6:405:16::34) by SN6PR12MB4735.namprd12.prod.outlook.com (2603:10b6:805:e5::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.18; Thu, 10 Feb 2022 22:43:49 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:405:16:cafe::a3) by BN6PR2001CA0048.outlook.office365.com (2603:10b6:405:16::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19 via Frontend Transport; Thu, 10 Feb 2022 22:43:49 +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 BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 22:43:48 +0000 Received: from AUS-LX-MLIMONCI.amd.com (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; Thu, 10 Feb 2022 16:43:44 -0600 From: Mario Limonciello To: Bjorn Helgaas , Andreas Noever , 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" , "open list:X86 PLATFORM DRIVERS" CC: Michael Jamet , Yehezkel Bernat , Lukas Wunner , , Mario Limonciello Subject: [PATCH v2 4/9] PCI: mark USB4 devices as removable Date: Thu, 10 Feb 2022 16:43:24 -0600 Message-ID: <20220210224329.2793-5-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210224329.2793-1-mario.limonciello@amd.com> References: <20220210224329.2793-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eb26fefc-71c5-4e34-d006-08d9ece6cdb6 X-MS-TrafficTypeDiagnostic: SN6PR12MB4735:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w5oBCBCfzbeV64YTmDQx1LJ45Ywcsv65iTYfiSCagvVaalwhdCME6wLOpnbBlwc4EGhuxQ03sFlPWlq7nGTmWNGtkQL5iZqH8Ek4jhIsRAv4//GFZozCXfssyah8pMPIIqwpKgPPvcm19G8ZBejze52uffmDcPKJpqT25cDCvoyHQlhC8TGDmPBnoK0uLhn9R1KLf7jG0xcLxokabM+QWT2s5vaajob0rJNfI5RDVSoxYo6nh+RuTBIFLOBD8m3d4asXggQ4Y/CaTRWujq87A1TcqhRBOnmqJHZRfY6vKK3QdC8ZcGnvr4yztg6zieRh374OLwjpdt1hEiQXYj3LqOHc9PHKjBoyXhXsNVSQonh8OYZtNWEKn/iiplZmJPzERWgLI2CI3b8zLOvP6dJjFsXh9MzQab0ASTQnmgNmFsjrYBUV3zd7uFbOZwcro8TkNouvjX+CvKlto9OVA13/5zHQ9b8tB1kG533GJWPeOpCDPEXWaia806m+kALZeKfj7j3iU5EOvdTqVcrbqWdkIreFxph42qH/KNhOyt+GrKE3e6V/Cj4O/c/wpiNq97kYBZiuv0YIuZF9KHg75/ZXxoSxFwGVpIoTYUxOwxodgNxxKwhGP2UYTWOBDmMnyzuY22S9kJIADD0mxMIRBPbNvPdIpr11lLBElymOZT3xZAr+YT7yQBHV2n6VxLtmbNOO1WOGthZeEqlF4ZjEodkG8A== 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)(82310400004)(508600001)(44832011)(36756003)(356005)(81166007)(336012)(6666004)(26005)(54906003)(86362001)(1076003)(426003)(316002)(5660300002)(47076005)(2616005)(36860700001)(4744005)(2906002)(7696005)(4326008)(8676002)(8936002)(7416002)(16526019)(70586007)(110136005)(40460700003)(70206006)(186003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 22:43:48.6954 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb26fefc-71c5-4e34-d006-08d9ece6cdb6 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: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB4735 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org USB4 class devices are also removable like Intel Thunderbolt devices. Drivers of downstream devices use this information to declare functional differences in how the drivers perform by knowing that they are connected to an upstream TBT/USB4 port. Signed-off-by: Mario Limonciello Reviewed-by: Macpaul Lin --- drivers/pci/probe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index e41656cdd8f0..73673a83eb5e 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -1610,6 +1610,7 @@ static void pci_set_removable(struct pci_dev *dev) * exposed as "removable" to userspace. */ if (vsec || + dev->class == PCI_CLASS_SERIAL_USB_USB4 || (parent && (parent->external_facing || dev_is_removable(&parent->dev)))) dev_set_removable(&dev->dev, DEVICE_REMOVABLE); From patchwork Thu Feb 10 22:43:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12742516 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 2CD57C43217 for ; Thu, 10 Feb 2022 22:43:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345148AbiBJWn4 (ORCPT ); Thu, 10 Feb 2022 17:43:56 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345096AbiBJWnx (ORCPT ); Thu, 10 Feb 2022 17:43:53 -0500 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2064.outbound.protection.outlook.com [40.107.220.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D02485F5D; Thu, 10 Feb 2022 14:43:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FgpbiZG/S6ltg9tqq+QBVr/sfCiVtDC9me0IQ1giExR6CuCajSjQ9JCLBHiB/9E1n6Pxtve2ZcATgFZzy40TABsEq3DfSe5qH7Z/FeOA7xd9MfxjKNmP1Mujcgbgpgh2T8bY6CM3Ae+aYx/VGldM8ur2GYmZZta5ORK0FdEZGRPnCAi7vviU/pC99E6XbzNPB9qYmRgebQ5NXmE92qEPRhpVlLYTmvgs5mPx/Yd13msXS4IbCcO86BSHgIrGpc7fStpSCvAf8+wh2o+Vmv8wqb0o94z/V/84pncSmTsHY41BVbvTuLPCojJtru5/d2WD+gJKoYcumyVrGgPMFCMzlA== 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=UN1eDs/KEUeUvmBl7qJuY3X9snA/o6NJJcfBhOOp0fc=; b=AfiEV3WMwd0Z9PsovgFhLAnw3T9gYEwOU10BzemnYMmlYPQerMhwawrAfWySZp5zV5FcO72xMeYRqMoeyCeS7MlbpwqhbRwXp1V1C45j+qy72DRtGYq4bYOWDfnieux5H4RCBBujcMmy5sKtAFw0WcbKB/nU4bOP7t5Ik/Q0OeO5Nm1lQ9iwMVzqCu+yduzLWLhcLgDTrtXHKHioxFxG8PKNL9uhIAEghRR9kyj/RJ4VEUVjKh64ELx9QKEn23Koozh9YHpg7bzaDo3FWvLIM643Ue8auYWeRYIKBH7fEFgWMiulyG9qUbAfP5ZzulKtSD82FAuLbm7pMqbKMVfd0w== 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=UN1eDs/KEUeUvmBl7qJuY3X9snA/o6NJJcfBhOOp0fc=; b=QMI7XEF2XkFvQT7T8bqhutnUKgsJKUXo2EJv70FCkWI6XCxIbwIEMm/PZIhyShjVUkEhdQG3p8goq+dTuhch3KEZbooEmvXM9j3urEW6NQULtLIYBtxAbRLgkfHWK39q9BGxtg+8Q+8EBZAV0ehn6J265H7bEEN0b26I2OEfN1o= Received: from BN6PR2001CA0042.namprd20.prod.outlook.com (2603:10b6:405:16::28) by DM6PR12MB3948.namprd12.prod.outlook.com (2603:10b6:5:1c4::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Thu, 10 Feb 2022 22:43:49 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:405:16:cafe::b1) by BN6PR2001CA0042.outlook.office365.com (2603:10b6:405:16::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 22:43:49 +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 BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 22:43:49 +0000 Received: from AUS-LX-MLIMONCI.amd.com (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; Thu, 10 Feb 2022 16:43:45 -0600 From: Mario Limonciello To: Bjorn Helgaas , Andreas Noever , 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" , "open list:X86 PLATFORM DRIVERS" CC: Michael Jamet , Yehezkel Bernat , Lukas Wunner , , Mario Limonciello Subject: [PATCH v2 5/9] drm/amd: drop the use of `pci_is_thunderbolt_attached` Date: Thu, 10 Feb 2022 16:43:25 -0600 Message-ID: <20220210224329.2793-6-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210224329.2793-1-mario.limonciello@amd.com> References: <20220210224329.2793-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9e031db3-25d4-4783-03cc-08d9ece6ce2e X-MS-TrafficTypeDiagnostic: DM6PR12MB3948: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: HUQQ5elLn4HA1pcApS6YnElOcXvoqLOe96g78IqA3OwcJD4t4gHt7a9pJcjNjqZylBMUrAx9uo5tSNJBZUwyF2/jZ2iQGMecgzXDOpxJ2V9N7vW7ux+9OuJlkuy8UfaMUcRBaUvX30t2mPOAcHI7gX4+/DcPkl56k0BMLIcQuLhcc/vWjIPA4TZy+HI+mCeEH72vAkY2eIDDopsh1mk2Gj30/sJjtD+i74SH/H0qZdNIoUJDOX/E9CErMl/yUSSOuhYiE/YvDK3pY0ti1HKNDFz+ffxGBfz6C/VVqjOD0b+ohFryPHMspD82mHW2PpTTvTh2RJ3jk/vYlFoHLCtSuRMFLb3BiBTeiUuL6gdTX1xKCQeS53sh+BTFPaKDzjm2OrovLz9o6KzyjxaftjjMeb8uQIaLVjZZwG5IX8xvGBtj0nFdOrMvmyK2u8dhLpn1qS+jEUjTFzkxOHHYJwgJMg3HArQykCwnDtuviSkQAvUqDMfKfe3Oe//5+L7juckT2/VEdskSvbi6/u1ZgIrD5gnItBWQPLBWvGkBjizWdtfZWL/yz9AZtDJJu29YR5CszRdbYq81PDB7z6NXrWJl5mjV2T5mI+1bbNXDoRM7tnTgt9jx7LaJco56Vrm89+R3I8ECnFluwa64dWVhKQatfamjJ5VpE2StBjyYq4Mz58X4GD/SicLcSmcS2kNzlElXYiyxxtegKC4K5bmdBWPKNwxFSKAgvEbD87wSBHqVYHI= 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)(316002)(5660300002)(7696005)(70586007)(6666004)(82310400004)(40460700003)(508600001)(4326008)(47076005)(8936002)(54906003)(70206006)(86362001)(2616005)(36860700001)(83380400001)(44832011)(336012)(110136005)(426003)(16526019)(1076003)(2906002)(186003)(356005)(36756003)(26005)(81166007)(7416002)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 22:43:49.4609 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9e031db3-25d4-4783-03cc-08d9ece6ce2e 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: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3948 Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 Reviewed-by: Macpaul Lin --- 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 Thu Feb 10 22:43:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12742517 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 13C0BC35274 for ; Thu, 10 Feb 2022 22:43:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345156AbiBJWn5 (ORCPT ); Thu, 10 Feb 2022 17:43:57 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345111AbiBJWnx (ORCPT ); Thu, 10 Feb 2022 17:43:53 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2055.outbound.protection.outlook.com [40.107.237.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D15D42704; Thu, 10 Feb 2022 14:43:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EAaR8FKq+kyWo0PwsfNyi5HOW48u0khHZhnmsWYDU9wDfFSNiWvmEEREnYla9bnOLMbzelONI4ULFH8TubH1NY9HAuhEfl8K5FppH2ia1Y7x3lqqvqN1pWvz4KlPvr2eruXEVAm5pT1eU0LeOrHch4p8LkVAtyAiJe07Dhljag5MbELepQQ29w8+h4KTsE3fgmOhi4525UOCE+chs4j7x6DkrvCswd40UreFa4GtlrgSDAg+XZO0KvF1ngSEC3cgE2ydnr054qkG6YfZ2AMV/LDB2EWqeBP22k5NNBzAmsU3E0TtMBXmaE7tZ7vAgM65pygyUvWPruqDhIdQTIRxYw== 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=QPkY9qJm/LyHy6+PBbK3GPEus7EEooVEewT2E8FnAtPVjMKR2zNnFBGbt06sgPDQSQAITiqfwh1/TrEe5r4EOwi5W5Mg0hr/Ni5UZsMpz9ViTVK402SpsAZSA9um8XslDdERfCTnZ6+qPtYxq54bX9O35OPwWfekLLQYMZL7ysez9naeEU1zSwWIfSt/7aoNyrHSVZlz/1Azpur2RsJjxqBvcx7AC1xhgVW5nfC7b38Qz7MtvVQZQU6eWiQJQM5dDSGkREUxOhODrnDFrotI7OUJJqJNO7CsLyJcj03F+iF/zKiDAfYRuzmnoJBuMNuBJPFTfz2Pq2j/o3GVYN1k5A== 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=dPNJ9A4cBflM7YB6N/sdshI+DBFkiK97vatRpyu+y5CQvR2ZlGt4e3DF9gHueLtXrN98gQx+GtJWp4irgeHNi1TxwnKWSQVnx5ObCOkfhIE1ceUPEIK5eT44L6gJ9Cd3oAgmzMNUcA0LVH3UBQ1I8i2g47bHWvB0LeS57n21gQA= Received: from BN6PR2001CA0030.namprd20.prod.outlook.com (2603:10b6:405:16::16) by MWHPR1201MB0272.namprd12.prod.outlook.com (2603:10b6:301:52::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Thu, 10 Feb 2022 22:43:50 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:405:16:cafe::1a) by BN6PR2001CA0030.outlook.office365.com (2603:10b6:405:16::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19 via Frontend Transport; Thu, 10 Feb 2022 22:43:50 +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 BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 22:43:50 +0000 Received: from AUS-LX-MLIMONCI.amd.com (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; Thu, 10 Feb 2022 16:43:46 -0600 From: Mario Limonciello To: Bjorn Helgaas , Andreas Noever , 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" , "open list:X86 PLATFORM DRIVERS" CC: Michael Jamet , Yehezkel Bernat , Lukas Wunner , , Mario Limonciello Subject: [PATCH v2 6/9] drm/nouveau: drop the use of `pci_is_thunderbolt_attached` Date: Thu, 10 Feb 2022 16:43:26 -0600 Message-ID: <20220210224329.2793-7-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210224329.2793-1-mario.limonciello@amd.com> References: <20220210224329.2793-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 63a3a7f9-cebe-4a6d-e9b2-08d9ece6ce96 X-MS-TrafficTypeDiagnostic: MWHPR1201MB0272: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: ro2iJskM4rRy7+u9NTUt+dxpPeIDW6ZDEJCZ/KE8HL2yeiNgldB02p5MI+PdAg2gKE9pZZ0tw3ldkYVn0x5aBGrUOEnrIeEsmAJ541qWfpeW2Vx/97Woe4Z2+Ya+UKXomislBDCfa3NHSDvADdF6oilM6vrduzW1EBpD+TrA2ywcQqabbMW2RonyyxzxgPBV+XiyJS1M+l6p/V+DlBX6EjsCf9KOHSdmmrschPuvBgEG3BUHDm0yWr/X5I9hn5YXXX+L5jk/5iGj68JG9wOpTrIrB99Okcs0rxbq+OB/2JIwMMcaKWT6VhWR1Vfp+wcet5pyroaCGfNIG404OE3CLWLFeWKs8IigwazLitqU3MxCF1nji9soI2Ds1Nh1M2Lr7ziTqAYFso0xRMb8xA2GG/M/GG9TY7a0s0RlyThUXuC2/hGB51tiTJajC2q9h9/6ielQOG6CngI8vSVagaVHgQV02y9DdI+40jtQeeyzyM6SHSeX48+477uFK/LiSD5LH7N5JFGkbIXnp27vTpxuKkPf/FDK2kdZXCS0jmd6fOMRozL49LoiyjElS2Q82Ya6B0MzKrYJkbwgur4UI9J1PhvVUwaBE5sFJZYhLqaHMnYVqwhU53gp5kgU6IcR++TQlN105uSaZAoRSswU0F+5Xt/x3DBVJQCS4FUpX3smjsxAbkLUKwqCQCCI9vzVhYPsyfF267HPFJA/89RapHk+AdJA7SjJiTnFed+xuNTAaIY= 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)(4326008)(2616005)(508600001)(8936002)(8676002)(7416002)(5660300002)(336012)(86362001)(426003)(110136005)(83380400001)(16526019)(316002)(26005)(70206006)(70586007)(54906003)(186003)(82310400004)(81166007)(6666004)(356005)(47076005)(1076003)(36860700001)(7696005)(44832011)(40460700003)(2906002)(36756003)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 22:43:50.1640 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63a3a7f9-cebe-4a6d-e9b2-08d9ece6ce96 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: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0272 Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 Thu Feb 10 22:43:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12742521 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 D47CDC433EF for ; Thu, 10 Feb 2022 22:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345161AbiBJWn6 (ORCPT ); Thu, 10 Feb 2022 17:43:58 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242571AbiBJWny (ORCPT ); Thu, 10 Feb 2022 17:43:54 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2050.outbound.protection.outlook.com [40.107.92.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F4972716; Thu, 10 Feb 2022 14:43:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R6HkABLvg8LCoKU+O7kZcPVfK9AH7DuXkyROwMhmEKqRzQpMQWCSSuSbQP4y4JCt0HRxpDNK/m6WUMucPEUgyvsyIoou4Dsu08BXhVYZISbvfX9EWAdB718QuGnszpVKKUM3BSypi4acqLlloS+3vHlRI7LDlXSXz9bfneWLC4ZZAuoUYCY4iYRCiaGUZDul0myuhhVs4IIM3gny//sDooRAprJM35RHTvJOLrLQ0/eeXWh78tG1A+a6uL5KD0258pn+BDcnBBljXnBiGxBclTW3TWOtls8JzwUcyb9rYkQpkso4PEKMauseWmU/4GsnZmhsVSE4I/GLrC7DrXaZpw== 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=hfbzCPG2jAkbfTq3AHYYmXBwM6foZQXuRKg2RkmOdlryNDiq2VEnb5CzlsEg1eqrN4NeFHrJorRPueFhPvUa9+C2UrgTX706NYU6TjeRFSj+xHHD4yfVd6nvMlWkNqGI0BnNknhTjXdCfopUHRSKYxVGYBkIh7fuB6x/HZPmEJ3/8EgBf9/bSQHWxH/sF062F5aWrlIJgpunbkKlDnf4Iu6Pnb3vn1n127j37zeC9zX8BNnLF50e7Q6Ay3WtlGjwkwReSJgcTXTStWyzSu+0HhqO38su5y9gx/p7flbVbsLBa2f4/xhXWYR4H4PZad2ruGugIq5WvsPgSiziVmb8Kw== 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=klko5pHTtNu1x23niXVcGhH714oTM3vvbtAcSY1TqDFgdVrIxvknPNT68biA6oGE9EZyQKbmwnaWbUYKky7hsvh851gjrusXhQacxbnYNBjXiZlW/faBLfibcDgDRZvjtI3L+1yXvPjDbNj8Nx7Z2R/XsxUy0igZQOcexjDtQIc= Received: from BN6PR2001CA0048.namprd20.prod.outlook.com (2603:10b6:405:16::34) by BN8PR12MB3138.namprd12.prod.outlook.com (2603:10b6:408:64::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.17; Thu, 10 Feb 2022 22:43:51 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:405:16:cafe::a3) by BN6PR2001CA0048.outlook.office365.com (2603:10b6:405:16::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19 via Frontend Transport; Thu, 10 Feb 2022 22:43:51 +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 BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 22:43:51 +0000 Received: from AUS-LX-MLIMONCI.amd.com (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; Thu, 10 Feb 2022 16:43:47 -0600 From: Mario Limonciello To: Bjorn Helgaas , Andreas Noever , 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" , "open list:X86 PLATFORM DRIVERS" CC: Michael Jamet , Yehezkel Bernat , Lukas Wunner , , Mario Limonciello Subject: [PATCH v2 7/9] drm/radeon: drop the use of `pci_is_thunderbolt_attached` Date: Thu, 10 Feb 2022 16:43:27 -0600 Message-ID: <20220210224329.2793-8-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210224329.2793-1-mario.limonciello@amd.com> References: <20220210224329.2793-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 467eba18-0094-4d40-0726-08d9ece6cf39 X-MS-TrafficTypeDiagnostic: BN8PR12MB3138: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: P339y8VAFhteLQ+lLzvWYC3t9TNCV49gwaV9iRj65dgWYZOA1sf6KOrfz+dNLbu7kddLQT+vcv1g4hh+svRPTjgmQ65qF6Cq+pxUkxKQ6j0mg1YXVIkoXETxbvzTdBFAVtTUHWOEopBfE+ChqH9D5JD0/zjkcHmOviNorCSVFzVlY/3rAQyx+iU7VmVX6vGcaNt/QzkgqJNxeLgXdYvGkh5J1NleU2gj1510AqMFPvoP7hvb8BzKorBlRgGD6L63xbX+CrixpQ3Lq4gtizyj5V4qCUm4ddkdR0SMLvCYKrUKTSoKbwrCKpUFTzWuPT1DP66U2Khn0ULnJJvTKiNLnvTUPcxSsR3LGhHjeTN37bToTH+TpKnuH/Yc+FNNWx6AV93KyeqjLmwDGKScHu9g7nCZDS4j7fCG+8YR+eDcCAV6JPAeKOARP7L2ycDzKHfR1HVva+hEzsHYP0BtWOPj7R6+JCSeNdhy1R5GtpZw/3SpXBS4kB0ykYlFTQvhi4608NORNEflvYQP0gi9L5y1ovZqLFPIY/hMsADHkrsRNgrV737KwauSaTDMEx3Trs2aOet/jYLQTGlAUOhiqjyyX0xjUZLL5LLmGOb7MyrkXCP4gdKITVLuPZl4bfSB1NCGC1PgYuRT3lAqfDD9/lKIFCwjBLGwQguP3NtyUgNOx1ub02UpNOZ3R7unaUHxQo0p2i0kslphvOpbQ+CPapjqltK1dpMDSyA/0YVXwqWb0uU= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(36840700001)(46966006)(81166007)(2616005)(110136005)(44832011)(508600001)(336012)(2906002)(36756003)(356005)(426003)(40460700003)(316002)(8936002)(86362001)(1076003)(7416002)(186003)(5660300002)(70206006)(70586007)(16526019)(26005)(4326008)(54906003)(6666004)(8676002)(47076005)(36860700001)(7696005)(82310400004)(83380400001)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 22:43:51.2108 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 467eba18-0094-4d40-0726-08d9ece6cf39 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: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3138 Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 Thu Feb 10 22:43:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12742519 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 57850C4167D for ; Thu, 10 Feb 2022 22:44:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345165AbiBJWoA (ORCPT ); Thu, 10 Feb 2022 17:44:00 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:32860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345150AbiBJWn4 (ORCPT ); Thu, 10 Feb 2022 17:43:56 -0500 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2068.outbound.protection.outlook.com [40.107.244.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FE4B5F44; Thu, 10 Feb 2022 14:43:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gIWQzvLvimWitTxPtRjk6qKJAkjg9DeU5QWuc9i5Dz2Z4gQsfKMF88AirAN8fWyXQJQctghnVC5FFMF6/cOTdMaTQ5rS+WcfI1CO7Z0a4a3vjTvMx1aqAfemVXy/ajrCOU5pge705h4cWDHbL97vpp9EGL8sD/PvQ8Gk30poC6Tp0c6wgCRDqECIoiWBPCtqN9dFRagXIE/ltPs+VdR+iWPuT/yQynzf+1BQMILWheZ4H//egrG3/hhwDVYkG6eyk/G9R7D01Pa6l90IwrwDQH2yOQL7ItJD1uMkfZcS+VapoTFFddn5xOThhyFpoQIUsO/7Uu18CUms/zjWdyogZw== 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=pIvYZ8/68wSzbmpsSTMm9oxoym5TV6xAjnkSns7DQfw=; b=SAd8SYPOIGU+Mhpq7VsEyWeCAoBe+LPrEueye9B5Wz5DdKtoW/c8AlI4YvsKMSMua4+pHpCNlsPOk7S35Su5o6MDxW/Phwf0znihhP66eiC3EPuw+IUMsPQHQ9n9yuVAtrfd+GzkvFT1w++G6mzPGo/XDX66IyZu4zoqq87jwuqevxugzW7EjcBZepzjtBtJCxMlSUPZPo4SyhXhO14YOF4IMN3CQrCs9HzBTGnDWmWNJx+ayBjDQAd28fSIijgjfczj0vVqAw9IsRQAh7ugeHjg9vTuSDf8MBvOlAmHTA+GjI0VY/lBdMAbgy9xlFYOe+R62Q9mrnidg0ubwOF7Dg== 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=pIvYZ8/68wSzbmpsSTMm9oxoym5TV6xAjnkSns7DQfw=; b=j5nCXgIogXDW+4bm+lcinkEX6AVLfQ9lP2OtvC7MX8LGrtEWyo3pbnB2B60IBS2oshAgzF1ONN6nJDTdMay6zDo4Nq9110+4znatkFHuJT5Ejk62o4PY/tQvBksr0Nbl0seRSrJYuhdLO4afjvJKE27u/eL0gJGoC7bn4AsUEjQ= Received: from BN6PR2001CA0038.namprd20.prod.outlook.com (2603:10b6:405:16::24) by CH2PR12MB3879.namprd12.prod.outlook.com (2603:10b6:610:23::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Thu, 10 Feb 2022 22:43:52 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:405:16:cafe::e3) by BN6PR2001CA0038.outlook.office365.com (2603:10b6:405:16::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19 via Frontend Transport; Thu, 10 Feb 2022 22:43:51 +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 BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 22:43:51 +0000 Received: from AUS-LX-MLIMONCI.amd.com (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; Thu, 10 Feb 2022 16:43:48 -0600 From: Mario Limonciello To: Bjorn Helgaas , Andreas Noever , 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" , "open list:X86 PLATFORM DRIVERS" CC: Michael Jamet , Yehezkel Bernat , Lukas Wunner , , Mario Limonciello Subject: [PATCH v2 8/9] platform/x86: amd-gmux: drop the use of `pci_is_thunderbolt_attached` Date: Thu, 10 Feb 2022 16:43:28 -0600 Message-ID: <20220210224329.2793-9-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210224329.2793-1-mario.limonciello@amd.com> References: <20220210224329.2793-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 725b5485-fa55-477b-15e4-08d9ece6cf8a X-MS-TrafficTypeDiagnostic: CH2PR12MB3879:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:854; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ShwvN+90h5MzUEhumxRAx2PvVWULydU5Y8ZzPJsU3CR3FCPOY8ntsYKwkHZ/i17PVgh3UgRka3Q5pDZdpKI7/WVkI2AJhSskB7m8ZD8UovJ6gUYYP3uM/CTaZsoe7J1eczJ7W0agO38gL/ltQrchQIS4U8P5DvvKDrSGO5/Oa0/23MTN3ZietEQdVW+p3IQ/hzApo/Tjno1L59f8wy3Oq1FibkHMZ8nXOSbH3Bt9NY4ewgi0V7oRxdNKfVSiF5N9Do2sHTGmNkr6H+Uwd0HTqzno2oU16+KHGIdWpp0s6HmGxhG5wiwDrLEHYZ2p+obXrJsdgbp7zKWILudpsHeziqDHWwkBhqrU7KyuRleHJzTduPJCKZBZ4UabaVDuMoqiNX48TpumxmY7WE7ColaqhjP5BV0I2dwRt1cgdiwNREDvlVIYj5hdm7PWHeN8kAPIJFMjQJHfPky15zTynofZJ+ZLstyu+dwoV8RiJ0RuLI+tg8ZpqVreLUXUZNXFPzVSSN6tQmLEcsczsq/fYwPxdXadi2h9L7e496R+QgEYmWi9KEVVXlBOwWX/VxSGmEZRrbI36dHDgQlE5hriOwUQ2VM9qeBJEt47EBgMul6ykMyyJJh5G5B/i2ziPDKABFAKwXBUwdRa8PCJqaY4AjO+NMFohVkE867LLAv6KRzzCjkYC1WelaJ5iZYhGWccDNP8AVtRe8RD6CU3/5nDV6P48qkwqrWJwhTaN7kJOL/Hjxg= 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)(36756003)(47076005)(44832011)(6666004)(36860700001)(508600001)(1076003)(7416002)(5660300002)(4744005)(40460700003)(2906002)(4326008)(16526019)(70206006)(186003)(54906003)(8676002)(8936002)(82310400004)(70586007)(336012)(426003)(110136005)(26005)(2616005)(81166007)(316002)(86362001)(7696005)(356005)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 22:43:51.7577 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 725b5485-fa55-477b-15e4-08d9ece6cf8a 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: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3879 Precedence: bulk List-ID: X-Mailing-List: linux-usb@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 Acked-by: Hans de Goede --- drivers/platform/x86/apple-gmux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c index 04232fbc7d56..ffac15b9befd 100644 --- a/drivers/platform/x86/apple-gmux.c +++ b/drivers/platform/x86/apple-gmux.c @@ -596,7 +596,7 @@ static int gmux_resume(struct device *dev) static int is_thunderbolt(struct device *dev, void *data) { - return pci_is_thunderbolt_attached(to_pci_dev(dev)); + return dev_is_removable(dev); } static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) From patchwork Thu Feb 10 22:43:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 12742518 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 DEE4EC43219 for ; Thu, 10 Feb 2022 22:43:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345160AbiBJWn6 (ORCPT ); Thu, 10 Feb 2022 17:43:58 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242701AbiBJWnx (ORCPT ); Thu, 10 Feb 2022 17:43:53 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2052.outbound.protection.outlook.com [40.107.236.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17DC426F3; Thu, 10 Feb 2022 14:43:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cua3yXuKjxvLiWknOMuIdCb8INnx3Wxc/zyKY/Imvdtdfz3iHiQasdtwx+Xiui6fJiuxoTLYacjGl1cJ3VvSsod6F+pAvUJrozS50ULdsq/4pt/c2QQBUrxpcm6L3TlROQXX8th88NpRc7kmNcR8qPoctMMsF+FyZ1TfjT4XIZUdQWirTFecygO7KWtibfC3vt5Q9A5oyfMCxKDW6xOY7W6/2w2gBPtiWFIhCr8A7Ab5RPP+WBFRLgudRn0Mj9mowe8O/vFJixJ88Ua29o/K9VRSOVoyS2JABT1O11BeimHTSdP5lsv5CdSRLrMkWEpx02Y3s9Vo2+qGnoI4gNFG3A== 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=LsqXOXTJq+/8VTthP81iWoyHlHKxQmoJxVsLG7UPscLBFAu4zx1EZ5f0B9Cgk4MTYMTaNesKsSpCByv4FixjsdT/RTt+vl3ZGZ7xjB2VKz0QHN80p5IZdTgyoAA9YdqJDtyF5G1edY7B5nWOra+EIR/46O1injC+2WHc46rp59wfyMznxxDgm0woc0xjno5oPx5WeMrYrRsXrGonVzsbEArsc9T1aIW1vEgCLfGlakcPZsPTKre4RcsrCmptzSiNtUotcuoR2R7WjoHQFOZwB8E9QThlVBwx1cO/P+3G6fr9dhTGdwMFFJ4oY5X8TWFNPb1qMkOXkpeMDbzxn9djqw== 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=4bZr9vO2WdfxefSBKSGGJ0QEbSb5Nzy2w+qJAOXtySdt0ColPST6YT3GOaX1y6Rt78sK0ul/QbGhihH6y3SVz3nmWIdEVxgKmZsJ/PFYaMf7AglIA6+sgEZAxrg92zlRmYqFB5PxQCfXkWGfZX+s9y6RLKmaPSUQg9CH/OunvEw= Received: from BN6PR2001CA0045.namprd20.prod.outlook.com (2603:10b6:405:16::31) by BN7PR12MB2675.namprd12.prod.outlook.com (2603:10b6:408:2f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.12; Thu, 10 Feb 2022 22:43:52 +0000 Received: from BN8NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:405:16:cafe::5c) by BN6PR2001CA0045.outlook.office365.com (2603:10b6:405:16::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19 via Frontend Transport; Thu, 10 Feb 2022 22:43:52 +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 BN8NAM11FT039.mail.protection.outlook.com (10.13.177.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 22:43:52 +0000 Received: from AUS-LX-MLIMONCI.amd.com (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; Thu, 10 Feb 2022 16:43:49 -0600 From: Mario Limonciello To: Bjorn Helgaas , Andreas Noever , 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" , "open list:X86 PLATFORM DRIVERS" CC: Michael Jamet , Yehezkel Bernat , Lukas Wunner , , Mario Limonciello Subject: [PATCH v2 9/9] PCI: drop `pci_is_thunderbolt_attached` Date: Thu, 10 Feb 2022 16:43:29 -0600 Message-ID: <20220210224329.2793-10-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220210224329.2793-1-mario.limonciello@amd.com> References: <20220210224329.2793-1-mario.limonciello@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 43be3d63-05e4-4e16-9aee-08d9ece6cfdd X-MS-TrafficTypeDiagnostic: BN7PR12MB2675: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: cLsYPd3OUvcoClojACS88+9RFO/jh2lB/qXRqPvZA3tVoXceLiCAPGOJMeStCrfUxMai4SNg3kHZnV/tGf6r8B/C+ZnfOqrHqVflcprk+UOgDWU2TPqtPn2AEJQQVMSA45lFpCZJePDuUrUGRH9XJSitxXFWyak9QCT8NG3UF+Q7LTnT/Uk/vhJKkra8S+zWPjZ2ocM2jeciZq3WV7c23PTWAuzSIZQunG3chZPQsC6NelxzfiekCIYY2XZal36dzSu7/H1HdeKfeAmuWkKsDVz9V/IlTlLVxPmSIFL1mSTrZrkDoAAcbx8XTR3oiqdglXSCrYY+BV3jNRw8Xr1koXVPYNb+mwXtOGlHk5WUM3bNGF+Tfp8G9TuMc0cjqsrt/Pukx9c+HHqS1QuX8NRXvj4RtpW9pn908nWGKpst6KFDCGsK1g7u/3gjbo56LvJapdqfmVOWOXtGBZoChYdjjjnUqhgfNCWytknprMsiOeK3XN4Sq5vLMh4U+g5WhZOmwD/KaBp8vcBX5WwZmXofRFlw4Mlnis6Hr4ROWn89kT40q6fk47g4y5SkreOwo372eAm1Mr+tYymnineqgJfNKi8heC0CHSCFk8Gb3hk7lvRwDoaS/XVoLPQY4ztROdPiyLrMa/s9njO9He7OGFIc5b9uMrax7fnd2qincoIWkz66pXefte7kc2RZNG8i+pUI1bRNTDSibY6z1Vd6bIZpNxL53c5/hccNQu428hlsrMI= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(356005)(26005)(110136005)(16526019)(336012)(426003)(54906003)(316002)(82310400004)(8936002)(70586007)(86362001)(70206006)(4326008)(8676002)(186003)(7696005)(2616005)(81166007)(2906002)(6666004)(1076003)(508600001)(83380400001)(47076005)(36860700001)(36756003)(40460700003)(44832011)(5660300002)(7416002)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 22:43:52.3050 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 43be3d63-05e4-4e16-9aee-08d9ece6cfdd 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: BN8NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR12MB2675 Precedence: bulk List-ID: X-Mailing-List: linux-usb@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