From patchwork Wed Jan 4 16:40:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Limonciello X-Patchwork-Id: 39038 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5243305wrt; Wed, 4 Jan 2023 08:50:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXvvCHL+utNXEy61uZtsEWMtJlIgoslzWqCRz0RSVL8dmmjIpf62A0Pd0K6e5eUUOwHNPsOE X-Received: by 2002:a17:907:3e26:b0:7ad:c8d7:4fd9 with SMTP id hp38-20020a1709073e2600b007adc8d74fd9mr54143756ejc.36.1672851045722; Wed, 04 Jan 2023 08:50:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672851045; cv=pass; d=google.com; s=arc-20160816; b=nB/mYWbzM3yz4WP5bl0kBAqu73pyc1+QPfcTIIKAhMCR75fhurqB9CFrGUDXEW8jyj i7FJg+6ggDNxQgDWMRBHkeTGpgn9rC8Zs2Fkh9Sycowu5JfbRv1L5/oAa1PCWKtGDjyj nnFfRd9DF3l4lpbEJfEt9t0PSMFvaM2t2G32gBIqWjlhBBHGWsIF/RQ06246SUx9jWnj yuxDqi8qJwwDdk51Z7s5lM+G4OO3ju95DgepIfvPJ198PcaHoMvs+iPaNJodSTVAP/YF Y21S19TbD9fRduDM0wlSA7MKSzl/g+3OV0f4mCw846z0HM7bK04rDecZdYOsxDKqn6+c tfyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TdDo540KYk3IWe+cQKczP4f5TYkjndp0Q8wogcq2XY8=; b=GU9eCPMJJ0BOqGABLs7CuXaS0LzpLDajCZLh5m1axYdjREkyr0mTjINjl+lFqblNHK Baxdzwglc4fzmSU7bAgf4wdhtvxDsrdZlRcFxkLfS9A0GP+Hc9VnzAVqGUcD2YCuGjxN 8MkzdjmKhfleRO9BTOZn4Zz+EIz6l8BMI1J8lnDvU6L2Hh4+8Ic5dIrbAMbMEQKzZGfx CL0HChWFi4kAf0LZ7MkY/tCqCJbohiVLs9YT4CzDe5sUaLYcVy8JaTpPyOT+IbYBQydZ QNrs4zSPisXGFjXtoUH8HoAEdpZ54ltLOf9IH6nhar//F7miq+7N5rL1mSSepqwEekRI dtXw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Za10zzCz; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk34-20020a1709077fa200b008366ae33ecesi30097825ejc.171.2023.01.04.08.50.22; Wed, 04 Jan 2023 08:50:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=Za10zzCz; arc=pass (i=1 spf=pass spfdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240035AbjADQtI (ORCPT + 99 others); Wed, 4 Jan 2023 11:49:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239854AbjADQrJ (ORCPT ); Wed, 4 Jan 2023 11:47:09 -0500 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2050.outbound.protection.outlook.com [40.107.94.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C56843A28 for ; Wed, 4 Jan 2023 08:45:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ao3P3xp8sVApihMK8/luFDByBgDqmPCbD599z6e5+YkWr7UafopMrTEgKzlUNRVjAVjB6e0b/H4EGWt/GkXK8xRSO2/6GTEMa03iscI6VwcAnHDzSIqxR/X+KKsB2LmfJ2u6gcv9Rt8ir1kZvhSfBt2BV2eLLNmYqW+qSEY4A/Nm8g+9KDfAUUn+EfYvyAvug11JCAg9TyEDS+G/2R/J7f317d74oh/LkQ2XQuDz6QIYEXNtkDa+sXEyvMMCwCU8vwHW8jZaNhLYcHx3Tuw9soZgRu03Sd9a7K67jHPaTOp1R4bQ1ZiTWzEFPxdMsSIYUfrauUGzIytt6FyRWjME/g== 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=TdDo540KYk3IWe+cQKczP4f5TYkjndp0Q8wogcq2XY8=; b=DQpYdOJ1drr5f3L42o82aRBA50iWiX3t+kEmlqLHoroCoZ0iUxBOzvBxKzMChZbcj76nyczKqm47KFhDTpO0syQWkphACWfAlJhGw2n7XzEWRwWhsXBgqDs7aFyqI808EB2bVmezqs3pjPek8M+MXmyMMioW78WwXhguIn3R42Z0xcsWAXaHDRGiiVFx4KEDy0lrMFmaDk69ffO/sFMvLw2aWlwVuB8GfpCafINYoG1teUF8gxgjxGQv60OADFpgJfg3/SI4eJphf1q3hSkAeseJa0G1ipaPkiPic3zawMdu14OS/lwyPHwftEreypztB9r0mLg1OSlZoAQjLQDq3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org 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=TdDo540KYk3IWe+cQKczP4f5TYkjndp0Q8wogcq2XY8=; b=Za10zzCzeBdvOJFbYUz7LxE52R4gIUv63b3QGZWlgTKKEP+R9DkUcjg9fsVaJUqoowYzaO5DmD/729tqAw3n2xRawUorJFfBPWEKbdP7I3+aJp8mKFeOnc/8gsd3R2+GE20oQnvu00aMMhuHqcFvEg4/TxNnF5X9TSbY9g127Qo= Received: from BN8PR15CA0011.namprd15.prod.outlook.com (2603:10b6:408:c0::24) by MW4PR12MB6849.namprd12.prod.outlook.com (2603:10b6:303:20d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Wed, 4 Jan 2023 16:44:38 +0000 Received: from BL02EPF00010209.namprd05.prod.outlook.com (2603:10b6:408:c0:cafe::38) by BN8PR15CA0011.outlook.office365.com (2603:10b6:408:c0::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5966.20 via Frontend Transport; Wed, 4 Jan 2023 16:44:37 +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 BL02EPF00010209.mail.protection.outlook.com (10.167.241.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5944.8 via Frontend Transport; Wed, 4 Jan 2023 16:44:37 +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; Wed, 4 Jan 2023 10:44:36 -0600 From: Mario Limonciello To: Alex Deucher , CC: Javier Martinez Canillas , Carlos Soriano Sanchez , , , David Airlie , "Daniel Vetter" , , Lazar Lijo , Mario Limonciello , "Harry Wentland" , Leo Li , "Rodrigo Siqueira" , "Pan, Xinhui" Subject: [PATCH v5 42/45] drm/amd: Use `amdgpu_ucode_*` helpers for DMCU Date: Wed, 4 Jan 2023 10:40:31 -0600 Message-ID: <20230104164042.30271-43-mario.limonciello@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230104164042.30271-1-mario.limonciello@amd.com> References: <20230104164042.30271-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: BL02EPF00010209:EE_|MW4PR12MB6849:EE_ X-MS-Office365-Filtering-Correlation-Id: 398b027a-dfeb-4c4b-3e18-08daee72f7ed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yWnT2jbKcqSlPgdFu9Bl9qTbTfESE6acqlPdKoRwRNbgKD3u6uDsUNBUu8Eu4AT+7BspaAAEcND0Otj8Y2x7Sx20slc6IUbAtKMYp2hITksbW0JiijFVjsaL6tnOeI+/iv9qVhg7pxzC+O8ws5mrS0oQhw8+5/FxC1cJvoAOuQkK7Z+1zTUrf+4omfGYGKcgF4uyogkl/IXh5jxdqdFetTngE1Rc+LSDxNxoMXit9U5NqOeC70AeKMPuGMCz6K+suSH/YMB+hyUUnVfZI8rn18ZIQx+nvVJTl4K3msUAsNo2xabIXs4BSmYtdP9dtVMKYYODNJxU5HDmWSlF3EFg3aL4aMfpbsZB4K+rOWNePLV44YT1Z/BGmG6ROtvg432da+LJ1pa652RyU+Xe8uvcopyRP9eOT/l0tehD4Ucylxg6PeEsbiG38SY4OfsMfKvg6vHDkN9pln2owowY0n9hk+GPLMylvIB93nbcZdeZNMWh6cM69PZkpboSlJwL0eUA4KzXHT8BZljQZ61mTsxejAxfbuCKy2NHxGHmn+8J1f/q5npNiAhMTqwaHBdRWWFFdhj0pEc2VrrhBrmPUKG4sqIHw4ST6nXWLDvBy/xhbGH8DEQVof4Jw2AZ3Pyd20tnjySh2wpRDKWICFbhKGKlVs3PW1QHcziPBXsIUb4QIzejT2sffrKfDPa10Sw//x91YA3N8GmaArFeYvvW5fXUPVP14wnAtwP7KO8W8+FZ3wA4oyAgeF3VLHTf1Z0jBDKr 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:(13230022)(4636009)(39860400002)(376002)(346002)(396003)(136003)(451199015)(40470700004)(46966006)(36840700001)(2616005)(426003)(36860700001)(336012)(83380400001)(47076005)(40480700001)(1076003)(86362001)(40460700003)(82310400005)(81166007)(36756003)(82740400003)(356005)(70206006)(2906002)(44832011)(110136005)(54906003)(41300700001)(5660300002)(4326008)(70586007)(8676002)(8936002)(316002)(26005)(186003)(478600001)(16526019)(6666004)(7696005)(81973001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2023 16:44:37.9080 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 398b027a-dfeb-4c4b-3e18-08daee72f7ed 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: BL02EPF00010209.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB6849 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754111458076322563?= X-GMAIL-MSGID: =?utf-8?q?1754111458076322563?= The `amdgpu_ucode_request` helper will ensure that the return code for missing firmware is -ENODEV so that early_init can fail. The `amdgpu_ucode_release` helper is for symmetry on unloading. Signed-off-by: Mario Limonciello --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 3908d715b90b..19c365283d91 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1881,20 +1881,13 @@ static int load_dmcu_fw(struct amdgpu_device *adev) return 0; } - r = request_firmware_direct(&adev->dm.fw_dmcu, fw_name_dmcu, adev->dev); - if (r == -ENOENT) { + r = amdgpu_ucode_request(adev, &adev->dm.fw_dmcu, fw_name_dmcu); + if (r == -ENODEV) { /* DMCU firmware is not necessary, so don't raise a fuss if it's missing */ DRM_DEBUG_KMS("dm: DMCU firmware not found\n"); adev->dm.fw_dmcu = NULL; return 0; } - if (r) { - dev_err(adev->dev, "amdgpu_dm: Can't load firmware \"%s\"\n", - fw_name_dmcu); - return r; - } - - r = amdgpu_ucode_validate(adev->dm.fw_dmcu); if (r) { dev_err(adev->dev, "amdgpu_dm: Can't validate firmware \"%s\"\n", fw_name_dmcu);