aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bnx2i
diff options
context:
space:
mode:
authorAnil Veerabhadrappa <anilgv@broadcom.com>2010-03-25 13:54:42 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-04-11 10:53:18 -0400
commitce2d763a2cd09513cb0c0e9ea52c30373c00b2f1 (patch)
treeeafb84d82ae79bdcc8a5a926d10955ee4fbff3fb /drivers/scsi/bnx2i
parent2e15efc7e1f99f56896b89fad9d13baac3c635f9 (diff)
[SCSI] bnx2i: link bnx2i hba and cnic device before registering the device
When bnx2/cnic/bnx2i drivers are loaded in certain order, bnx2i will will not initialize the device correctly because 'hba->cnic' will be NULL when bnx2i_start() is called from register_device() context. Under this condition 'ifdown' and 'ifup' of associated network interface is required to bring iscsi adapter state to ready state so that it will accept iscsi connection setup within the chip Initializing 'hba->cnic' before calling register_device() will fix this issue Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bnx2i')
-rw-r--r--drivers/scsi/bnx2i/bnx2i_init.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c
index 6d8172e781cf..737dce084276 100644
--- a/drivers/scsi/bnx2i/bnx2i_init.c
+++ b/drivers/scsi/bnx2i/bnx2i_init.c
@@ -278,6 +278,7 @@ static int bnx2i_init_one(struct bnx2i_hba *hba, struct cnic_dev *cnic)
278 int rc; 278 int rc;
279 279
280 mutex_lock(&bnx2i_dev_lock); 280 mutex_lock(&bnx2i_dev_lock);
281 hba->cnic = cnic;
281 rc = cnic->register_device(cnic, CNIC_ULP_ISCSI, hba); 282 rc = cnic->register_device(cnic, CNIC_ULP_ISCSI, hba);
282 if (!rc) { 283 if (!rc) {
283 hba->age++; 284 hba->age++;
@@ -324,8 +325,7 @@ void bnx2i_ulp_init(struct cnic_dev *dev)
324 if (bnx2i_init_one(hba, dev)) { 325 if (bnx2i_init_one(hba, dev)) {
325 printk(KERN_ERR "bnx2i - hba %p init failed\n", hba); 326 printk(KERN_ERR "bnx2i - hba %p init failed\n", hba);
326 bnx2i_free_hba(hba); 327 bnx2i_free_hba(hba);
327 } else 328 }
328 hba->cnic = dev;
329} 329}
330 330
331 331