scsi: sd: Fix system start for ATA devices
[platform/kernel/linux-rpi.git] / drivers / scsi / sd.c
index 6effa13..e17509f 100644 (file)
@@ -3953,8 +3953,15 @@ static int sd_resume(struct device *dev, bool runtime)
 
 static int sd_resume_system(struct device *dev)
 {
-       if (pm_runtime_suspended(dev))
+       if (pm_runtime_suspended(dev)) {
+               struct scsi_disk *sdkp = dev_get_drvdata(dev);
+               struct scsi_device *sdp = sdkp ? sdkp->device : NULL;
+
+               if (sdp && sdp->force_runtime_start_on_system_start)
+                       pm_request_resume(dev);
+
                return 0;
+       }
 
        return sd_resume(dev, false);
 }