PROBLEM: linux-2.5.65-ac3 does not boot whith IDE-drivers

From: Norbert Wolff (norbert_wolff@t-online.de)
Date: Mon Mar 24 2003 - 06:08:24 EST


Hi !

I tried linux-2.5.65-ac3 with ide-disk and ide-scsi drivers both built in
the Kernel.
Two ide-disks attached to ide0, two CDROMS attached to ide1.
Im using the sis5513-PCI-IDE-Driver, but configuring it out makes no difference.

The System hangs while booting with last messages
        ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
        ide1 at 0x170-0x177,0x376 on irq 15

It seems that all Drives went twice in the driver-list, so ata_attach
gets called twice for them, which leads to the hang.

Dirty Hack that works for me below.

Regards,

        Norbert

--- drivers/ide/ide.c.orig 2003-03-24 10:52:40.000000000 +0000
+++ drivers/ide/ide.c 2003-03-24 10:57:52.000000000 +0000
@@ -1423,6 +1423,14 @@
 {
         struct list_head *p;
         spin_lock(&drivers_lock);
+#define _DEBUG 1
+#ifdef _DEBUG
+ printk("ata_attach called for %s\n", drive->name);
+#endif
+ if (drive->already_attached) {
+ printk ("ata_attach: already attached for %s !\n", drive->name);
+ return 0;
+ }
         list_for_each(p, &drivers) {
                 ide_driver_t *driver = list_entry(p, ide_driver_t, drivers);
                 if (!try_module_get(driver->owner))
@@ -1431,12 +1439,14 @@
                 if (driver->attach(drive) == 0) {
                         module_put(driver->owner);
                         drive->gendev.driver = &driver->gen_driver;
+ drive->already_attached = 1;
                         return 0;
                 }
                 spin_lock(&drivers_lock);
                 module_put(driver->owner);
         }
         drive->gendev.driver = &idedefault_driver.gen_driver;
+ drive->already_attached = 1;
         spin_unlock(&drivers_lock);
         if(idedefault_driver.attach(drive) != 0)
                 panic("ide: default attach failed");
--- include/linux/ide.h.orig 2003-03-24 11:01:41.000000000 +0000
+++ include/linux/ide.h 2003-03-24 11:02:33.000000000 +0000
@@ -791,6 +791,7 @@
         int forced_lun; /* if hdxlun was given at boot */
         int lun; /* logical unit */
         int crc_count; /* crc counter to reduce drive speed */
+ int already_attached; /* Dirty Hack ... */
         struct list_head list;
         struct device gendev;
         struct gendisk *disk;
-
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 : Mon Mar 31 2003 - 22:00:15 EST