Skip to contentSkip to conversation

drm/amdgpu: not to save bo in the case of RAS err_event_athub

PATCH In review David (Ming Qiang) Wu 2 participants 2 messages Sep 21, 2023 – Sep 22, 2023

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

PATCH 1/1 drm/amdgpu: not to save bo in the case of RAS err_event_athub

err_event_athub will corrupt VCPU buffer and not good to be restored in amdgpu_vcn_resume() and in this case the VCPU buffer needs to be cleared for VCN firmware to work properly.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +7 -0
index c93f3a4c0e31..f4963330c772 100644
@@ -294,8 +294,15 @@ int amdgpu_vcn_suspend(struct amdgpu_device *adev)
 	void *ptr;
 	int i, idx;
 
+	bool in_ras_intr = amdgpu_ras_intr_triggered();
+
 	cancel_delayed_work_sync(&adev->vcn.idle_work);
 
+	/* err_event_athub will corrupt VCPU buffer, so we need to
+	 * restore fw data and clear buffer in amdgpu_vcn_resume() */
+	if (in_ras_intr)
+		return 0;
+
 	for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
 		if (adev->vcn.harvest_config & (1 << i))
 			continue;
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw

[AMD Official Use Only - General]

-----Original Message-----
From: Wu, David <[email protected]>
Sent: Thursday, September 21, 2023 3:18 PM
To: [email protected]
Cc: Koenig, Christian <[email protected]>; Deucher, Alexander <[email protected]>; Liu, Leo <[email protected]>
Subject: [PATCH] drm/amdgpu: not to save bo in the case of RAS err_event_athub

err_event_athub will corrupt VCPU buffer and not good to be restored in amdgpu_vcn_resume() and in this case the VCPU buffer needs to be cleared for VCN firmware to work properly.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +7 -0
index c93f3a4c0e31..f4963330c772 100644
@@ -294,8 +294,15 @@ int amdgpu_vcn_suspend(struct amdgpu_device *adev)
        void *ptr;
        int i, idx;
 
+       bool in_ras_intr = amdgpu_ras_intr_triggered();
+
        cancel_delayed_work_sync(&adev->vcn.idle_work);
 
+       /* err_event_athub will corrupt VCPU buffer, so we need to
+        * restore fw data and clear buffer in amdgpu_vcn_resume() */
+       if (in_ras_intr)
+               return 0;
+
        for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
                if (adev->vcn.harvest_config & (1 << i))
                        continue;

--
2.34.1