From 9e9402eb450f1c921cc130765a4554a84821feab Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Fri, 2 Aug 2013 11:28:23 -0700 Subject: cnic, bnx2i: Fix bug on some bnx2x devices that don't support iSCSI On some bnx2x devices, iSCSI is determined to be unsupported only after firmware is downloaded. We need to check max_iscsi_conn again after NETDEV_UP and block iSCSI init operations. Without this fix, iscsiadm can hang as the firmware will not respond to the iSCSI init message. Signed-off-by: Eddie Wai Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/ethernet/broadcom/cnic.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers/net/ethernet/broadcom') diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index 6bd6d143491b..4f8a5357cedc 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c @@ -5276,6 +5276,13 @@ static int cnic_register_netdev(struct cnic_dev *dev) if (err) netdev_err(dev->netdev, "register_cnic failed\n"); + /* Read iSCSI config again. On some bnx2x device, iSCSI config + * can change after firmware is downloaded. + */ + dev->max_iscsi_conn = ethdev->max_iscsi_conn; + if (ethdev->drv_state & CNIC_DRV_STATE_NO_ISCSI) + dev->max_iscsi_conn = 0; + return err; } -- cgit v1.2.3