Re: [PATCH] libata: device suspend/resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux