linux/drivers
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
..
acorn [ARM] Acorn: move the i2c bus driver into drivers/i2c 2007-03-04 20:40:50 +00:00
acpi Pull misc-for-upstream into release branch 2007-05-10 04:06:12 -04:00
amba uevent: use add_uevent_var() instead of open coding it 2007-04-27 10:57:29 -07:00
ata libata: implement libata.spindown_compat 2007-05-11 18:01:04 -04:00
atm PCI: Cleanup the includes of <linux/pci.h> 2007-05-02 19:02:35 -07:00
auxdisplay [S390] Kconfig: refine depends statements. 2007-05-10 15:46:07 +02:00
base Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-05-09 12:54:17 -07:00
block [S390] Kconfig: use common Kconfig files for s390. 2007-05-10 15:46:08 +02:00
bluetooth [Bluetooth] Fix unintentional fall-through in HCI line discipline 2007-05-10 23:45:06 -07:00
cdrom mm: remove destroy_dirty_buffers from invalidate_bdev() 2007-05-07 12:12:55 -07:00
char Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2007-05-11 12:53:21 -07:00
clocksource ACPI: correct pathname in comment 2007-04-25 14:27:06 -04:00
connector [NETLINK]: Switch cb_lock spinlock to mutex and allow to override it 2007-04-25 22:29:03 -07:00
cpufreq Add suspend-related notifications for CPU hotplug 2007-05-09 12:30:56 -07:00
crypto [S390] Kconfig: use common Kconfig files for s390. 2007-05-10 15:46:08 +02:00
dio
dma [S390] Kconfig: unwanted menus for s390. 2007-05-10 15:46:07 +02:00
edac [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
eisa virtual_eisa_root_init() should be __init 2007-05-08 11:15:02 -07:00
fc4 [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
firewire firewire: Convert OHCI driver to use standard goto unwinding for error handling. 2007-05-10 18:24:14 +02:00
firmware remove "struct subsystem" as it is no longer needed 2007-05-02 18:57:59 -07:00
hid USB HID: hiddev - fix race between hiddev_send_event() and hiddev_release() 2007-05-10 08:45:56 +02:00
hwmon Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2007-05-10 11:50:51 -07:00
i2c Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6 2007-05-10 11:50:51 -07:00
ide [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
ieee1394 Merge branch 'juju' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2007-05-10 13:30:08 -07:00
infiniband [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
input Input: evdev - fix overflow in compat_ioctl 2007-05-11 09:08:04 -07:00
isdn [S390] Kconfig: unwanted menus for s390. 2007-05-10 15:46:07 +02:00
kvm [S390] Kconfig: refine depends statements. 2007-05-10 15:46:07 +02:00
leds [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
macintosh Merge master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6 2007-05-09 15:41:31 -07:00
mca mca: add integrated device bus matching 2007-05-09 12:30:49 -07:00
md md: improve the is_mddev_idle test 2007-05-11 08:29:37 -07:00
media Merge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb 2007-05-11 12:57:16 -07:00
message [S390] Kconfig: refine depends statements. 2007-05-10 15:46:07 +02:00
mfd [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
misc Pull misc-for-upstream into release branch 2007-05-10 04:06:12 -04:00
mmc [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
mtd [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
net Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-ip22 2007-05-11 10:00:50 -07:00
nubus
oprofile [PATCH] oprofile: fix potential deadlock on oprofilefs_lock 2007-03-28 13:58:02 -07:00
parisc header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
parport [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
pci [IA64] Fix warnings resulting from type-checking in dev_dbg() 2007-05-10 09:39:41 -07:00
pcmcia fix hotplug for legacy platform drivers 2007-05-08 11:15:10 -07:00
pnp [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
ps3 Merge branch 'linux-2.6' 2007-05-08 13:37:51 +10:00
rapidio [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
rtc Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus 2007-05-11 09:59:50 -07:00
s390 [S390] Kconfig: use common Kconfig files for s390. 2007-05-10 15:46:08 +02:00
sbus Fix misspellings collected by members of KJ list. 2007-05-09 07:14:03 +02:00
scsi Convert SGI IP22 and specific drivers to platform_device. 2007-05-11 17:00:29 +01:00
serial Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc 2007-05-10 13:32:24 -07:00
sh
sn [PATCH] IOC3/IOC4: PCI mem space resources 2007-02-11 10:51:25 -08:00
spi MPC52xx PSC SPI master driver 2007-05-11 08:29:35 -07:00
tc [PATCH] Fix build error on zs serial driver 2007-04-04 21:12:47 -07:00
telephony [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
usb [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
video VIDEO: remove archaic if[] construct from Kconfig file 2007-05-11 08:29:37 -07:00
w1 [S390] Kconfig: menus with depends on HAS_IOMEM. 2007-05-10 15:46:07 +02:00
zorro Amiga Zorro bus: kill resource_size_t warnings 2007-05-04 17:59:08 -07:00
Kconfig firewire: put old and new stack into same Kconfig submenu 2007-03-09 22:02:38 +01:00
Makefile Merge branch 'juju' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 2007-05-10 13:30:08 -07:00