drm/amdgpu: skip psp suspend for IMU enabled ASICs mode2 reset
authorjsg <jsg@openbsd.org>
Mon, 17 Apr 2023 05:21:13 +0000 (05:21 +0000)
committerjsg <jsg@openbsd.org>
Mon, 17 Apr 2023 05:21:13 +0000 (05:21 +0000)
From Tim Huang
62de38c8201d853b130fc54ddbfab748180053e2 in linux-6.1.y/6.1.24
e11c775030c5585370fda43035204bb5fa23b139 in mainline linux

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

index c68e881..113ce82 100644 (file)
@@ -3072,6 +3072,18 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev)
                    (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SDMA))
                        continue;
 
+               /* Once swPSP provides the IMU, RLC FW binaries to TOS during cold-boot.
+                * These are in TMR, hence are expected to be reused by PSP-TOS to reload
+                * from this location and RLC Autoload automatically also gets loaded
+                * from here based on PMFW -> PSP message during re-init sequence.
+                * Therefore, the psp suspend & resume should be skipped to avoid destroy
+                * the TMR and reload FWs again for IMU enabled APU ASICs.
+                */
+               if (amdgpu_in_reset(adev) &&
+                   (adev->flags & AMD_IS_APU) && adev->gfx.imu.funcs &&
+                   adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP)
+                       continue;
+
                /* XXX handle errors */
                r = adev->ip_blocks[i].version->funcs->suspend(adev);
                /* XXX handle errors */