From: jsg Date: Fri, 16 Sep 2022 02:18:48 +0000 (+0000) Subject: drm/amdgpu: Move psp_xgmi_terminate call from amdgpu_xgmi_remove_device to psp_hw_fini X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f8d078a02c33c6169cdbebabac11f64b9e1b3746;p=openbsd 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 --- 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)