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: 541694 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: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: 541695 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: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: 541693 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: 541691 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: 541692 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)