[PATCH 2/3] [BNX2I] link bnx2i hba and cnic device before registering the device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



	[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@xxxxxxxxxxxx>
Signed-off-by: Anil Veerabhadrappa <anilgv@xxxxxxxxxxxx>
---
 drivers/scsi/bnx2i/bnx2i_init.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c
index 6d8172e..737dce0 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)
 	int rc;
 
 	mutex_lock(&bnx2i_dev_lock);
+	hba->cnic = cnic;
 	rc = cnic->register_device(cnic, CNIC_ULP_ISCSI, hba);
 	if (!rc) {
 		hba->age++;
@@ -324,8 +325,7 @@ void bnx2i_ulp_init(struct cnic_dev *dev)
 	if (bnx2i_init_one(hba, dev)) {
 		printk(KERN_ERR "bnx2i - hba %p init failed\n", hba);
 		bnx2i_free_hba(hba);
-	} else
-		hba->cnic = dev;
+	}
 }
 
 
-- 
1.6.5.1




--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux