Re: 2.5.70-bk[56] breaks disk partitioning with multiple IDE disks

From: Adam J. Richter (adam@yggdrasil.com)
Date: Sun Jun 01 2003 - 19:45:09 EST


        To add to my own posting, here is a patch to 2.5.70-bk6
that reverts only the changes that replaced ata_unused with
idedeault_driver.drives. This change makes bk6 work for me with
multiple IDE disk drives present.

        I have tried a number of smaller changes to stock
2.5.70-bk6/drivers/ide/ide.c, but, I have not yet found a change
simpler than this that works.

Adam J. Richter __ ______________ 575 Oroville Road
adam@yggdrasil.com \ / Miplitas, California 95035
+1 408 309-6081 | g g d r a s i l United States of America
                         "Free Software For The Rest Of Us."

--- linux-2.5.70-bk6/drivers/ide/ide.c 2003-06-01 12:01:28.000000000 -0700
+++ linux/drivers/ide/ide.c 2003-06-01 16:52:28.000000000 -0700
@@ -462,6 +462,7 @@
         return -ENXIO;
 }
 
+static LIST_HEAD(ata_unused);
 static spinlock_t drives_lock = SPIN_LOCK_UNLOCKED;
 static spinlock_t drivers_lock = SPIN_LOCK_UNLOCKED;
 static LIST_HEAD(drivers);
@@ -1436,6 +1437,9 @@
         spin_unlock(&drivers_lock);
         if(idedefault_driver.attach(drive) != 0)
                 panic("ide: default attach failed");
+ spin_lock(&drives_lock);
+ list_add_tail(&drive->list, &ata_unused);
+ spin_unlock(&drives_lock);
         return 1;
 }
 
@@ -2379,8 +2383,8 @@
         spin_unlock_irqrestore(&ide_lock, flags);
         spin_lock(&drives_lock);
         list_del_init(&drive->list);
+ list_add(&drive->list, &drive->driver->drives);
         spin_unlock(&drives_lock);
- /* drive will be added to &idedefault_driver->drives in ata_attach() */
         return 0;
 }
 
@@ -2403,9 +2407,9 @@
         list_add(&driver->drivers, &drivers);
         spin_unlock(&drivers_lock);
 
- INIT_LIST_HEAD(&list);
         spin_lock(&drives_lock);
- list_splice_init(&idedefault_driver.drives, &list);
+ INIT_LIST_HEAD(&list);
+ list_splice_init(&ata_unused, &list);
         spin_unlock(&drives_lock);
 
         list_for_each_safe(list_loop, tmp_storage, &list) {
-
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 : Sat Jun 07 2003 - 22:00:15 EST