aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
diff options
context:
space:
mode:
authorZhigang Luo <Zhigang.Luo@amd.com>2024-02-29 16:04:35 -0500
committerAlex Deucher <alexander.deucher@amd.com>2024-03-20 13:38:13 -0400
commitab66c832847fcdffc97d4591ba5547e3990d9d33 (patch)
tree8bc9a7f05c3784d93db7b854403aa8827af23f49 /drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
parentdrm/admgpu: add vclk and dclk sysfs node for some ASICs (diff)
downloadlinux-ab66c832847fcdffc97d4591ba5547e3990d9d33.tar.gz
linux-ab66c832847fcdffc97d4591ba5547e3990d9d33.zip
drm/amdgpu: trigger flr_work if reading pf2vf data failed
if reading pf2vf data failed 30 times continuously, it means something is wrong. Need to trigger flr_work to recover the issue. also use dev_err to print the error message to get which device has issue and add warning message if waiting IDH_FLR_NOTIFICATION_CMPL timeout. Signed-off-by: Zhigang Luo <Zhigang.Luo@amd.com> Acked-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 7a4eae36778a..aed60aaf1a55 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -32,6 +32,7 @@
#include "amdgpu.h"
#include "amdgpu_ras.h"
+#include "amdgpu_reset.h"
#include "vi.h"
#include "soc15.h"
#include "nv.h"
@@ -424,7 +425,7 @@ static int amdgpu_virt_read_pf2vf_data(struct amdgpu_device *adev)
return -EINVAL;
if (pf2vf_info->size > 1024) {
- DRM_ERROR("invalid pf2vf message size\n");
+ dev_err(adev->dev, "invalid pf2vf message size: 0x%x\n", pf2vf_info->size);
return -EINVAL;
}
@@ -435,7 +436,9 @@ static int amdgpu_virt_read_pf2vf_data(struct amdgpu_device *adev)
adev->virt.fw_reserve.p_pf2vf, pf2vf_info->size,
adev->virt.fw_reserve.checksum_key, checksum);
if (checksum != checkval) {
- DRM_ERROR("invalid pf2vf message\n");
+ dev_err(adev->dev,
+ "invalid pf2vf message: header checksum=0x%x calculated checksum=0x%x\n",
+ checksum, checkval);
return -EINVAL;
}
@@ -449,7 +452,9 @@ static int amdgpu_virt_read_pf2vf_data(struct amdgpu_device *adev)
adev->virt.fw_reserve.p_pf2vf, pf2vf_info->size,
0, checksum);
if (checksum != checkval) {
- DRM_ERROR("invalid pf2vf message\n");
+ dev_err(adev->dev,
+ "invalid pf2vf message: header checksum=0x%x calculated checksum=0x%x\n",
+ checksum, checkval);
return -EINVAL;
}
@@ -485,7 +490,7 @@ static int amdgpu_virt_read_pf2vf_data(struct amdgpu_device *adev)
((struct amd_sriov_msg_pf2vf_info *)pf2vf_info)->uuid;
break;
default:
- DRM_ERROR("invalid pf2vf version\n");
+ dev_err(adev->dev, "invalid pf2vf version: 0x%x\n", pf2vf_info->version);
return -EINVAL;
}
@@ -584,8 +589,21 @@ static void amdgpu_virt_update_vf2pf_work_item(struct work_struct *work)
int ret;
ret = amdgpu_virt_read_pf2vf_data(adev);
- if (ret)
+ if (ret) {
+ adev->virt.vf2pf_update_retry_cnt++;
+ if ((adev->virt.vf2pf_update_retry_cnt >= AMDGPU_VF2PF_UPDATE_MAX_RETRY_LIMIT) &&
+ amdgpu_sriov_runtime(adev) && !amdgpu_in_reset(adev)) {
+ if (amdgpu_reset_domain_schedule(adev->reset_domain,
+ &adev->virt.flr_work))
+ return;
+ else
+ dev_err(adev->dev, "Failed to queue work! at %s", __func__);
+ }
+
goto out;
+ }
+
+ adev->virt.vf2pf_update_retry_cnt = 0;
amdgpu_virt_write_vf2pf_data(adev);
out:
@@ -606,6 +624,7 @@ void amdgpu_virt_init_data_exchange(struct amdgpu_device *adev)
adev->virt.fw_reserve.p_pf2vf = NULL;
adev->virt.fw_reserve.p_vf2pf = NULL;
adev->virt.vf2pf_update_interval_ms = 0;
+ adev->virt.vf2pf_update_retry_cnt = 0;
if (adev->mman.fw_vram_usage_va && adev->mman.drv_vram_usage_va) {
DRM_WARN("Currently fw_vram and drv_vram should not have values at the same time!");
>26-1094/+3962 2002-04-05[PATCH] ->setattr() locking changesAndrew Morton1-0/+3 2002-04-05Update for new notify_change semanticsLinus Torvalds1-2/+0 2002-04-05MADT parsing improvements (Paul D & Richard Schaal)Andy Grover4-131/+298 2002-04-05ACPI driver updatesAndy Grover19-919/+1828 2002-04-05ACPI interpreter update.Andy Grover70-1028/+1610 2002-04-05[PATCH] loop deadlock fixAndrew Morton1-1/+1 2002-04-05Cset exclude: davej@suse.de|ChangeSet|20020404222348|23820Linus Torvalds1-1/+2 2002-04-04Clean up do_truncate due notify_change() locking changev2.5.8-pre2Linus Torvalds1-4/+1 2002-04-04Force some semblance of workingness onto qla1280 driverLinus Torvalds1-12/+12 2002-04-04Oops, remove remnants of old attribute lockLinus Torvalds1-1/+0 2002-04-05Make legacy drivers who use "virt_to_bus()" and friends work on x86.Linus Torvalds1-4/+4 2002-04-04[PATCH] shift BKL out of notify_changeDave Hansen17-63/+132 2002-04-04[PATCH] PATCH 4a or 4 : knfs : typo...Neil Brown1-1/+1 2002-04-04[PATCH] PATCH 4 of 4 : knfsd : Increase the max block size for NFS replies.Neil Brown2-3/+3 2002-04-04[PATCH] PATCH 3 of 4 : knfsd : Store the fsid in the returned attributes inst...Neil Brown4-22/+46 2002-04-04[PATCH] PATCH 2 of 4 : knfsd : Allow exporting of deviceless filesystems if f...Neil Brown1-3/+15 2002-04-04[PATCH] PATCH 1 of 4 : knfsd : Use symbols for size calculation for response ...Neil Brown2-37/+49 2002-04-04[PATCH] elevator 'buglet'Jens Axboe1-6/+0 2002-04-04USBGreg Kroah-Hartman2-39/+38