diff mbox series

accel/ivpu: Fix Qemu crash when running in passthrough

Message ID 20241106105549.2757115-1-jacek.lawrynowicz@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series accel/ivpu: Fix Qemu crash when running in passthrough | expand

Commit Message

Jacek Lawrynowicz Nov. 6, 2024, 10:55 a.m. UTC
Restore PCI state after putting the NPU in D0.
Restoring state before powering up the device caused a Qemu crash
if NPU was running in passthrough mode and recovery was performed.

Fixes: 3534eacbf101 ("accel/ivpu: Fix PCI D0 state entry in resume")
Cc: <stable@vger.kernel.org> # v6.8+
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
---
 drivers/accel/ivpu/ivpu_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jacek Lawrynowicz Nov. 13, 2024, 10:23 a.m. UTC | #1
Applied to drm-misc-next

On 11/6/2024 11:55 AM, Jacek Lawrynowicz wrote:
> Restore PCI state after putting the NPU in D0.
> Restoring state before powering up the device caused a Qemu crash
> if NPU was running in passthrough mode and recovery was performed.
> 
> Fixes: 3534eacbf101 ("accel/ivpu: Fix PCI D0 state entry in resume")
> Cc: <stable@vger.kernel.org> # v6.8+
> Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
> Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
> ---
>  drivers/accel/ivpu/ivpu_pm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c
> index 59d3170f5e354..5aac3d64045d3 100644
> --- a/drivers/accel/ivpu/ivpu_pm.c
> +++ b/drivers/accel/ivpu/ivpu_pm.c
> @@ -73,8 +73,8 @@ static int ivpu_resume(struct ivpu_device *vdev)
>  	int ret;
>  
>  retry:
> -	pci_restore_state(to_pci_dev(vdev->drm.dev));
>  	pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D0);
> +	pci_restore_state(to_pci_dev(vdev->drm.dev));
>  
>  	ret = ivpu_hw_power_up(vdev);
>  	if (ret) {
diff mbox series

Patch

diff --git a/drivers/accel/ivpu/ivpu_pm.c b/drivers/accel/ivpu/ivpu_pm.c
index 59d3170f5e354..5aac3d64045d3 100644
--- a/drivers/accel/ivpu/ivpu_pm.c
+++ b/drivers/accel/ivpu/ivpu_pm.c
@@ -73,8 +73,8 @@  static int ivpu_resume(struct ivpu_device *vdev)
 	int ret;
 
 retry:
-	pci_restore_state(to_pci_dev(vdev->drm.dev));
 	pci_set_power_state(to_pci_dev(vdev->drm.dev), PCI_D0);
+	pci_restore_state(to_pci_dev(vdev->drm.dev));
 
 	ret = ivpu_hw_power_up(vdev);
 	if (ret) {