Re: Suspend support for IDE

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Fri Mar 08 2002 - 13:37:10 EST


> + while (HWGROUP(drive)->handler)
> + schedule();

You need to yield. Remember the process might be hard real time and blocking
your real work from occuring. while(foo) schedule() is always a bug

> +static int idedisk_resume(struct device *dev, u32 level)
> +{
> + ide_drive_t *drive = dev->driver_data;
> + if (!drive->blocked)
> + panic("ide: Resume but not suspended?\n");
> + drive->blocked = 0;
> +}

Also remember you must perform the sequences to wake up the drive and
restore the controller logic (and of course in the right order). Newer
disks won't just wake up when fed a random command (eg ibm microdrives)

The suspend order similarly is important - finish the current command,
then flush the disk cache, then when it completes you can tell the drive
to power down. On some systems you want to drop it back to PIO0 non DMA
before the powerdown or S4BIOS restore from disk will fail.

APM generally does all this for you, ACPI won't.
-
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/



This archive was generated by hypermail 2b29 : Fri Mar 15 2002 - 22:00:09 EST