summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-09-16 02:18:49 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-09-16 02:18:49 +0000
commit2cfeb77a7f99e7b807669356a330aba43d4ca993 (patch)
tree28d49a9cedd251fe7ddbc910db88bc61b8e2dc1a
parentba9a9827af7ca19ca8a39d3ee80e1d9c23108362 (diff)
drm/amdgpu: Move psp_xgmi_terminate call from amdgpu_xgmi_remove_device to psp_hw_fini
From YiPeng Chai c15c2c2c08964fd99d3366f80742129f8ae28eaa in linux 5.15.y/5.15.68 9d705d7741ae70764f3d6d87e67fad3b5c30ffd0 in mainline linux
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_psp.c3
-rw-r--r--sys/dev/pci/drm/amd/amdgpu/amdgpu_xgmi.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp.c
index 9f767ce42f6..82dcdb618d6 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_psp.c
@@ -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);
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_xgmi.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_xgmi.c
index 2d1921e1142..7a7f49b784c 100644
--- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_xgmi.c
+++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_xgmi.c
@@ -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)