]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amdgpu: avoid reading vf2pf info size from FB
authorZhigang Luo <Zhigang.Luo@amd.com>
Tue, 16 Apr 2024 20:35:14 +0000 (16:35 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:06:39 +0000 (11:06 +0200)
[ Upstream commit 3bcc0ee14768d886cedff65da72d83d375a31a56 ]

VF can't access FB when host is doing mode1 reset. Using sizeof to get
vf2pf info size, instead of reading it from vf2pf header stored in FB.

Signed-off-by: Zhigang Luo <Zhigang.Luo@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c

index bd53844a8ba4d33fe9ae9119092f3e4f97ef45cb..ca4c915e3a6c75a6028f59e0f02795b28d5c7f82 100644 (file)
@@ -552,7 +552,7 @@ static int amdgpu_virt_write_vf2pf_data(struct amdgpu_device *adev)
 
        vf2pf_info->checksum =
                amd_sriov_msg_checksum(
-               vf2pf_info, vf2pf_info->header.size, 0, 0);
+               vf2pf_info, sizeof(*vf2pf_info), 0, 0);
 
        return 0;
 }