From mboxrd@z Thu Jan 1 00:00:00 1970 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 CA75AECAAD8 for ; Fri, 16 Sep 2022 10:21:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231874AbiIPKVj (ORCPT ); Fri, 16 Sep 2022 06:21:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232083AbiIPKTe (ORCPT ); Fri, 16 Sep 2022 06:19:34 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 461E51E3F6; Fri, 16 Sep 2022 03:13:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id D417EB82521; Fri, 16 Sep 2022 10:13:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 104FEC433D6; Fri, 16 Sep 2022 10:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663323184; bh=Y2kWidGblQU7Jl85rXu4izXx+BbFIXaPCD5M7Z32Qfo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IqgkpcoAAewrOSvusV7OGFPm7tjL28v1CX07tlax/asmEDmCWxmH9rdPeaqCbiBdn DaURl0wuXLLP0Q1XLb1pqBi2InDyDpxAMEly1Qtm1RBYxnoPhoxGc1ca2ePLmOZMMk HrxnGPXYblyOS1On/5sYsKZ2aNfu3AjhnMRdQoPg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chengming Gui , Hawking Zhang , Alex Deucher , Sasha Levin Subject: [PATCH 5.15 25/35] drm/amd/amdgpu: skip ucode loading if ucode_size == 0 Date: Fri, 16 Sep 2022 12:08:48 +0200 Message-Id: <20220916100448.005789139@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100446.916515275@linuxfoundation.org> References: <20220916100446.916515275@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chengming Gui [ Upstream commit 39c84b8e929dbd4f63be7e04bf1a2bcd92b44177 ] Restrict the ucode loading check to avoid frontdoor loading error. Signed-off-by: Chengming Gui Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 5b41c29f3ed50..65744c3bd3648 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -2505,7 +2505,7 @@ static int psp_load_smu_fw(struct psp_context *psp) static bool fw_load_skip_check(struct psp_context *psp, struct amdgpu_firmware_info *ucode) { - if (!ucode->fw) + if (!ucode->fw || !ucode->ucode_size) return true; if (ucode->ucode_id == AMDGPU_UCODE_ID_SMC && -- 2.35.1