From: Nigel Cunningham <ncunningham@clear.net.nz>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: PATCH: Fixes for ide-disk.c
Date: Sat, 05 Apr 2003 19:31:17 +1200 [thread overview]
Message-ID: <1049527877.1865.17.camel@laptop-linux.cunninghams> (raw)
Hi.
In working on swsusp, I've found the following patches were needed.
The first fragment is trivial, as you'll see.
The second and third handle the fact that the suspend & resume functions
can be called multiple times. Pavel asked me to pass it on immediately.
The fourth handles the fact that writeback caches seem to be implemented
in two ways. People using swsusp under 2.4 found that everything worked
fine if they rebooted after writing the image, but powering down at the
end of writing the image caused corruption. I got the additional check
from the source for hdparm, which only does the new check to determine
if a drive has a writeback cache.
Regards,
Nigel
--- linux-2.5.66-original/drivers/ide/ide-disk.c 2003-03-26 08:56:49.000000000 +1200
+++ linux-2.5.66/drivers/ide/ide-disk.c 2003-04-05 18:51:17.000000000 +1200
@@ -1515,7 +1515,7 @@
{
ide_drive_t *drive = dev->driver_data;
- printk("Suspending device %p\n", dev->driver_data);
+ printk(KERN_INFO "Suspending device %p\n", dev->driver_data);
/* I hope that every freeze operation from the upper levels have
* already been done...
@@ -1527,7 +1527,7 @@
/* set the drive to standby */
printk(KERN_INFO "suspending: %s ", drive->name);
do_idedisk_standby(drive);
- drive->blocked = 1;
+ drive->blocked++;
BUG_ON (HWGROUP(drive)->handler);
return 0;
@@ -1539,8 +1539,8 @@
if (level != RESUME_RESTORE_STATE)
return 0;
- BUG_ON(!drive->blocked);
- drive->blocked = 0;
+ if (drive->blocked)
+ drive->blocked--;
return 0;
}
@@ -1804,7 +1804,8 @@
if ((!drive->head || drive->head > 16) && !drive->select.b.lba) {
printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n",
drive->name, drive->head);
- if ((drive->id->cfs_enable_2 & 0x3000) && drive->wcache)
+ if (((drive->id->cfs_enable_2 & 0x3000) && drive->wcache) ||
+ ((drive->id->command_set_1 & 0x20) && drive->id->cfs_enable_1 & 0x20))
if (do_idedisk_flushcache(drive))
printk (KERN_INFO "%s: Write Cache FAILED Flushing!\n",
drive->name);
next reply other threads:[~2003-04-05 7:22 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-05 7:31 Nigel Cunningham [this message]
2003-04-05 9:27 ` PATCH: Fixes for ide-disk.c John Bradford
2003-04-05 10:57 ` Andre Hedrick
2003-04-05 13:09 ` John Bradford
2003-04-05 16:46 ` Alan Cox
2003-04-05 19:25 ` Nigel Cunningham
2003-04-05 20:58 ` Andre Hedrick
2003-04-06 15:03 ` Alan Cox
2003-04-06 20:59 ` Nigel Cunningham
2003-04-06 21:02 ` Alan Cox
2003-04-06 21:12 ` Nigel Cunningham
2003-04-06 21:00 ` Alan Cox
2003-04-06 21:58 ` Nigel Cunningham
2003-04-10 18:38 ` Pavel Machek
2003-04-10 21:55 ` Alan Cox
2003-04-10 23:36 ` Nigel Cunningham
2003-04-13 11:17 ` Pavel Machek
2003-04-10 18:37 ` Pavel Machek
2003-04-11 3:30 ` Andre Hedrick
2003-04-05 16:46 ` Alan Cox
-- strict thread matches above, loose matches on Subject: below --
2003-04-05 10:32 Chuck Ebbert
2003-04-05 11:30 ` Andre Hedrick
2003-04-05 18:34 Mudama, Eric
2003-04-05 19:52 ` Andre Hedrick
2003-04-05 20:17 Mudama, Eric
2003-04-05 20:54 ` Andre Hedrick
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=1049527877.1865.17.camel@laptop-linux.cunninghams \
--to=ncunningham@clear.net.nz \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.