]> err.no Git - linux-2.6/blobdiff - drivers/block/cciss.c
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer...
[linux-2.6] / drivers / block / cciss.c
index 55bd35c0f082344a1d33822d081fcd7f9a104663..e336b05fe4a7f5d763dd0db8c61dc740b93635a9 100644 (file)
@@ -50,6 +50,7 @@
 #include <scsi/sg.h>
 #include <scsi/scsi_ioctl.h>
 #include <linux/cdrom.h>
+#include <linux/scatterlist.h>
 
 #define CCISS_DRIVER_VERSION(maj,min,submin) ((maj<<16)|(min<<8)|(submin))
 #define DRIVER_NAME "HP CISS Driver (v 3.6.14)"
@@ -424,16 +425,12 @@ static void __devinit cciss_procinit(int i)
        struct proc_dir_entry *pde;
 
        if (proc_cciss == NULL)
-               proc_cciss = proc_mkdir("cciss", proc_root_driver);
+               proc_cciss = proc_mkdir("driver/cciss", NULL);
        if (!proc_cciss)
                return;
-       pde = proc_create(hba[i]->devname, S_IWUSR | S_IRUSR | S_IRGRP |
+       pde = proc_create_data(hba[i]->devname, S_IWUSR | S_IRUSR | S_IRGRP |
                                        S_IROTH, proc_cciss,
-                                       &cciss_proc_fops);
-       if (!pde)
-               return;
-
-       pde->data = hba[i];
+                                       &cciss_proc_fops, hba[i]);
 }
 #endif                         /* CONFIG_PROC_FS */
 
@@ -1348,6 +1345,10 @@ static void cciss_update_drive_info(int ctlr, int drv_index)
                spin_lock_irqsave(CCISS_LOCK(h->ctlr), flags);
                h->drv[drv_index].busy_configuring = 1;
                spin_unlock_irqrestore(CCISS_LOCK(h->ctlr), flags);
+
+               /* deregister_disk sets h->drv[drv_index].queue = NULL */
+               /* which keeps the interrupt handler from starting */
+               /* the queue. */
                ret = deregister_disk(h->gendisk[drv_index],
                                      &h->drv[drv_index], 0);
                h->drv[drv_index].busy_configuring = 0;
@@ -1418,6 +1419,10 @@ geo_inq:
                blk_queue_hardsect_size(disk->queue,
                                        hba[ctlr]->drv[drv_index].block_size);
 
+               /* Make sure all queue data is written out before */
+               /* setting h->drv[drv_index].queue, as setting this */
+               /* allows the interrupt handler to start the queue */
+               wmb();
                h->drv[drv_index].queue = disk->queue;
                add_disk(disk);
        }
@@ -3519,10 +3524,17 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
                        continue;
                blk_queue_hardsect_size(q, drv->block_size);
                set_capacity(disk, drv->nr_blocks);
-               add_disk(disk);
                j++;
        } while (j <= hba[i]->highest_lun);
 
+       /* Make sure all queue data is written out before */
+       /* interrupt handler, triggered by add_disk,  */
+       /* is allowed to start them. */
+       wmb();
+
+       for (j = 0; j <= hba[i]->highest_lun; j++)
+               add_disk(hba[i]->gendisk[j]);
+
        return 1;
 
       clean4:
@@ -3684,7 +3696,7 @@ static void __exit cciss_cleanup(void)
                        cciss_remove_one(hba[i]->pdev);
                }
        }
-       remove_proc_entry("cciss", proc_root_driver);
+       remove_proc_entry("driver/cciss", NULL);
 }
 
 static void fail_all_cmds(unsigned long ctlr)