mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
drm/amdgpu: Restore partition mode after reset
On a full device reset, PSP FW gets unloaded. Hence restore the partition mode by placing a new request. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Asad Kamal <asad.kamal@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Tested-by: Asad Kamal <asad.kamal@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -163,16 +163,11 @@ int amdgpu_xcp_init(struct amdgpu_xcp_mgr *xcp_mgr, int num_xcps, int mode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int amdgpu_xcp_switch_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr, int mode)
|
||||
static int __amdgpu_xcp_switch_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr,
|
||||
int mode)
|
||||
{
|
||||
int ret, curr_mode, num_xcps = 0;
|
||||
|
||||
if (!xcp_mgr || mode == AMDGPU_XCP_MODE_NONE)
|
||||
return -EINVAL;
|
||||
|
||||
if (xcp_mgr->mode == mode)
|
||||
return 0;
|
||||
|
||||
if (!xcp_mgr->funcs || !xcp_mgr->funcs->switch_partition_mode)
|
||||
return 0;
|
||||
|
||||
@@ -201,6 +196,25 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
int amdgpu_xcp_switch_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr, int mode)
|
||||
{
|
||||
if (!xcp_mgr || mode == AMDGPU_XCP_MODE_NONE)
|
||||
return -EINVAL;
|
||||
|
||||
if (xcp_mgr->mode == mode)
|
||||
return 0;
|
||||
|
||||
return __amdgpu_xcp_switch_partition_mode(xcp_mgr, mode);
|
||||
}
|
||||
|
||||
int amdgpu_xcp_restore_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr)
|
||||
{
|
||||
if (!xcp_mgr || xcp_mgr->mode == AMDGPU_XCP_MODE_NONE)
|
||||
return 0;
|
||||
|
||||
return __amdgpu_xcp_switch_partition_mode(xcp_mgr, xcp_mgr->mode);
|
||||
}
|
||||
|
||||
int amdgpu_xcp_query_partition_mode(struct amdgpu_xcp_mgr *xcp_mgr, u32 flags)
|
||||
{
|
||||
int mode;
|
||||
|
||||
Reference in New Issue
Block a user