scsi: sata: re enter sleep is prohibited during wake-up

The work ata_scsi_dev_rescan will hangup and can not wakeup if PM
enter sleep at the sata device  wake-up process.

Signed-off-by: Yifeng Zhao <yifeng.zhao@rock-chips.com>
Change-Id: I44045505c2e691102ab90ba3b2ae3031e7bab0a6
This commit is contained in:
Yifeng Zhao
2022-04-24 10:52:34 +08:00
committed by Tao Huang
parent d32e5f2e57
commit da1c2c4a2c
2 changed files with 8 additions and 0 deletions
+2
View File
@@ -74,6 +74,8 @@ static int ahci_probe(struct platform_device *pdev)
if (rc)
goto disable_resources;
device_init_wakeup(dev, true);
return 0;
disable_resources:
ahci_platform_disable_resources(hpriv);
+6
View File
@@ -3716,10 +3716,16 @@ static int sd_resume(struct device *dev)
if (!sdkp->device->manage_start_stop)
return 0;
/* The wake-up process cannot allow the PM to enter sleep */
pm_stay_awake(dev);
sd_printk(KERN_NOTICE, sdkp, "Starting disk\n");
ret = sd_start_stop_device(sdkp, 1);
if (!ret)
opal_unlock_from_suspend(sdkp->opal_dev);
pm_relax(dev);
return ret;
}