IDE suspend small fixes

Pavel Machek (pavel@ucw.cz)
Fri, 22 Mar 2002 12:21:21 +0100


Hi!

Its bad idea to try to restore state twice for one suspend, this fixes
it. Please apply,
Pavel

--- clean/drivers/ide/ide-disk.c Thu Mar 21 11:35:59 2002
+++ linux-acpi/drivers/ide/ide-disk.c Fri Mar 22 12:08:58 2002
@@ -123,7 +123,7 @@

while (drive->blocked) {
yield();
- // panic("ide: Request while drive blocked?");
+ printk("ide: Request while drive blocked?");
}

if (!(rq->flags & REQ_CMD)) {
@@ -915,6 +915,9 @@
* already been done...
*/

+ if (level != SUSPEND_SAVE_STATE)
+ return 0;
+
/* wait until all commands are finished */
printk("ide_disk_suspend()\n");
while (HWGROUP(drive)->handler)
@@ -934,6 +937,9 @@
static int idedisk_resume(struct device *dev, u32 level)
{
ide_drive_t *drive = dev->driver_data;
+
+ if (level != RESUME_RESTORE_STATE)
+ return 0;
if (!drive->blocked)
panic("ide: Resume but not suspended?\n");

-- 
(about SSSCA) "I don't say this lightly.  However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/