]> Git Repo - linux.git/commitdiff
drm/amdgpu: Use SPX as default in partition config
authorLijo Lazar <[email protected]>
Mon, 14 Oct 2024 07:40:13 +0000 (13:10 +0530)
committerAlex Deucher <[email protected]>
Tue, 22 Oct 2024 21:50:37 +0000 (17:50 -0400)
In certain cases - ex: when a reset is required on initialization - XCP
manager won't have a valid partition mode. In such cases, use SPX as the
default selected mode for which partition configuration details are
populated.

Fixes: 4ae86dc87850 ("drm/amdgpu: Add sysfs nodes to get xcp details")
Signed-off-by: Lijo Lazar <[email protected]>
Reported-by: Hao Zhou <[email protected]>
Reviewed-by: Asad Kamal <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c

index 111bf897e72e6b5ee5cba4da03f34ea2fc2a2fd9..83a16918ea765a2b9c06a88b7bc81113d126c036 100644 (file)
@@ -606,7 +606,7 @@ void amdgpu_xcp_cfg_sysfs_init(struct amdgpu_device *adev)
 {
        struct amdgpu_xcp_res_details *xcp_res;
        struct amdgpu_xcp_cfg *xcp_cfg;
-       int i, r, j, rid;
+       int i, r, j, rid, mode;
 
        if (!adev->xcp_mgr)
                return;
@@ -625,11 +625,15 @@ void amdgpu_xcp_cfg_sysfs_init(struct amdgpu_device *adev)
        if (r)
                goto err1;
 
-       r = amdgpu_xcp_get_res_info(xcp_cfg->xcp_mgr, xcp_cfg->xcp_mgr->mode, xcp_cfg);
+       mode = (xcp_cfg->xcp_mgr->mode ==
+               AMDGPU_UNKNOWN_COMPUTE_PARTITION_MODE) ?
+                      AMDGPU_SPX_PARTITION_MODE :
+                      xcp_cfg->xcp_mgr->mode;
+       r = amdgpu_xcp_get_res_info(xcp_cfg->xcp_mgr, mode, xcp_cfg);
        if (r)
                goto err1;
 
-       xcp_cfg->mode = xcp_cfg->xcp_mgr->mode;
+       xcp_cfg->mode = mode;
        for (i = 0; i < xcp_cfg->num_res; i++) {
                xcp_res = &xcp_cfg->xcp_res[i];
                rid = xcp_res->id;
This page took 0.059971 seconds and 4 git commands to generate.