• Jack Zhang's avatar
    drm/amdgpu fix incorrect sysfs remove behavior for xgmi · a89b5dae
    Jack Zhang authored
    Under xgmi setup,some sysfs fail to create for the second time of kmd
    driver loading. It's due to sysfs nodes are not removed appropriately
    in the last unlod time.
    
    Changes of this patch:
    1. remove sysfs for dev_attr_xgmi_error
    2. remove sysfs_link adev->dev->kobj with target name.
       And it only needs to be removed once for a xgmi setup
    3. remove sysfs_link hive->kobj with target name
    
    In amdgpu_xgmi_remove_device:
    1. amdgpu_xgmi_sysfs_rem_dev_info needs to be run per device
    2. amdgpu_xgmi_sysfs_destroy needs to be run on the last node of
    device.
    
    v2: initialize array with memset
    Signed-off-by: default avatarJack Zhang <Jack.Zhang1@amd.com>
    Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    a89b5dae
amdgpu_xgmi.c 22.7 KB