Re: 2.6.11-rc4-mm1 (VFS: Cannot open root device "301")

From: Benoit Boissinot
Date: Wed Feb 23 2005 - 21:05:53 EST


On Wed, 23 Feb 2005 16:41:59 -0800, Matt Mackall <mpm@xxxxxxxxxxx> wrote:
> On Wed, Feb 23, 2005 at 04:16:53PM -0800, Andrew Morton wrote:
> > Steven Cole <elenstev@xxxxxxxxxxx> wrote:
> > >
> > > > Yes, that worked. 2.6.11-rc4-mm1 now boots OK, but hdb1 seems to be
> > > > missing.
> >
> > Looking at the IDE update in rc4-mm1:
> >
> > +void ide_init_disk(struct gendisk *disk, ide_drive_t *drive)
> > +{
> > + ide_hwif_t *hwif = drive->hwif;
> > + unsigned int unit = drive->select.all & (1 << 4);
> > +

If i grep in the tree, for select.all, it looks like from the initialization
that you can not recover the unit from select.all (ide.c line 235 and 1882)
since the function used is not invertible.

> >
> > Could someone try this?
> >
> > - unsigned int unit = drive->select.all & (1 << 4);
> > + unsigned int unit = (drive->select.all >> 4) & 1;
>
> Apparently there's already an 'hdb' sitting in drive->name, perhaps we
> ought to do disk->disk_name = drive->name for the non-devfs case.
>
init_hwif_default initialized it right.

Could something like this work ?

regards,

Benoit
--- linux/drivers/ide/ide-probe.c 2005-02-23 12:16:32.000000000 +0100
+++ linux-test/drivers/ide/ide-probe.c 2005-02-24 03:02:06.000000000 +0100
@@ -1269,11 +1269,11 @@ EXPORT_SYMBOL_GPL(ide_unregister_region)
void ide_init_disk(struct gendisk *disk, ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
- unsigned int unit = drive->select.all & (1 << 4);
+ unsigned int unit = drive->name[2] - 'a' - hwif->index * MAX_DRIVES;

disk->major = hwif->major;
disk->first_minor = unit << PARTN_BITS;
- sprintf(disk->disk_name, "hd%c", 'a' + hwif->index * MAX_DRIVES + unit);
+ disk->disk_name = drive->name;
disk->queue = drive->queue;
}