Re: devicefs & sleep support for IDE

From: Patrick Mochel (
Date: Mon Sep 23 2002 - 13:42:21 EST

> New patch, rediffed against 2.5.36.
> More patches will be needed to support IDE properly (like DVD burners
> you mentioned), but this is known to fix data corruption. It has zero
> impact on actual I/O. It affects initialization and suspend only.
> Please apply this time.

Basic driver model support for IDE is in 2.5.38. This just involves
creating an IDE bus type, and registering drives as devices. I.e. there is
no driver set for any of the drives.

I do have a couple of comments though.

> +static struct device_driver idedisk_devdrv = {
> + .lock = RW_LOCK_UNLOCKED,
> + .suspend = idedisk_suspend,
> + .resume = idedisk_resume,
> +};

You don't need to initialize .lock. But, you do need a .name and .bus. The
driver won't even be registered unless .bus is set.

> @@ -835,6 +837,7 @@
> int crc_count; /* crc counter to reduce drive speed */
> struct list_head list;
> struct gendisk *disk;
> + struct device device; /* for driverfs */
> } ide_drive_t;

There is a struct device in struct gendisk; that should suffice. But note
that you may have to do an extra conversion in order to access it in the
driver callbacks.

> + struct device device; /* for devicefs */

Please: it's driver model support, not driverfs. And devicefs does not
even exist. :)



To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Sep 23 2002 - 22:00:39 EST