linux-stable-rt/drivers/ata
Tejun Heo 920a4b1038 libata: implement libata.spindown_compat
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: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-05-11 18:01:04 -04:00
..
Kconfig [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
Makefile Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2007-05-06 13:20:10 -07:00
ahci.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
ata_generic.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
ata_piix.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
libata-acpi.c libata-acpi: fix _GTF command protocol for ATAPI devices 2007-05-09 20:15:46 -04:00
libata-core.c libata: implement libata.spindown_compat 2007-05-11 18:01:04 -04:00
libata-eh.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
libata-scsi.c libata: implement libata.spindown_compat 2007-05-11 18:01:04 -04:00
libata-sff.c
libata.h libata: implement libata.spindown_compat 2007-05-11 18:01:04 -04:00
pata_ali.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_amd.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_artop.c
pata_atiixp.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_cmd64x.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_cmd640.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_cs5520.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_cs5530.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_cs5535.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_cypress.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_efar.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_hpt3x2n.c
pata_hpt3x3.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_hpt37x.c
pata_hpt366.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_icside.c [ARM] Add support for ICSIDE interface on RiscPC 2007-05-03 14:16:56 +01:00
pata_isapnp.c
pata_it821x.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_it8213.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_ixp4xx_cf.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_jmicron.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_legacy.c
pata_marvell.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_mpc52xx.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_mpiix.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_netcell.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_ns87410.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_oldpiix.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_opti.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_optidma.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_pcmcia.c pata_pcmcia.c: add card ident for jvc cdrom 2007-05-09 20:15:46 -04:00
pata_pdc202xx_old.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_pdc2027x.c
pata_platform.c
pata_qdi.c Fix pata_qdi.c probe code 2007-05-09 20:15:47 -04:00
pata_radisys.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_rz1000.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_sc1200.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_scc.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_serverworks.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_sil680.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_sis.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_sl82c105.c
pata_triflex.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_via.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
pata_winbond.c
pdc_adma.c
sata_inic162x.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
sata_mv.c
sata_nv.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
sata_promise.c sata_promise: SATAII-150/300 TX4 port numbering fix 2007-05-09 20:15:46 -04:00
sata_promise.h
sata_qstor.c
sata_sil.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
sata_sil24.c libata: reimplement suspend/resume support using sdev->manage_start_stop 2007-05-11 18:01:03 -04:00
sata_sis.c
sata_svw.c
sata_sx4.c
sata_uli.c
sata_via.c sata_via: add missing PM hooks 2007-05-09 20:15:46 -04:00
sata_vsc.c
sis.h