[prev in list] [next in list] [prev in thread] [next in thread] 

List:       swsusp-devel
Subject:    [Swsusp-devel] shutdown patch
From:       Bernard Blackham <bernard () blackham ! com ! au>
Date:       2003-12-28 3:04:39
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Hi,

In 2.4, there was an IDE reboot notifier that placed HDDs into
standby before shutdown (and parking heads). These no longer exist
in 2.6's IDE code since the power management rework. Debian (and
probably most distributions) run halt(8) as the last command in
runlevel 0 which puts the disk into standby mode, so generally it
isn't a problem.

However, if the system is powered off by other means (eg,
suspend-to-disk), the drive is never placed in standby mode, and
some drives will make a very audible "thunk" (my guess is as they
race to park their heads).

This patch places the disks in standby when device_shutdown() is
called. Please consider it, or something with the same functionality
(I'm not sure if it's correct to assume that calling
device->shutdown() can be treated the same as entering S5).

Regards,

Bernard.

--=20
 Bernard Blackham <bernard at blackham dot com dot au>

["ide-shutdown.diff" (text/plain)]

diff -ruN linux-2.6.0/drivers/ide/ide.c.orig linux-2.6.0/drivers/ide/ide.c
--- linux-2.6.0/drivers/ide/ide.c.orig	2003-12-18 10:58:38.000000000 +0800
+++ linux-2.6.0/drivers/ide/ide.c	2003-12-28 10:18:47.000000000 +0800
@@ -2493,6 +2493,11 @@
 	return 0;
 }
 
+static void ide_drive_shutdown (struct device * dev)
+{
+	generic_ide_suspend(dev, 5);
+}
+
 int ide_register_driver(ide_driver_t *driver)
 {
 	struct list_head list;
@@ -2519,6 +2524,7 @@
 	driver->gen_driver.name = (char *) driver->name;
 	driver->gen_driver.bus = &ide_bus_type;
 	driver->gen_driver.remove = ide_drive_remove;
+	driver->gen_driver.shutdown = ide_drive_shutdown;
 	return driver_register(&driver->gen_driver);
 }
 

[Attachment #6 (application/pgp-signature)]
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
swsusp-devel mailing list
swsusp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swsusp-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic