From: Bernard Blackham <bernard@blackham.com.au>
To: B.Zolnierkiewicz@elka.pw.edu.pl
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org,
swsusp-devel@lists.sourceforge.net
Subject: shutdown patch
Date: Sun, 28 Dec 2003 11:04:39 +0800 [thread overview]
Message-ID: <20031228030438.GA1273@amidala> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 917 bytes --]
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.
--
Bernard Blackham <bernard at blackham dot com dot au>
[-- Attachment #1.2: ide-shutdown.diff --]
[-- Type: text/plain, Size: 718 bytes --]
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 #2: Type: application/pgp-signature, Size: 189 bytes --]
reply other threads:[~2003-12-28 3:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031228030438.GA1273@amidala \
--to=bernard@blackham.com.au \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=swsusp-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).