From a77870a740d6de49e356d8fcb1e3519da7223de8 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Wed, 2 Jun 2004 09:46:12 -0700 Subject: [PATCH] [PATCH] ide: don't put disks in standby mode on halt on Alpha From: Ivan Kokshaysky Signed-off-by: Bartlomiej Zolnierkiewicz Signed-off-by: Linus Torvalds --- drivers/ide/ide-disk.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index b660903131ed9..47761a0a54861 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -1713,7 +1713,22 @@ static void ide_device_shutdown(struct device *dev) { ide_drive_t *drive = container_of(dev, ide_drive_t, gendev); +#ifdef CONFIG_ALPHA + /* On Alpha, halt(8) doesn't actually turn the machine off, + it puts you into the sort of firmware monitor. Typically, + it's used to boot another kernel image, so it's not much + different from reboot(8). Therefore, we don't need to + spin down the disk in this case, especially since Alpha + firmware doesn't handle disks in standby mode properly. + On the other hand, it's reasonably safe to turn the power + off when the shutdown process reaches the firmware prompt, + as the firmware initialization takes rather long time - + at least 10 seconds, which should be sufficient for + the disk to expire its write cache. */ + if (system_state != SYSTEM_POWER_OFF) { +#else if (system_state == SYSTEM_RESTART) { +#endif ide_cacheflush_p(drive); return; } -- 2.53.0