diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 24 | 
1 files changed, 18 insertions, 6 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c index f2aebbf3fbe3..47159e9a0884 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c @@ -392,12 +392,20 @@ struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev)  	}  	/** +	 * Only init hive->reset_domain for none SRIOV configuration. For SRIOV, +	 * Host driver decide how to reset the GPU either through FLR or chain reset. +	 * Guest side will get individual notifications from the host for the FLR +	 * if necessary. +	 */ +	if (!amdgpu_sriov_vf(adev)) { +	/**  	 * Avoid recreating reset domain when hive is reconstructed for the case -	 * of reset the devices in the XGMI hive during probe for SRIOV +	 * of reset the devices in the XGMI hive during probe for passthrough GPU  	 * See https://www.spinics.net/lists/amd-gfx/msg58836.html  	 */ -	if (adev->reset_domain->type != XGMI_HIVE) { -		hive->reset_domain = amdgpu_reset_create_reset_domain(XGMI_HIVE, "amdgpu-reset-hive"); +		if (adev->reset_domain->type != XGMI_HIVE) { +			hive->reset_domain = +				amdgpu_reset_create_reset_domain(XGMI_HIVE, "amdgpu-reset-hive");  			if (!hive->reset_domain) {  				dev_err(adev->dev, "XGMI: failed initializing reset domain for xgmi hive\n");  				ret = -ENOMEM; @@ -406,9 +414,10 @@ struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev)  				hive = NULL;  				goto pro_end;  			} -	} else { -		amdgpu_reset_get_reset_domain(adev->reset_domain); -		hive->reset_domain = adev->reset_domain; +		} else { +			amdgpu_reset_get_reset_domain(adev->reset_domain); +			hive->reset_domain = adev->reset_domain; +		}  	}  	hive->hive_id = adev->gmc.xgmi.hive_id; @@ -504,6 +513,9 @@ int amdgpu_xgmi_update_topology(struct amdgpu_hive_info *hive, struct amdgpu_dev  {  	int ret; +	if (amdgpu_sriov_vf(adev)) +		return 0; +  	/* Each psp need to set the latest topology */  	ret = psp_xgmi_set_topology_info(&adev->psp,  					 atomic_read(&hive->number_devices), | 
