summaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss.c
diff options
context:
space:
mode:
authorMike Miller <mike.miller@hp.com>2005-09-13 01:25:21 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-13 08:22:29 -0700
commit1f8ef3806c40e74733f45f436d44b3d8e9a2fa48 (patch)
treecf580823a617be7ef3654d7cd26f3fd048db823c /drivers/block/cciss.c
parent9dc7a86e85593c834bb930f5d5aba3a19ee7a350 (diff)
[PATCH] cciss: busy_initializing flag
This patch adds a flag called busy_initializing. If there are multiple controllers in a server AND the HP agents are running it's possible the agents may try to poll a card that is still initializing if the driver is removed and then added again. Signed-off-by: Don Brace <dab@hp.com> Signed-off-by: Mike Miller <mike.miller@hp.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r--drivers/block/cciss.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 4a49d797212..8bcd6c498c6 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -468,6 +468,9 @@ static int cciss_open(struct inode *inode, struct file *filep)
printk(KERN_DEBUG "cciss_open %s\n", inode->i_bdev->bd_disk->disk_name);
#endif /* CCISS_DEBUG */
+ if (host->busy_initializing)
+ return -EBUSY;
+
/*
* Root is allowed to open raw volume zero even if it's not configured
* so array config can still work. Root is also allowed to open any
@@ -2742,6 +2745,9 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
i = alloc_cciss_hba();
if(i < 0)
return (-1);
+
+ hba[i]->busy_initializing = 1;
+
if (cciss_pci_init(hba[i], pdev) != 0)
goto clean1;
@@ -2864,6 +2870,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
add_disk(disk);
}
+ hba[i]->busy_initializing = 0;
return(1);
clean4:
@@ -2884,6 +2891,7 @@ clean2:
clean1:
release_io_mem(hba[i]);
free_hba(i);
+ hba[i]->busy_initializing = 0;
return(-1);
}