aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Kumar Salecha <amit.salecha@qlogic.com>2010-04-01 15:01:34 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-03 17:19:15 -0400
commit34ce36268331719894c4b237a9413fe9e1ab4f75 (patch)
treec20b62fdcd5485be277ed55abb5daaea621c04cd
parent65b5b420b5974d86ee030b0a15cd9e6f228071f4 (diff)
qlcnic: fix interface attach sequence
Interface should be visible even if resource allocation fails. netif_device_attach should be called for every netif_device_detach. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 039f69382dc9..7ae464085b0d 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -952,11 +952,11 @@ void qlcnic_diag_free_res(struct net_device *netdev, int max_sds_rings)
952 adapter->max_sds_rings = max_sds_rings; 952 adapter->max_sds_rings = max_sds_rings;
953 953
954 if (qlcnic_attach(adapter)) 954 if (qlcnic_attach(adapter))
955 return; 955 goto out;
956 956
957 if (netif_running(netdev)) 957 if (netif_running(netdev))
958 __qlcnic_up(adapter, netdev); 958 __qlcnic_up(adapter, netdev);
959 959out:
960 netif_device_attach(netdev); 960 netif_device_attach(netdev);
961} 961}
962 962
@@ -978,8 +978,10 @@ int qlcnic_diag_alloc_res(struct net_device *netdev, int test)
978 adapter->diag_test = test; 978 adapter->diag_test = test;
979 979
980 ret = qlcnic_attach(adapter); 980 ret = qlcnic_attach(adapter);
981 if (ret) 981 if (ret) {
982 netif_device_attach(netdev);
982 return ret; 983 return ret;
984 }
983 985
984 if (adapter->diag_test == QLCNIC_INTERRUPT_TEST) { 986 if (adapter->diag_test == QLCNIC_INTERRUPT_TEST) {
985 for (ring = 0; ring < adapter->max_sds_rings; ring++) { 987 for (ring = 0; ring < adapter->max_sds_rings; ring++) {
@@ -1012,16 +1014,12 @@ qlcnic_reset_context(struct qlcnic_adapter *adapter)
1012 if (netif_running(netdev)) { 1014 if (netif_running(netdev)) {
1013 err = qlcnic_attach(adapter); 1015 err = qlcnic_attach(adapter);
1014 if (!err) 1016 if (!err)
1015 err = __qlcnic_up(adapter, netdev); 1017 __qlcnic_up(adapter, netdev);
1016
1017 if (err)
1018 goto done;
1019 } 1018 }
1020 1019
1021 netif_device_attach(netdev); 1020 netif_device_attach(netdev);
1022 } 1021 }
1023 1022
1024done:
1025 clear_bit(__QLCNIC_RESETTING, &adapter->state); 1023 clear_bit(__QLCNIC_RESETTING, &adapter->state);
1026 return err; 1024 return err;
1027} 1025}
@@ -1337,6 +1335,7 @@ err_out_detach:
1337 qlcnic_detach(adapter); 1335 qlcnic_detach(adapter);
1338err_out: 1336err_out:
1339 qlcnic_clr_all_drv_state(adapter); 1337 qlcnic_clr_all_drv_state(adapter);
1338 netif_device_attach(netdev);
1340 return err; 1339 return err;
1341} 1340}
1342#endif 1341#endif
@@ -2152,6 +2151,7 @@ qlcnic_fwinit_work(struct work_struct *work)
2152 } 2151 }
2153 2152
2154err_ret: 2153err_ret:
2154 netif_device_attach(adapter->netdev);
2155 qlcnic_clr_all_drv_state(adapter); 2155 qlcnic_clr_all_drv_state(adapter);
2156} 2156}
2157 2157
@@ -2190,6 +2190,7 @@ qlcnic_detach_work(struct work_struct *work)
2190err_ret: 2190err_ret:
2191 dev_err(&adapter->pdev->dev, "detach failed; status=%d temp=%d\n", 2191 dev_err(&adapter->pdev->dev, "detach failed; status=%d temp=%d\n",
2192 status, adapter->temp); 2192 status, adapter->temp);
2193 netif_device_attach(netdev);
2193 qlcnic_clr_all_drv_state(adapter); 2194 qlcnic_clr_all_drv_state(adapter);
2194 2195
2195} 2196}
@@ -2252,9 +2253,8 @@ qlcnic_attach_work(struct work_struct *work)
2252 qlcnic_config_indev_addr(netdev, NETDEV_UP); 2253 qlcnic_config_indev_addr(netdev, NETDEV_UP);
2253 } 2254 }
2254 2255
2255 netif_device_attach(netdev);
2256
2257done: 2256done:
2257 netif_device_attach(netdev);
2258 adapter->fw_fail_cnt = 0; 2258 adapter->fw_fail_cnt = 0;
2259 clear_bit(__QLCNIC_RESETTING, &adapter->state); 2259 clear_bit(__QLCNIC_RESETTING, &adapter->state);
2260 2260