drm/amdgpu: not to save bo in the case of RAS err_event_athub
authorDavid (Ming Qiang) Wu <David.Wu3@amd.com>
Thu, 14 Sep 2023 20:34:08 +0000 (16:34 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 26 Sep 2023 21:00:23 +0000 (17:00 -0400)
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.

Acked-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: David (Ming Qiang) Wu <David.Wu3@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c

index c93f3a4c0e310586d6b9bcc9c1e7a3a9c6427d96..f4963330c772a9c717dae129e6ccf2ec1c4d3ef0 100644 (file)
@@ -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;