On Fri, 2012-09-14 at 16:48 +0800, Aaron Lu wrote: > On 09/14/2012 04:17 PM, James Bottomley wrote: > >> Just read the SPC-4 spec, in section 5.12.3, it has words like this: > >> > >> Logical units that contain cache memory shall write all cached data to > >> the medium for the logical unit(e.g., as a logical unit would do in > >> response to a SYNCHRONIZE CACHE command as described SBC-3) prior to > >> entering into any power condition that prevents accessing the > >> media(e.g., before a hard drive stops its spindle motor during a change > >> to the standby power condition). > >> > >> So this looks like cache needs to be synced before the device enter > >> standby/stopped power condition. Or do I miss somthing? > > > > Um, no it says the device shall do the sync on its own (as though it > > received a sync cache). That section says the device shall be > > responsible for cache management in the power states. > > Oh, I thought it was the host software's responsibility, thanks for the > explanation. > > So if we program the device to let it enter standby/stopped power > condition with the start_stop_unit command, do we need to sync the > cache? No, that's what the spec says. The device must manage the cache in both the forced (start stop unit) and timed (power control mode page) cases. The reason is the spec doesn't define what idle and standby actually mean (just that they're "lower" power states). So the device implementers get to choose if they stop the platter or power off the motor. The spec just means that if they do anything that causes danger to data in the cache, they have to deal with it themselves. James -- To unsubscribe from this list: 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