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:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user