drm/amdgpu: move xgmi init/fini to xgmi_add/remove_device call (v2)
authorHawking Zhang <Hawking.Zhang@amd.com>
Mon, 23 Dec 2019 08:51:42 +0000 (16:51 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 6 Feb 2020 20:04:36 +0000 (15:04 -0500)
commit0b9d37609a7b247bb70b15d28138e3e77b300c2a
treef500645ca0850bebd568e29b35b0e5c92176d698
parent1746d5a1d1a17dd389a00f335e2a1320feb4625b
drm/amdgpu: move xgmi init/fini to xgmi_add/remove_device call (v2)

For sriov, psp ip block has to be initialized before
ih block for the dynamic register programming interface
that needed for vf ih ring buffer. On the other hand,
current psp ip block hw_init function will initialize
xgmi session which actaully depends on interrupt to
return session context. This results an empty xgmi ta
session id and later failures on all the xgmi ta cmd
invoked from vf. xgmi ta session initialization has to
be done after ih ip block hw_init call.

to unify xgmi session init/fini for both bare-metal
sriov virtualization use scenario, move xgmi ta init
to xgmi_add_device call, and accordingly terminate xgmi
ta session in xgmi_remove_device call.

The existing suspend/resume sequence will not be changed.

v2: squash in return fix from Nirmoy

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Frank Min <Frank.Min@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.h