[PATCH] drm/amdgpu: avoid reading vf2pf info size from FB
Zhang, Hawking
Hawking.Zhang at amd.com
Tue Apr 30 14:43:20 UTC 2024
[AMD Official Use Only - General]
Reviewed-by: Hawking Zhang <Hawking.Zhang at amd.com>
Regards,
Hawking
-----Original Message-----
From: Luo, Zhigang <Zhigang.Luo at amd.com>
Sent: Tuesday, April 30, 2024 22:24
To: amd-gfx at lists.freedesktop.org
Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Saye, Sashank <Sashank.Saye at amd.com>; Chan, Hing Pong <Jeffrey.Chan at amd.com>; Lazar, Lijo <Lijo.Lazar at amd.com>; Luo, Zhigang <Zhigang.Luo at amd.com>
Subject: [PATCH] drm/amdgpu: avoid reading vf2pf info size from FB
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 at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 54ab51a4ada7..c84d2217005e 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -583,7 +583,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(struct amd_sriov_msg_vf2pf_info), 0, 0);
return 0;
}
--
2.25.1
More information about the amd-gfx
mailing list