Lines Matching refs:tmp_adev
5249 struct amdgpu_device *tmp_adev = reset_context->reset_req_dev; in amdgpu_device_pre_asic_reset() local
5307 dev_info(tmp_adev->dev, "Dumping IP State\n"); in amdgpu_device_pre_asic_reset()
5309 for (i = 0; i < tmp_adev->num_ip_blocks; i++) in amdgpu_device_pre_asic_reset()
5310 if (tmp_adev->ip_blocks[i].version->funcs->dump_ip_state) in amdgpu_device_pre_asic_reset()
5311 tmp_adev->ip_blocks[i].version->funcs in amdgpu_device_pre_asic_reset()
5312 ->dump_ip_state((void *)tmp_adev); in amdgpu_device_pre_asic_reset()
5313 dev_info(tmp_adev->dev, "Dumping IP State Completed\n"); in amdgpu_device_pre_asic_reset()
5331 struct amdgpu_device *tmp_adev = NULL; in amdgpu_do_asic_reset() local
5336 tmp_adev = list_first_entry(device_list_handle, struct amdgpu_device, in amdgpu_do_asic_reset()
5340 r = amdgpu_reset_perform_reset(tmp_adev, reset_context); in amdgpu_do_asic_reset()
5357 list_for_each_entry(tmp_adev, device_list_handle, reset_list) { in amdgpu_do_asic_reset()
5359 if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) { in amdgpu_do_asic_reset()
5360 tmp_adev->gmc.xgmi.pending_reset = false; in amdgpu_do_asic_reset()
5361 if (!queue_work(system_unbound_wq, &tmp_adev->xgmi_reset_work)) in amdgpu_do_asic_reset()
5364 r = amdgpu_asic_reset(tmp_adev); in amdgpu_do_asic_reset()
5367 dev_err(tmp_adev->dev, "ASIC reset failed with error, %d for drm dev, %s", in amdgpu_do_asic_reset()
5368 r, adev_to_drm(tmp_adev)->unique); in amdgpu_do_asic_reset()
5375 list_for_each_entry(tmp_adev, device_list_handle, reset_list) { in amdgpu_do_asic_reset()
5376 if (tmp_adev->gmc.xgmi.num_physical_nodes > 1) { in amdgpu_do_asic_reset()
5377 flush_work(&tmp_adev->xgmi_reset_work); in amdgpu_do_asic_reset()
5378 r = tmp_adev->asic_reset_res; in amdgpu_do_asic_reset()
5387 list_for_each_entry(tmp_adev, device_list_handle, reset_list) { in amdgpu_do_asic_reset()
5388 amdgpu_ras_reset_error_count(tmp_adev, AMDGPU_RAS_BLOCK__MMHUB); in amdgpu_do_asic_reset()
5394 list_for_each_entry(tmp_adev, device_list_handle, reset_list) { in amdgpu_do_asic_reset()
5397 amdgpu_ras_set_fed(tmp_adev, false); in amdgpu_do_asic_reset()
5398 r = amdgpu_device_asic_init(tmp_adev); in amdgpu_do_asic_reset()
5400 dev_warn(tmp_adev->dev, "asic atom init failed!"); in amdgpu_do_asic_reset()
5402 dev_info(tmp_adev->dev, "GPU reset succeeded, trying to resume\n"); in amdgpu_do_asic_reset()
5404 r = amdgpu_device_ip_resume_phase1(tmp_adev); in amdgpu_do_asic_reset()
5408 vram_lost = amdgpu_device_check_vram_lost(tmp_adev); in amdgpu_do_asic_reset()
5411 amdgpu_coredump(tmp_adev, false, vram_lost, reset_context->job); in amdgpu_do_asic_reset()
5415 amdgpu_inc_vram_lost(tmp_adev); in amdgpu_do_asic_reset()
5418 r = amdgpu_device_fw_loading(tmp_adev); in amdgpu_do_asic_reset()
5423 tmp_adev->xcp_mgr); in amdgpu_do_asic_reset()
5427 r = amdgpu_device_ip_resume_phase2(tmp_adev); in amdgpu_do_asic_reset()
5431 if (tmp_adev->mman.buffer_funcs_ring->sched.ready) in amdgpu_do_asic_reset()
5432 amdgpu_ttm_set_buffer_funcs_status(tmp_adev, true); in amdgpu_do_asic_reset()
5435 amdgpu_device_fill_reset_magic(tmp_adev); in amdgpu_do_asic_reset()
5441 amdgpu_register_gpu_instance(tmp_adev); in amdgpu_do_asic_reset()
5444 tmp_adev->gmc.xgmi.num_physical_nodes > 1) in amdgpu_do_asic_reset()
5445 amdgpu_xgmi_add_device(tmp_adev); in amdgpu_do_asic_reset()
5447 r = amdgpu_device_ip_late_init(tmp_adev); in amdgpu_do_asic_reset()
5451 drm_fb_helper_set_suspend_unlocked(adev_to_drm(tmp_adev)->fb_helper, false); in amdgpu_do_asic_reset()
5463 if (!amdgpu_ras_is_rma(tmp_adev)) { in amdgpu_do_asic_reset()
5465 amdgpu_ras_resume(tmp_adev); in amdgpu_do_asic_reset()
5473 tmp_adev->gmc.xgmi.num_physical_nodes > 1) in amdgpu_do_asic_reset()
5475 reset_context->hive, tmp_adev); in amdgpu_do_asic_reset()
5481 amdgpu_irq_gpu_reset_resume_helper(tmp_adev); in amdgpu_do_asic_reset()
5482 r = amdgpu_ib_ring_tests(tmp_adev); in amdgpu_do_asic_reset()
5484 dev_err(tmp_adev->dev, "ib ring test failed (%d).\n", r); in amdgpu_do_asic_reset()
5492 tmp_adev->asic_reset_res = r; in amdgpu_do_asic_reset()
5609 struct amdgpu_device *tmp_adev; in amdgpu_device_health_check() local
5613 list_for_each_entry(tmp_adev, device_list_handle, reset_list) { in amdgpu_device_health_check()
5614 pci_read_config_dword(tmp_adev->pdev, PCI_COMMAND, &status); in amdgpu_device_health_check()
5616 dev_err(tmp_adev->dev, "device lost from bus!"); in amdgpu_device_health_check()
5643 struct amdgpu_device *tmp_adev = NULL; in amdgpu_device_gpu_recover() local
5683 list_for_each_entry(tmp_adev, &hive->device_list, gmc.xgmi.head) { in amdgpu_device_gpu_recover()
5684 list_add_tail(&tmp_adev->reset_list, &device_list); in amdgpu_device_gpu_recover()
5686 tmp_adev->shutdown = true; in amdgpu_device_gpu_recover()
5703 tmp_adev = list_first_entry(device_list_handle, struct amdgpu_device, in amdgpu_device_gpu_recover()
5705 amdgpu_device_lock_reset_domain(tmp_adev->reset_domain); in amdgpu_device_gpu_recover()
5708 list_for_each_entry(tmp_adev, device_list_handle, reset_list) { in amdgpu_device_gpu_recover()
5710 amdgpu_device_set_mp1_state(tmp_adev); in amdgpu_device_gpu_recover()
5722 if (!amdgpu_device_suspend_display_audio(tmp_adev)) in amdgpu_device_gpu_recover()
5725 amdgpu_ras_set_error_query_ready(tmp_adev, false); in amdgpu_device_gpu_recover()
5727 cancel_delayed_work_sync(&tmp_adev->delayed_init_work); in amdgpu_device_gpu_recover()
5729 amdgpu_amdkfd_pre_reset(tmp_adev, reset_context); in amdgpu_device_gpu_recover()
5735 amdgpu_unregister_gpu_instance(tmp_adev); in amdgpu_device_gpu_recover()
5737 drm_fb_helper_set_suspend_unlocked(adev_to_drm(tmp_adev)->fb_helper, true); in amdgpu_device_gpu_recover()
5741 amdgpu_device_ip_need_full_reset(tmp_adev)) in amdgpu_device_gpu_recover()
5742 amdgpu_ras_suspend(tmp_adev); in amdgpu_device_gpu_recover()
5745 struct amdgpu_ring *ring = tmp_adev->rings[i]; in amdgpu_device_gpu_recover()
5755 atomic_inc(&tmp_adev->gpu_reset_counter); in amdgpu_device_gpu_recover()
5774 list_for_each_entry(tmp_adev, device_list_handle, reset_list) { in amdgpu_device_gpu_recover()
5775 r = amdgpu_device_pre_asic_reset(tmp_adev, reset_context); in amdgpu_device_gpu_recover()
5778 dev_err(tmp_adev->dev, "GPU pre asic reset failed with err, %d for drm dev, %s ", in amdgpu_device_gpu_recover()
5779 r, adev_to_drm(tmp_adev)->unique); in amdgpu_device_gpu_recover()
5780 tmp_adev->asic_reset_res = r; in amdgpu_device_gpu_recover()
5806 list_for_each_entry(tmp_adev, device_list_handle, reset_list) { in amdgpu_device_gpu_recover()
5813 amdgpu_device_stop_pending_resets(tmp_adev); in amdgpu_device_gpu_recover()
5819 list_for_each_entry(tmp_adev, device_list_handle, reset_list) { in amdgpu_device_gpu_recover()
5822 struct amdgpu_ring *ring = tmp_adev->rings[i]; in amdgpu_device_gpu_recover()
5830 if (!drm_drv_uses_atomic_modeset(adev_to_drm(tmp_adev)) && !job_signaled) in amdgpu_device_gpu_recover()
5831 drm_helper_resume_force_mode(adev_to_drm(tmp_adev)); in amdgpu_device_gpu_recover()
5833 if (tmp_adev->asic_reset_res) in amdgpu_device_gpu_recover()
5834 r = tmp_adev->asic_reset_res; in amdgpu_device_gpu_recover()
5836 tmp_adev->asic_reset_res = 0; in amdgpu_device_gpu_recover()
5844 !amdgpu_ras_eeprom_check_err_threshold(tmp_adev)) in amdgpu_device_gpu_recover()
5845 dev_info(tmp_adev->dev, "GPU reset(%d) failed\n", in amdgpu_device_gpu_recover()
5846 atomic_read(&tmp_adev->gpu_reset_counter)); in amdgpu_device_gpu_recover()
5847 amdgpu_vf_error_put(tmp_adev, AMDGIM_ERROR_VF_GPU_RESET_FAIL, 0, r); in amdgpu_device_gpu_recover()
5849 dev_info(tmp_adev->dev, "GPU reset(%d) succeeded!\n", atomic_read(&tmp_adev->gpu_reset_counter)); in amdgpu_device_gpu_recover()
5850 if (amdgpu_acpi_smart_shift_update(adev_to_drm(tmp_adev), AMDGPU_SS_DEV_D0)) in amdgpu_device_gpu_recover()
5856 list_for_each_entry(tmp_adev, device_list_handle, reset_list) { in amdgpu_device_gpu_recover()
5858 if (!need_emergency_restart && !amdgpu_sriov_vf(tmp_adev)) in amdgpu_device_gpu_recover()
5859 amdgpu_amdkfd_post_reset(tmp_adev); in amdgpu_device_gpu_recover()
5868 amdgpu_device_resume_display_audio(tmp_adev); in amdgpu_device_gpu_recover()
5870 amdgpu_device_unset_mp1_state(tmp_adev); in amdgpu_device_gpu_recover()
5872 amdgpu_ras_set_error_query_ready(tmp_adev, true); in amdgpu_device_gpu_recover()
5875 tmp_adev = list_first_entry(device_list_handle, struct amdgpu_device, in amdgpu_device_gpu_recover()
5877 amdgpu_device_unlock_reset_domain(tmp_adev->reset_domain); in amdgpu_device_gpu_recover()