drm/amdgpu: Add message print when unable to get valid hive
authorshaoyunl <shaoyun.liu@amd.com>
Fri, 4 Jan 2019 18:23:06 +0000 (13:23 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 14 Jan 2019 20:04:52 +0000 (15:04 -0500)
Add message print out and return -EINVAL when driver can not get valid hive
from hive  arrary on xgmi configuration

Signed-off-by: shaoyunl <shaoyun.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c

index 8a8bc60cb6b4d482e216a0a32522cf0c1f47d881..ac57a8767283bec09f2ceb8f786dbb5a35b7f2a5 100644 (file)
@@ -113,8 +113,13 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev)
 
        mutex_lock(&xgmi_mutex);
        hive = amdgpu_get_xgmi_hive(adev);
-       if (!hive)
+       if (!hive) {
+               ret = -EINVAL;
+               dev_err(adev->dev,
+                       "XGMI: node 0x%llx, can not matech hive 0x%llx in the hive list.\n",
+                       adev->gmc.xgmi.node_id, adev->gmc.xgmi.hive_id);
                goto exit;
+       }
 
        hive_topology = &hive->topology_info;