James Bottomley wrote:
+/* Just quietly quiesce the device and SYNCHRONIZE CACHE for suspend too */
+static int sd_suspend(struct device *dev, pm_message_t state, u32 level)
+{
+ struct scsi_device *sdp = to_scsi_device(dev);
+ struct scsi_disk *sdkp = dev_get_drvdata(dev);
+
+ if (!sdkp)
+ return 0; /* this can happen */
+
+ if (!sdkp->WCE)
+ return 0;
+
+ /* don't try to sync an offline device ... it will only error */
+ if (!scsi_device_online(sdp))
+ return 0;
+
+ if (sd_sync_cache(sdp))
+ return -EIO;
Add
if (I_can_PM_this_disk && sd_start_stop_unit(sdp))
return -EIO;
and libata is happy.
Jeff
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html