Skip to contentSkip to conversation

drm/amd/amdgpu: SRIOV full reset issue with VCN

PATCH In review Bokun Zhang 2 participants 2 messages Nov 30, 2023 – Dec 1, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 drm/amd/amdgpu: SRIOV full reset issue with VCN

- After a full reset, VF's FB will be cleaned. This includes the VCN's fw_shared memory.

However, there is no suspend-resume routine for SRIOV VF. Therefore, the data in the fw_shared memory will be lost forever and it causes engine hang later on.

We must repopulate the data in fw_shared during
SRIOV hw_init

---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +3 -0
index 54b03df63a51..b71590b67e20 100644
@@ -1280,6 +1280,9 @@ static int vcn_v4_0_start_sriov(struct amdgpu_device *adev)
 		if (adev->vcn.harvest_config & (1 << i))
 			continue;
 
+		// Must re/init fw_shared at beginning
+		vcn_v4_0_fw_shared_init(adev, i);
+
 		table_size = 0;
 
 		MMSCH_V4_0_INSERT_DIRECT_RD_MOD_WT(SOC15_REG_OFFSET(VCN, i,
Signature · 1 line
2.34.1
#1 lore raw

[AMD Official Use Only - General]

Series Reviewed-by: Emily Deng <[email protected]>

Quoted 44 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Bokun Zhang
Sent: Thursday, November 30, 2023 8:21 AM
To: [email protected]
Cc: Zhang, Bokun <[email protected]>
Subject: [PATCH v2 2/2] drm/amd/amdgpu: SRIOV full reset issue with VCN

- After a full reset, VF's FB will be cleaned. This includes the VCN's fw_shared memory.

However, there is no suspend-resume routine for
SRIOV VF. Therefore, the data in the fw_shared
memory will be lost forever and it causes engine
hang later on.

We must repopulate the data in fw_shared during
SRIOV hw_init

---
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 3 +++

1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +3 -0
index 54b03df63a51..b71590b67e20 100644
@@ -1280,6 +1280,9 @@ static int vcn_v4_0_start_sriov(struct
 amdgpu_device *adev)
              if (adev->vcn.harvest_config & (1 << i))
                      continue;
 
+              // Must re/init fw_shared at beginning
+              vcn_v4_0_fw_shared_init(adev, i);
+
              table_size = 0;
 
      MMSCH_V4_0_INSERT_DIRECT_RD_MOD_WT(SOC15_REG_OFFSET(VC

N, i,
--
2.34.1