drm/amdgpu: Move psp_xgmi_terminate call from amdgpu_xgmi_remove_device to psp_hw_fini
authorjsg <jsg@openbsd.org>
Fri, 16 Sep 2022 02:18:48 +0000 (02:18 +0000)
committerjsg <jsg@openbsd.org>
Fri, 16 Sep 2022 02:18:48 +0000 (02:18 +0000)
From YiPeng Chai
c15c2c2c08964fd99d3366f80742129f8ae28eaa in linux 5.15.y/5.15.68
9d705d7741ae70764f3d6d87e67fad3b5c30ffd0 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_psp.c
sys/dev/pci/drm/amd/amdgpu/amdgpu_xgmi.c

index 9f767ce..82dcdb6 100644 (file)
@@ -2729,6 +2729,9 @@ static int psp_hw_fini(void *handle)
                psp_rap_terminate(psp);
                psp_dtm_terminate(psp);
                psp_hdcp_terminate(psp);
+
+               if (adev->gmc.xgmi.num_physical_nodes > 1)
+                       psp_xgmi_terminate(psp);
        }
 
        psp_asd_unload(psp);
index 2d1921e..7a7f49b 100644 (file)
@@ -739,7 +739,7 @@ int amdgpu_xgmi_remove_device(struct amdgpu_device *adev)
                amdgpu_put_xgmi_hive(hive);
        }
 
-       return psp_xgmi_terminate(&adev->psp);
+       return 0;
 }
 
 static int amdgpu_xgmi_ras_late_init(struct amdgpu_device *adev)