Skip to content

Commit 3d8b272

Browse files
sgruszkajlawryno
authored andcommitted
accel/ivpu: Disable buttress on device removal
Use pci_set_power_state() to disable buttress when device is removed. This is workaround of hardware bug that hangs the system. Additionally not disabling buttress prevents CPU enter deeper Pkg-C states when the driver is unloaded or fail to probe. Fixes: 35b1376 ("accel/ivpu: Introduce a new DRM driver for Intel VPU") Signed-off-by: Stanislaw Gruszka <[email protected]> Reviewed-by: Jeffrey Hugo <[email protected]> Signed-off-by: Jacek Lawrynowicz <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a8fed6d commit 3d8b272

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

drivers/accel/ivpu/ivpu_drv.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,8 @@ static int ivpu_dev_init(struct ivpu_device *vdev)
569569
ivpu_mmu_global_context_fini(vdev);
570570
err_power_down:
571571
ivpu_hw_power_down(vdev);
572+
if (IVPU_WA(d3hot_after_power_off))
573+
pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D3hot);
572574
err_xa_destroy:
573575
xa_destroy(&vdev->submitted_jobs_xa);
574576
xa_destroy(&vdev->context_xa);
@@ -579,6 +581,8 @@ static void ivpu_dev_fini(struct ivpu_device *vdev)
579581
{
580582
ivpu_pm_disable(vdev);
581583
ivpu_shutdown(vdev);
584+
if (IVPU_WA(d3hot_after_power_off))
585+
pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D3hot);
582586
ivpu_job_done_thread_fini(vdev);
583587
ivpu_pm_cancel_recovery(vdev);
584588

drivers/accel/ivpu/ivpu_drv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
struct ivpu_wa_table {
7575
bool punit_disabled;
7676
bool clear_runtime_mem;
77+
bool d3hot_after_power_off;
7778
};
7879

7980
struct ivpu_hw_info;

drivers/accel/ivpu/ivpu_hw_mtl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ static void ivpu_hw_wa_init(struct ivpu_device *vdev)
101101
{
102102
vdev->wa.punit_disabled = ivpu_is_fpga(vdev);
103103
vdev->wa.clear_runtime_mem = false;
104+
vdev->wa.d3hot_after_power_off = true;
104105
}
105106

106107
static void ivpu_hw_timeouts_init(struct ivpu_device *vdev)

0 commit comments

Comments
 (0)