diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 36 | 
1 files changed, 23 insertions, 13 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index ca8e76771ea1..ca854626a108 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -1539,6 +1539,11 @@ static int amdgpu_device_check_arguments(struct amdgpu_device *adev)  		amdgpu_sched_hw_submission = roundup_pow_of_two(amdgpu_sched_hw_submission);  	} +	if (amdgpu_reset_method < -1 || amdgpu_reset_method > 4) { +		dev_warn(adev->dev, "invalid option for reset method, reverting to default\n"); +		amdgpu_reset_method = -1; +	} +  	amdgpu_device_check_smu_prv_buffer_size(adev);  	amdgpu_device_check_vm_size(adev); @@ -3609,6 +3614,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,  	mutex_init(&adev->psp.mutex);  	mutex_init(&adev->notifier_lock);  	mutex_init(&adev->pm.stable_pstate_ctx_lock); +	mutex_init(&adev->benchmark_mutex);  	amdgpu_device_init_apu_flags(adev); @@ -3872,19 +3878,6 @@ fence_driver_init:  	} else  		adev->ucode_sysfs_en = true; -	if ((amdgpu_testing & 1)) { -		if (adev->accel_working) -			amdgpu_test_moves(adev); -		else -			DRM_INFO("amdgpu: acceleration disabled, skipping move tests\n"); -	} -	if (amdgpu_benchmarking) { -		if (adev->accel_working) -			amdgpu_benchmark(adev, amdgpu_benchmarking); -		else -			DRM_INFO("amdgpu: acceleration disabled, skipping benchmarks\n"); -	} -  	/*  	 * Register gpu instance before amdgpu_device_enable_mgpu_fan_boost.  	 * Otherwise the mgpu fan boost feature will be skipped due to the @@ -4723,6 +4716,22 @@ int amdgpu_device_pre_asic_reset(struct amdgpu_device *adev,  	return r;  } +static int amdgpu_reset_reg_dumps(struct amdgpu_device *adev) +{ +	uint32_t reg_value; +	int i; + +	lockdep_assert_held(&adev->reset_domain->sem); +	dump_stack(); + +	for (i = 0; i < adev->num_regs; i++) { +		reg_value = RREG32(adev->reset_dump_reg_list[i]); +		trace_amdgpu_reset_reg_dumps(adev->reset_dump_reg_list[i], reg_value); +	} + +	return 0; +} +  int amdgpu_do_asic_reset(struct list_head *device_list_handle,  			 struct amdgpu_reset_context *reset_context)  { @@ -4733,6 +4742,7 @@ int amdgpu_do_asic_reset(struct list_head *device_list_handle,  	/* Try reset handler method first */  	tmp_adev = list_first_entry(device_list_handle, struct amdgpu_device,  				    reset_list); +	amdgpu_reset_reg_dumps(tmp_adev);  	r = amdgpu_reset_perform_reset(tmp_adev, reset_context);  	/* If reset handler not implemented, continue; otherwise return */  	if (r == -ENOSYS)  | 
