X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fblock%2Fcciss.c;h=e336b05fe4a7f5d763dd0db8c61dc740b93635a9;hb=681f7d9db58d2b6dc3c3b784d6815f86a53b6ba0;hp=9c9627e8e3348ba9b146dcd6f9d6dadea5ba8181;hpb=2cca775baecbfede2fec20c99add709232311fe7;p=linux-2.6-omap-h63xx.git diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 9c9627e8e33..e336b05fe4a 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -425,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 */ @@ -1349,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; @@ -1419,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); } @@ -3520,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: @@ -3685,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)