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 2E1FDC54EE9 for ; Fri, 16 Sep 2022 10:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232142AbiIPK1q (ORCPT ); Fri, 16 Sep 2022 06:27:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232071AbiIPK03 (ORCPT ); Fri, 16 Sep 2022 06:26:29 -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 1EEF9AF0CD; Fri, 16 Sep 2022 03:16:22 -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 3EEA7B8253A; Fri, 16 Sep 2022 10:15:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92BA8C433C1; Fri, 16 Sep 2022 10:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663323314; bh=MNEXrRhDD3aFkgxP+ss1EhnnmsiNsYmZ4Qi7SSL4v/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z4BPoudvRvlKz+n5lkw9KO+a6aNb1XyRh0Kkq4stOo2KU1t865wiUiK7+BuqaCOvJ w+E0ugOdZ2tBeuo3HTzayl+pfDtfjGQG6o7E1mJl4Lca88Nqyl6gxMD/yBuT0wY6lK e9smaV4HG1aIQKTMY1jlpgMj15UUYFfd5/7q28Xk= 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.19 27/38] drm/amd/amdgpu: skip ucode loading if ucode_size == 0 Date: Fri, 16 Sep 2022 12:09:01 +0200 Message-Id: <20220916100449.604950547@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220916100448.431016349@linuxfoundation.org> References: <20220916100448.431016349@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 2b00f8fe15a89..b19bf0c3f3737 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -2372,7 +2372,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