Commit 6013aa84 authored by Stanislaw Gruszka's avatar Stanislaw Gruszka Committed by Jacek Lawrynowicz
Browse files

accel/ivpu: Cancel recovery work

parent 4522ad76
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -580,6 +580,8 @@ static void ivpu_dev_fini(struct ivpu_device *vdev)
	ivpu_pm_disable(vdev);
	ivpu_shutdown(vdev);
	ivpu_job_done_thread_fini(vdev);
	ivpu_pm_cancel_recovery(vdev);

	ivpu_ipc_fini(vdev);
	ivpu_fw_fini(vdev);
	ivpu_mmu_global_context_fini(vdev);
+14 −3
Original line number Diff line number Diff line
@@ -102,8 +102,14 @@ static void ivpu_pm_recovery_work(struct work_struct *work)
	char *evt[2] = {"IVPU_PM_EVENT=IVPU_RECOVER", NULL};
	int ret;

	ret = pci_reset_function(to_pci_dev(vdev->drm.dev));
	if (ret)
retry:
	ret = pci_try_reset_function(to_pci_dev(vdev->drm.dev));
	if (ret == -EAGAIN && !drm_dev_is_unplugged(&vdev->drm)) {
		cond_resched();
		goto retry;
	}

	if (ret && ret != -EAGAIN)
		ivpu_err(vdev, "Failed to reset VPU: %d\n", ret);

	kobject_uevent_env(&vdev->drm.dev->kobj, KOBJ_CHANGE, evt);
@@ -306,6 +312,11 @@ int ivpu_pm_init(struct ivpu_device *vdev)
	return 0;
}

void ivpu_pm_cancel_recovery(struct ivpu_device *vdev)
{
	cancel_work_sync(&vdev->pm->recovery_work);
}

void ivpu_pm_enable(struct ivpu_device *vdev)
{
	struct device *dev = vdev->drm.dev;
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ struct ivpu_pm_info {
int ivpu_pm_init(struct ivpu_device *vdev);
void ivpu_pm_enable(struct ivpu_device *vdev);
void ivpu_pm_disable(struct ivpu_device *vdev);
void ivpu_pm_cancel_recovery(struct ivpu_device *vdev);

int ivpu_pm_suspend_cb(struct device *dev);
int ivpu_pm_resume_cb(struct device *dev);