drm/amdgpu: not to save bo in the case of RAS err_event_athub
authorjsg <jsg@openbsd.org>
Thu, 30 Nov 2023 02:18:37 +0000 (02:18 +0000)
committerjsg <jsg@openbsd.org>
Thu, 30 Nov 2023 02:18:37 +0000 (02:18 +0000)
From David (Ming Qiang) Wu
5b978a8ce49719625c796f80ef6929312743badd in linux-6.1.y/6.1.64
fa1f1cc09d588a90c8ce3f507c47df257461d148 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_vcn.c

index 38de4be..5ad507e 100644 (file)
@@ -393,8 +393,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;