summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWachowski, Karol <karol.wachowski@intel.com>2024-04-02 12:49:24 +0200
committerJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>2024-04-08 10:54:11 +0200
commit3534eacbf101f6e66105f03d869a03893407c384 (patch)
treed5f9eac2e874c5fd7305fa8c8ef2259a42b4fcfb
parente3caadf1f9dfc9d62b5ffc3bd73ebac0c8f26b3f (diff)
accel/ivpu: Fix PCI D0 state entry in resume
In case of failed power up we end up left in PCI D3hot state making it impossible to access NPU registers on retry. Enter D0 state on retry before proceeding with power up sequence. Fixes: 28083ff18d3f ("accel/ivpu: Fix DevTLB errors on suspend/resume and recovery") Cc: <stable@vger.kernel.org> # v6.8+ Signed-off-by: Wachowski, Karol <karol.wachowski@intel.com> 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-4-jacek.lawrynowicz@linux.intel.com
-rw-r--r--drivers/accel/ivpu/ivpu_pm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c
index 9cbd7af6576b..325b82f8d971 100644
--- a/drivers/accel/ivpu/ivpu_pm.c
+++ b/drivers/accel/ivpu/ivpu_pm.c
@@ -71,10 +71,10 @@ static int ivpu_resume(struct ivpu_device *vdev)
{
int ret;
- pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D0);
+retry:
pci_restore_state(to_pci_dev(vdev->drm.dev));
+ pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D0);
-retry:
ret = ivpu_hw_power_up(vdev);
if (ret) {
ivpu_err(vdev, "Failed to power up HW: %d\n", ret);