scsi: mpi3mr: Fix hibernation issue
authorSreekanth Reddy <sreekanth.reddy@broadcom.com>
Thu, 10 Feb 2022 09:58:12 +0000 (15:28 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 11 Feb 2022 22:40:03 +0000 (17:40 -0500)
Hibernation operation fails when it is issued for second time. This is
because the driver is trying to release the IOC's PCI resources after
setting power state to D3.

Set the IOC's power state to D3 only after releasing the IOC's PCI
resources.

Link: https://lore.kernel.org/r/20220210095817.22828-5-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpi3mr/mpi3mr_os.c

index c932c2b6677f2e6d4f1f29a40327b3fd35c64ad4..40a8c2e21ef2cb2ab22d883adc1fd7367f9d417d 100644 (file)
@@ -4473,8 +4473,8 @@ static int mpi3mr_suspend(struct pci_dev *pdev, pm_message_t state)
        ioc_info(mrioc, "pdev=0x%p, slot=%s, entering operating state [D%d]\n",
            pdev, pci_name(pdev), device_state);
        pci_save_state(pdev);
-       pci_set_power_state(pdev, device_state);
        mpi3mr_cleanup_resources(mrioc);
+       pci_set_power_state(pdev, device_state);
 
        return 0;
 }