• Tejun Heo's avatar
    libata: implement libata.spindown_compat · 920a4b10
    Tejun Heo authored
    Now that libata uses sd->manage_start_stop, libata spins down disk on
    shutdown.  In an attempt to compensate libata's previous shortcoming,
    some distros sync and spin down disks attached via libata in their
    shutdown(8).  Some disks spin back up just to spin down again on
    STANDBYNOW1 if the command is issued when the disk is spun down, so
    this double spinning down causes problem.
    
    This patch implements module parameter libata.spindown_compat which,
    when set to one (default value), prevents libata from spinning down
    disks on shutdown thus avoiding double spinning down.  Note that
    libata spins down disks for suspend to mem and disk, so with
    libata.spindown_compat set to one, disks should be properly spun down
    in all cases without modifying shutdown(8).
    
    shutdown(8) should be fixed eventually.  Some drive do spin up on
    SYNCHRONZE_CACHE even when their cache is clean.  Those disks
    currently spin up briefly when sd tries to shutdown the device and
    then the machine powers off immediately, which can't be good for the
    head.  We can't skip SYNCHRONIZE_CACHE during shudown as it can be
    dangerous data integrity-wise.
    
    So, this spindown_compat parameter is already scheduled for removal by
    the end of the next year and here's what shutdown(8) should do.
    
      * Check whether /sys/modules/libata/parameters/spindown_compat
        exists.  If it does, write 0 to it.
    
      * For each libata harddisk {
    	* Check whether /sys/class/scsi_disk/h:c:i:l/manage_start_stop
    	  exists.  Iff it doesn't, synchronize cache and spin the disk
    	  down as before.
      }
    
    The above procedure will make shutdown(8) work properly with kernels
    before this change, ones with this workaround and later ones without
    it.
    
    To accelerate shutdown(8) updates, if the compat mode is in use, this
    patch prints BIG FAT warning for five seconds during shutdown (the
    optimal interval to annoy the user just the right amount discovered by
    hours of tireless usability testing).
    Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
    Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
    920a4b10
Name
Last commit
Last update
..
ABI Loading commit data...
DocBook Loading commit data...
RCU Loading commit data...
accounting Loading commit data...
aoe Loading commit data...
arm Loading commit data...
auxdisplay Loading commit data...
blackfin Loading commit data...
block Loading commit data...
cdrom Loading commit data...
connector Loading commit data...
console Loading commit data...
cpu-freq Loading commit data...
cris Loading commit data...
crypto Loading commit data...
device-mapper Loading commit data...
driver-model Loading commit data...
drivers/edac Loading commit data...
dvb Loading commit data...
early-userspace Loading commit data...
fault-injection Loading commit data...
fb Loading commit data...
filesystems Loading commit data...
firmware_class Loading commit data...
fujitsu/frv Loading commit data...
hrtimer Loading commit data...
hrtimers Loading commit data...
hwmon Loading commit data...
i2c Loading commit data...
i2o Loading commit data...
i386 Loading commit data...
ia64 Loading commit data...
infiniband Loading commit data...
input Loading commit data...
ioctl Loading commit data...
isdn Loading commit data...
kbuild Loading commit data...
kdump Loading commit data...
m68k Loading commit data...
mips Loading commit data...
netlabel Loading commit data...
networking Loading commit data...
parisc Loading commit data...
pcmcia Loading commit data...
power Loading commit data...
powerpc Loading commit data...
s390 Loading commit data...
scsi Loading commit data...
serial Loading commit data...
sh Loading commit data...
sound Loading commit data...
sparc Loading commit data...
spi Loading commit data...
sysctl Loading commit data...
telephony Loading commit data...
uml Loading commit data...
usb Loading commit data...
video4linux Loading commit data...
vm Loading commit data...
w1 Loading commit data...
watchdog Loading commit data...
x86_64 Loading commit data...
00-INDEX Loading commit data...
BUG-HUNTING Loading commit data...
Changes Loading commit data...
CodingStyle Loading commit data...
DMA-API.txt Loading commit data...
DMA-ISA-LPC.txt Loading commit data...
DMA-mapping.txt Loading commit data...
HOWTO Loading commit data...
IO-mapping.txt Loading commit data...
IPMI.txt Loading commit data...
IRQ-affinity.txt Loading commit data...
IRQ.txt Loading commit data...
MSI-HOWTO.txt Loading commit data...
ManagementStyle Loading commit data...
PCIEBUS-HOWTO.txt Loading commit data...
README.DAC960 Loading commit data...
README.cycladesZ Loading commit data...
SAK.txt Loading commit data...
SecurityBugs Loading commit data...
SubmitChecklist Loading commit data...
SubmittingDrivers Loading commit data...
SubmittingPatches Loading commit data...
VGA-softcursor.txt Loading commit data...
applying-patches.txt Loading commit data...
atomic_ops.txt Loading commit data...
basic_profiling.txt Loading commit data...
binfmt_misc.txt Loading commit data...
cachetlb.txt Loading commit data...
cciss.txt Loading commit data...
cli-sti-removal.txt Loading commit data...
computone.txt Loading commit data...
cpqarray.txt Loading commit data...
cpu-hotplug.txt Loading commit data...
cpu-load.txt Loading commit data...
cpusets.txt Loading commit data...
cputopology.txt Loading commit data...
dcdbas.txt Loading commit data...
debugging-modules.txt Loading commit data...
dell_rbu.txt Loading commit data...
devices.txt Loading commit data...
digiepca.txt Loading commit data...
dnotify.txt Loading commit data...
dontdiff Loading commit data...
ecryptfs.txt Loading commit data...
eisa.txt Loading commit data...
exception.txt Loading commit data...
feature-removal-schedule.txt Loading commit data...
floppy.txt Loading commit data...
gpio.txt Loading commit data...
hayes-esp.txt Loading commit data...
highuid.txt Loading commit data...
hpet.txt Loading commit data...
hw_random.txt Loading commit data...
ide.txt Loading commit data...
initrd.txt Loading commit data...
io_ordering.txt Loading commit data...
ioctl-number.txt Loading commit data...
iostats.txt Loading commit data...
irqflags-tracing.txt Loading commit data...
isapnp.txt Loading commit data...
java.txt Loading commit data...
kernel-doc-nano-HOWTO.txt Loading commit data...
kernel-docs.txt Loading commit data...
kernel-parameters.txt Loading commit data...
keys-request-key.txt Loading commit data...
keys.txt Loading commit data...
kobject.txt Loading commit data...
kprobes.txt Loading commit data...
kref.txt Loading commit data...
laptop-mode.txt Loading commit data...
ldm.txt Loading commit data...
leds-class.txt Loading commit data...
local_ops.txt Loading commit data...
lockdep-design.txt Loading commit data...
locks.txt Loading commit data...
logo.gif Loading commit data...
logo.txt Loading commit data...
magic-number.txt Loading commit data...
mandatory.txt Loading commit data...
mca.txt Loading commit data...
md.txt Loading commit data...
memory-barriers.txt Loading commit data...
memory.txt Loading commit data...
mono.txt Loading commit data...
moxa-smartio Loading commit data...
mtrr.txt Loading commit data...
mutex-design.txt Loading commit data...
nbd.txt Loading commit data...
nfsroot.txt Loading commit data...
nmi_watchdog.txt Loading commit data...
nommu-mmap.txt Loading commit data...
numastat.txt Loading commit data...
oops-tracing.txt Loading commit data...
paride.txt Loading commit data...
parport-lowlevel.txt Loading commit data...
parport.txt Loading commit data...
pci-error-recovery.txt Loading commit data...
pci.txt Loading commit data...
pcieaer-howto.txt Loading commit data...
pi-futex.txt Loading commit data...
pm.txt Loading commit data...
pnp.txt Loading commit data...
preempt-locking.txt Loading commit data...
prio_tree.txt Loading commit data...
ramdisk.txt Loading commit data...
rbtree.txt Loading commit data...
riscom8.txt Loading commit data...
robust-futex-ABI.txt Loading commit data...
robust-futexes.txt Loading commit data...
rocket.txt Loading commit data...
rpc-cache.txt Loading commit data...
rt-mutex-design.txt Loading commit data...
rt-mutex.txt Loading commit data...
rtc.txt Loading commit data...
sched-arch.txt Loading commit data...
sched-coding.txt Loading commit data...
sched-design.txt Loading commit data...
sched-domains.txt Loading commit data...
sched-stats.txt Loading commit data...
serial-console.txt Loading commit data...
sgi-ioc4.txt Loading commit data...
sgi-visws.txt Loading commit data...
sharedsubtree.txt Loading commit data...
smart-config.txt Loading commit data...
smp.txt Loading commit data...
sony-laptop.txt Loading commit data...
sonypi.txt Loading commit data...
sparse.txt Loading commit data...
specialix.txt Loading commit data...
spinlocks.txt Loading commit data...
stable_api_nonsense.txt Loading commit data...
stable_kernel_rules.txt Loading commit data...
stallion.txt Loading commit data...
svga.txt Loading commit data...
sx.txt Loading commit data...
sysrq.txt Loading commit data...
thinkpad-acpi.txt Loading commit data...
time_interpolators.txt Loading commit data...
tipar.txt Loading commit data...
tty.txt Loading commit data...
unicode.txt Loading commit data...
unshare.txt Loading commit data...
video-output.txt Loading commit data...
voyager.txt Loading commit data...
xterm-linux.xpm Loading commit data...
zorro.txt Loading commit data...