File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -580,6 +580,8 @@ static void ivpu_dev_fini(struct ivpu_device *vdev)
580
580
ivpu_pm_disable (vdev );
581
581
ivpu_shutdown (vdev );
582
582
ivpu_job_done_thread_fini (vdev );
583
+ ivpu_pm_cancel_recovery (vdev );
584
+
583
585
ivpu_ipc_fini (vdev );
584
586
ivpu_fw_fini (vdev );
585
587
ivpu_mmu_global_context_fini (vdev );
Original file line number Diff line number Diff line change @@ -98,12 +98,18 @@ static int ivpu_resume(struct ivpu_device *vdev)
98
98
static void ivpu_pm_recovery_work (struct work_struct * work )
99
99
{
100
100
struct ivpu_pm_info * pm = container_of (work , struct ivpu_pm_info , recovery_work );
101
- struct ivpu_device * vdev = pm -> vdev ;
101
+ struct ivpu_device * vdev = pm -> vdev ;
102
102
char * evt [2 ] = {"IVPU_PM_EVENT=IVPU_RECOVER" , NULL };
103
103
int ret ;
104
104
105
- ret = pci_reset_function (to_pci_dev (vdev -> drm .dev ));
106
- if (ret )
105
+ retry :
106
+ ret = pci_try_reset_function (to_pci_dev (vdev -> drm .dev ));
107
+ if (ret == - EAGAIN && !drm_dev_is_unplugged (& vdev -> drm )) {
108
+ cond_resched ();
109
+ goto retry ;
110
+ }
111
+
112
+ if (ret && ret != - EAGAIN )
107
113
ivpu_err (vdev , "Failed to reset VPU: %d\n" , ret );
108
114
109
115
kobject_uevent_env (& vdev -> drm .dev -> kobj , KOBJ_CHANGE , evt );
@@ -306,6 +312,11 @@ int ivpu_pm_init(struct ivpu_device *vdev)
306
312
return 0 ;
307
313
}
308
314
315
+ void ivpu_pm_cancel_recovery (struct ivpu_device * vdev )
316
+ {
317
+ cancel_work_sync (& vdev -> pm -> recovery_work );
318
+ }
319
+
309
320
void ivpu_pm_enable (struct ivpu_device * vdev )
310
321
{
311
322
struct device * dev = vdev -> drm .dev ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ struct ivpu_pm_info {
21
21
int ivpu_pm_init (struct ivpu_device * vdev );
22
22
void ivpu_pm_enable (struct ivpu_device * vdev );
23
23
void ivpu_pm_disable (struct ivpu_device * vdev );
24
+ void ivpu_pm_cancel_recovery (struct ivpu_device * vdev );
24
25
25
26
int ivpu_pm_suspend_cb (struct device * dev );
26
27
int ivpu_pm_resume_cb (struct device * dev );
You can’t perform that action at this time.
0 commit comments