Commit 57bea21a authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

[PATCH] Suspend IDE disks on shutdown

When Patrick removed ide_notify_reboot() in 2.5.42, he didn't notice
that it meant that IDE no longer had any shutdown() functionality.

So we did the right thing on suspend, but not on shutdown.

ide_notify_reboot() was only doing STANDBY on shutdown (because FLUSH
'doesn't work' in 2.4 too) but it worked okay and we still should do STANDBY
on shutdown because some broken disks flush their caches.

Thus just calls bus->suspend() (FLUSH+STANDBY) at shutdown time.  We can
add some safety delay later - 2.4 doesn't have any.
parent 09f4450a
......@@ -1702,11 +1702,22 @@ static int idedisk_cleanup (ide_drive_t *drive)
static int idedisk_attach(ide_drive_t *drive);
static void ide_device_shutdown(struct device *dev)
{
ide_drive_t *drive = container_of(dev, ide_drive_t, gendev);
printk("Shutdown: %s\n", drive->name);
dev->bus->suspend(dev, PM_SUSPEND_STANDBY);
}
/*
* IDE subdriver functions, registered with ide.c
*/
static ide_driver_t idedisk_driver = {
.owner = THIS_MODULE,
.gen_driver = {
.shutdown = ide_device_shutdown,
},
.name = "ide-disk",
.version = IDEDISK_VERSION,
.media = ide_disk,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment