]> git.itanic.dy.fi Git - linux-stable/commitdiff
accel/ivpu: Put NPU back to D3hot after failed resume
authorJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Tue, 2 Apr 2024 10:49:25 +0000 (12:49 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Apr 2024 09:23:37 +0000 (11:23 +0200)
commit 875bc9cd1b33eb027a5663f5e6878a43d98e9a16 upstream.

Put NPU in D3hot after ivpu_resume() fails to power up the device.
This will assure that D3->D0 power cycle will be performed before
the next resume and also will minimize power usage in this corner case.

Fixes: 28083ff18d3f ("accel/ivpu: Fix DevTLB errors on suspend/resume and recovery")
Cc: <stable@vger.kernel.org> # v6.8+
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240402104929.941186-5-jacek.lawrynowicz@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/accel/ivpu/ivpu_pm.c

index 2b73c20e2b7cf0b9449c3b92cad482b6d98bfe0c..a15d30d0943afb242c7357c23aa4c0d45221146f 100644 (file)
@@ -100,6 +100,7 @@ static int ivpu_resume(struct ivpu_device *vdev)
        ivpu_mmu_disable(vdev);
 err_power_down:
        ivpu_hw_power_down(vdev);
+       pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D3hot);
 
        if (!ivpu_fw_is_cold_boot(vdev)) {
                ivpu_pm_prepare_cold_boot(vdev);