diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 23 | 
1 files changed, 17 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index c4a6fe3070b6..be7aff2d4a57 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2365,8 +2365,16 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)  		}  		adev->ip_blocks[i].status.sw = true; -		/* need to do gmc hw init early so we can allocate gpu mem */ -		if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) { +		if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_COMMON) { +			/* need to do common hw init early so everything is set up for gmc */ +			r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev); +			if (r) { +				DRM_ERROR("hw_init %d failed %d\n", i, r); +				goto init_failed; +			} +			adev->ip_blocks[i].status.hw = true; +		} else if (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GMC) { +			/* need to do gmc hw init early so we can allocate gpu mem */  			/* Try to reserve bad pages early */  			if (amdgpu_sriov_vf(adev))  				amdgpu_virt_exchange_data(adev); @@ -2456,12 +2464,14 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev)  			if (!hive->reset_domain ||  			    !amdgpu_reset_get_reset_domain(hive->reset_domain)) {  				r = -ENOENT; +				amdgpu_put_xgmi_hive(hive);  				goto init_failed;  			}  			/* Drop the early temporary reset domain we created for device */  			amdgpu_reset_put_reset_domain(adev->reset_domain);  			adev->reset_domain = hive->reset_domain; +			amdgpu_put_xgmi_hive(hive);  		}  	} @@ -3050,8 +3060,8 @@ static int amdgpu_device_ip_reinit_early_sriov(struct amdgpu_device *adev)  	int i, r;  	static enum amd_ip_block_type ip_order[] = { -		AMD_IP_BLOCK_TYPE_GMC,  		AMD_IP_BLOCK_TYPE_COMMON, +		AMD_IP_BLOCK_TYPE_GMC,  		AMD_IP_BLOCK_TYPE_PSP,  		AMD_IP_BLOCK_TYPE_IH,  	}; @@ -4413,8 +4423,6 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,  retry:  	amdgpu_amdkfd_pre_reset(adev); -	amdgpu_amdkfd_pre_reset(adev); -  	if (from_hypervisor)  		r = amdgpu_virt_request_full_gpu(adev, true);  	else @@ -4742,6 +4750,8 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,  	tmp_adev = list_first_entry(device_list_handle, struct amdgpu_device,  				    reset_list);  	amdgpu_reset_reg_dumps(tmp_adev); + +	reset_context->reset_device_list = device_list_handle;  	r = amdgpu_reset_perform_reset(tmp_adev, reset_context);  	/* If reset handler not implemented, continue; otherwise return */  	if (r == -ENOSYS) @@ -5522,7 +5532,8 @@ bool amdgpu_device_is_peer_accessible(struct amdgpu_device *adev,  		~*peer_adev->dev->dma_mask : ~((1ULL << 32) - 1);  	resource_size_t aper_limit =  		adev->gmc.aper_base + adev->gmc.aper_size - 1; -	bool p2p_access = !(pci_p2pdma_distance_many(adev->pdev, +	bool p2p_access = !adev->gmc.xgmi.connected_to_cpu && +			  !(pci_p2pdma_distance_many(adev->pdev,  					&peer_adev->dev, 1, true) < 0);  	return pcie_p2p && p2p_access && (adev->gmc.visible_vram_size &&  | 
