From patchwork Tue Feb 14 15:46:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13140434 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 1CB87C61DA4 for ; Tue, 14 Feb 2023 15:47:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233062AbjBNPrR (ORCPT ); Tue, 14 Feb 2023 10:47:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232940AbjBNPrP (ORCPT ); Tue, 14 Feb 2023 10:47:15 -0500 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2064.outbound.protection.outlook.com [40.107.243.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 557BF28D3D; Tue, 14 Feb 2023 07:47:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KJO4VtVVLdOk3AicIwrHwyzQxcRtXLCv7pLNm06D1pnYc8sDbDqQQecJmhHayMSQ5h82w4uJ6ShWdrxDUrTmJKz3i/ouGbUohuBc/rczOTvs8tvG+CBZ/ntGI4Na9QDKsUQfEdea7BdvVwqkvmc4EVdt0G7XYbEqcc52pwCXVHt8rm3r/fts1EX0hcgF0ymUPwvh0EokKujG+RNgu4aVODoJq/6Y9ha2iqzWlzmpJor0XLIn4kwnY67E2DCjB12c/e6tpnJATO/UjBd6LUYxQ+t6UgIe4Sc/hdQc5aMtCi1nrxpeAZfbTkTkpYmooY0IMnSNoonlyZm6a5vvrUm60A== 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=8858fGuRsCX+Eu2ncz0L3X1FHPKEJ+3xr/O36+dFOeM=; b=eIT8O4SDtm1yDuGJjfdLqpFvfpCwGfRXUM129mgjp1XafRQWF7blrZY8wtY8pqB9ZfHDnbW8ZeDQApaxhBJQHCgIZlG+Fo3XGcenVM6ne7Ek2vznQ70f7y4JV41WIfNCBQQWbktoZ7UIqZt1OeRMNyhKfI324AJWcgw9kiPnEYzRKFHY/Z5FpqleiP/K9c4z/GTuuoDG+ge3fkR+tk1l17lGPZIPp0ffQXR9Ngy27qALFsk/rlTzsH2EtWr/VskZ1/FYJRwVfaXfpINKvrybUH/OV4Zjgv6SYsEA9DYxc+4nSINuYh+vq4X+K1kmjd/hIBgFRSZBb42cIQolHkgRVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linux.intel.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=8858fGuRsCX+Eu2ncz0L3X1FHPKEJ+3xr/O36+dFOeM=; b=22e37WXZaVE49q+CIahikv/0j8dZdwF3FO/lw9Nen2tmKA7p3HqveECGRDmeOkIENE9602pbg6CKhzCyr3CKkdE5QID7N3qGKK/llCW5VgFIz5O1sOZZT9KCRZQn7XMmSnythj11+nuYwsK5jRuKVtHNRsKFvaAJygI2a9sSW2Q= Received: from DS7PR03CA0261.namprd03.prod.outlook.com (2603:10b6:5:3b3::26) by IA1PR12MB8539.namprd12.prod.outlook.com (2603:10b6:208:446::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Tue, 14 Feb 2023 15:47:12 +0000 Received: from DM6NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b3:cafe::3c) by DS7PR03CA0261.outlook.office365.com (2603:10b6:5:3b3::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24 via Frontend Transport; Tue, 14 Feb 2023 15:47:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT005.mail.protection.outlook.com (10.13.172.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6086.24 via Frontend Transport; Tue, 14 Feb 2023 15:47:11 +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.34; Tue, 14 Feb 2023 09:47:10 -0600 From: Mario Limonciello To: , Andreas Noever , Michael Jamet , "Yehezkel Bernat" CC: , Mario Limonciello , , , Subject: [PATCH 1/2] thunderbolt: Read DROM directly from NVM before trying bit banging Date: Tue, 14 Feb 2023 09:46:45 -0600 Message-ID: <20230214154647.874-2-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214154647.874-1-mario.limonciello@amd.com> References: <20230214154647.874-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-TrafficTypeDiagnostic: DM6NAM11FT005:EE_|IA1PR12MB8539:EE_ X-MS-Office365-Filtering-Correlation-Id: c719468f-b030-4bd1-1c01-08db0ea2bc99 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P+8WaJw1wflloPlLwv3fGLf4GzN++8ptykw02rdxLgkZn7MUZZjbycMe1XxQx0HNIsayR+CX5ahR2/kBp/T6P4N7mP3zwijc/rGt0F70VuEbxgGy6/dnPwA4QFOsDT/qz/FluSdfvD+BG/BLRb56DImY0yKWY4g8rXjMC6agUIga6tLbhKC1snvggQF2ZrTc/5i4KBfDjDPIaR/WjfgnowrpwTZkJOfrPpMslcY1tDJ9f9jWA8DQ8tyqvlv9VbsjSNc/UHXfW6BJL6fIj+B1ABVpxwFW3lBGbKh9rITTp9Ky6FjjXCks+vMFhgFd4Melte8yJiSpW4jn050ICSE6WpoQD88E1bKFZGR4crhcBaiq4ZJKwMnc6yhqU75/YjGooyUTvcIolCDqQ8z31/osVYsvMqr3511PGPIXnyzNuNTxoNisW/D104G2Am/LvQ9dD6mxKljeCuCKxJrPfJAx9cLqa0cDWDCNkxL24xpNMPCGMw5snZ6vhRQ3jAT/6LHjxFc3h+ijzQ8tYyYQ++eroHKX8atDqJ0iLaD48JXwg53Sk+L9iuBUVY/aMkl0gXEsZlIfA/VN00dEtqOFdLBZ7KWXOsUJiTwnNslLKhiR1DoEojp0/Ckr/zYJo4A1Has+eHSMyoHmO8iY1Vqud0oGlk4g4628IFwW95K6+bw2Y+h3NLDC2+MOM1S/Mdp9KPR1Xm05ZWigmgWqzP13foSScmxGTRRbJI00D0k4OaYNJ7s60sHnvwtIKNBKsY03/mPJyki4/CF7QRjwUn+qhfVBag== 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:(13230025)(4636009)(346002)(136003)(39860400002)(396003)(376002)(451199018)(36840700001)(46966006)(40470700004)(44832011)(2906002)(6666004)(2616005)(8676002)(336012)(478600001)(356005)(86362001)(4326008)(70206006)(83380400001)(82310400005)(40460700003)(110136005)(54906003)(70586007)(8936002)(82740400003)(7696005)(40480700001)(1076003)(316002)(41300700001)(16526019)(36860700001)(186003)(36756003)(26005)(426003)(81166007)(47076005)(5660300002)(187633001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2023 15:47:11.3761 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c719468f-b030-4bd1-1c01-08db0ea2bc99 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: DM6NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8539 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Some TBT3 devices have a hard time reliably responding to bit banging requests correctly when connected to AMD USB4 hosts running Linux. These problems are not reported in any other CM, and comparing the implementations the Linux CM is the only one that utilizes bit banging to access the DROM. Other CM implementations access the DROM directly from the NVM instead of bit banging. Adjust the flow to try this on TBT3 devices before resorting to bit banging. Cc: stable@vger.kernel.org Signed-off-by: Mario Limonciello --- drivers/thunderbolt/eeprom.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c index c90d22f56d4e1..d9d9567bb938b 100644 --- a/drivers/thunderbolt/eeprom.c +++ b/drivers/thunderbolt/eeprom.c @@ -640,6 +640,10 @@ int tb_drom_read(struct tb_switch *sw) return 0; } + /* TBT3 devices have the DROM as part of NVM */ + if (tb_drom_copy_nvm(sw, &size) == 0) + goto parse; + res = tb_drom_read_n(sw, 14, (u8 *) &size, 2); if (res) return res; From patchwork Tue Feb 14 15:46:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 13140435 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 04F29C05027 for ; Tue, 14 Feb 2023 15:47:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232576AbjBNPrU (ORCPT ); Tue, 14 Feb 2023 10:47:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233005AbjBNPrP (ORCPT ); Tue, 14 Feb 2023 10:47:15 -0500 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2089.outbound.protection.outlook.com [40.107.243.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12A9E29419; Tue, 14 Feb 2023 07:47:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dGUQOvV3nx77UQI8RCkZ21zomEUiOEnsHfUSPN1Owlge8FZPtqcVPdpA1/XCqfWWv/iRJvb0bYqEpAJIGdMySEnNaTXohWY5o4yehNXRyfLGrN0JgrSiWYz0LrGhViTqOmdyGvFPI35UPOkb8GzhtFBxZkFxDrY0jXiZE1rpaaNqRp61+7AixQkhiTCnTWPuGRkRamEsOlhaEQ5U8dl67yyMtSj9uuX17bCsVM61tL2iCfUDoaR2p+wsg0yFzvBf+Kz+NOWemxbv28EwCZLpfEtDW98V+aLjoM0mtND/HT9RABfuscFYCZipRp82Sx47J681BTIzCsCH0QYaytnfeQ== 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=/5ICP+N+nPY3NL8L2EypujKXcsxWO7mxHlHtIoD3Vbo=; b=XNz4MVKa7UGA1RoQOScSaaVzxE3q9+w6TNQoWUo2gzGXgfC1tkVIjx1A4NzoeHDUMkQQW/q8dGTcywDyg6FzkAAVTV9vWYWih67REEtaqaUyPgpT05iRMnrB7wCpSEWCBzl3qYL7mJvduEGUos0CmMhXSzYgXfPrCiVFZUf8vCnGctZNJO0HZ77ylTgSuIkiRnO2VHuwrY2X9BrkfvIHWlMIXex3MhOG7vqNW7rBxPHmlfIELUZhFeFJZSmhQXIpLBTeE/pOGVvZ2KBZUMcweyoY08ILuX7E2PBSfRkHDFJdPJNfIziy52tFTHgJscfBDwNtAppgIdQjag8TfWo/Tw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=linux.intel.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=/5ICP+N+nPY3NL8L2EypujKXcsxWO7mxHlHtIoD3Vbo=; b=sQVahbXNiVE2kdwI8MvwpKkrz2qmPJqKp/sVdhmBex6MUHTFuBsd2rHpeDPaPC6LVJJS3MChO6iWOZBk/PQpKt7JOt4uOdiwkMehzhPL1Qe7vJ2mVlCFujE4Xu7zZR8XuWbMJTsACkGcgbLmDtpmjSyb2EYdYuJRPYm59XgoOT8= Received: from DS7PR03CA0261.namprd03.prod.outlook.com (2603:10b6:5:3b3::26) by DM4PR12MB6615.namprd12.prod.outlook.com (2603:10b6:8:8d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Tue, 14 Feb 2023 15:47:13 +0000 Received: from DM6NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b3:cafe::c1) by DS7PR03CA0261.outlook.office365.com (2603:10b6:5:3b3::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.24 via Frontend Transport; Tue, 14 Feb 2023 15:47:13 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT005.mail.protection.outlook.com (10.13.172.238) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6086.24 via Frontend Transport; Tue, 14 Feb 2023 15:47:13 +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.34; Tue, 14 Feb 2023 09:47:11 -0600 From: Mario Limonciello To: , Andreas Noever , Michael Jamet , "Yehezkel Bernat" CC: , Mario Limonciello , , Subject: [PATCH 2/2] thunderbolt: use `tb_eeprom_get_drom_offset` to discover DROM offset Date: Tue, 14 Feb 2023 09:46:46 -0600 Message-ID: <20230214154647.874-3-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230214154647.874-1-mario.limonciello@amd.com> References: <20230214154647.874-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-TrafficTypeDiagnostic: DM6NAM11FT005:EE_|DM4PR12MB6615:EE_ X-MS-Office365-Filtering-Correlation-Id: 6aae9e30-532f-49ed-0bd5-08db0ea2bd91 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rHqonHCQotnje0bEWCwGLfenaXCi+yoF7fIlEr0KtMrpmQ//AOZiKOqkWtQN+uuIIoFz4zehGuVbOkEMo4w2VbqMoIQoZXs/6VdW/rSgkejhFAy4aZ4hndP9Ov9V9grbpqqM1AfDQEL+OQoz2tbYgi1m7Zsos+Jwilu3E7+CgiOjkjaPOstfiiZUyHpRltjy5woe3/ZVxeSXGUNRtLxvHXtL4ysinT5MIf8tTrHznRNqoMYemfG1nJ/J9xEeHSYfZoiBbv7TbPWl0jL2vj1auSvPbheQghbHHI9jfLJaU69J6e/IGZ4KOVBhs9UdJBJApYoFAAYZz5RcoV6H2c2Rcopkhm/taueo+t3LTDXCl1lG3jXtRF/0B0zGwdtGZGl0ClVhpGEaVvm48erU3BAsFFOMwkPU8sGeZr9SFlV3KDXYfP5UKaPhv64c8jAAwIzruKTsnqcldrO7MfoGjRdI/8x89q3L1ZxnSiYEzioMXOL9+IRJMvo8WTwBffmSM8fHXjpumpo9Kk+suRfSIQoiede+wzN2Yywc/LrBAaGzjDQhfMc7gvrChOqK9pnw56NF/6gcIc8p4pP/GGsZRz+xcpYjbcB/mcp927S/gKSw+dNAmw/qmVx2WWPsmPjITOtfz02dbqiFXBaKicYPGlf/8Ai9T7kjsXpiO82Yx1heKiLwyBrM+HDKOZM5NBqjYFMcpJB8BAtT1N9AQpiqR9YWW81ahsvYh27++C8GWmDmvpiRz/JongM7/Mo5ivxChPSs 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:(13230025)(4636009)(346002)(136003)(39860400002)(376002)(396003)(451199018)(40470700004)(36840700001)(46966006)(478600001)(41300700001)(4744005)(5660300002)(8936002)(110136005)(54906003)(40460700003)(82310400005)(8676002)(7696005)(70206006)(70586007)(86362001)(4326008)(316002)(83380400001)(426003)(47076005)(336012)(186003)(26005)(6666004)(44832011)(1076003)(40480700001)(356005)(2616005)(36756003)(16526019)(2906002)(81166007)(82740400003)(36860700001)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2023 15:47:13.0166 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6aae9e30-532f-49ed-0bd5-08db0ea2bd91 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: DM6NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6615 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The static function `tb_eeprom_get_drom_offset` has more safety guards for the DROM offset fetching. Use this instead of just `tb_sw_read` No intended functional changes. Signed-off-by: Mario Limonciello --- drivers/thunderbolt/eeprom.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/thunderbolt/eeprom.c b/drivers/thunderbolt/eeprom.c index d9d9567bb938b..82124e9db755c 100644 --- a/drivers/thunderbolt/eeprom.c +++ b/drivers/thunderbolt/eeprom.c @@ -471,14 +471,13 @@ static int tb_drom_copy_efi(struct tb_switch *sw, u16 *size) static int tb_drom_copy_nvm(struct tb_switch *sw, u16 *size) { - u32 drom_offset; + u16 drom_offset; int ret; if (!sw->dma_port) return -ENODEV; - ret = tb_sw_read(sw, &drom_offset, TB_CFG_SWITCH, - sw->cap_plug_events + 12, 1); + ret = tb_eeprom_get_drom_offset(sw, &drom_offset); if (ret) return ret;