aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic
diff options
context:
space:
mode:
authorAmit Kumar Salecha <amit.salecha@qlogic.com>2010-04-21 22:51:39 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-22 18:28:29 -0400
commitade91f8ec92da43b62b0efaa854cfd4b5ec0c0c9 (patch)
tree7d436d941994802743504a8d4acb4facc70f2904 /drivers/net/qlcnic
parent6d2a47241f0f780819c111eaabaae0e86a937a40 (diff)
qlcnic: fix pci semaphore checks
Driver should not go ahead with fw recovery if fails to acquire semaphore. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 3c8a963f68a9..bfc551029537 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -1949,8 +1949,8 @@ static void qlcnic_poll_controller(struct net_device *netdev)
1949} 1949}
1950#endif 1950#endif
1951 1951
1952static void 1952static int
1953qlcnic_set_drv_state(struct qlcnic_adapter *adapter, int state) 1953qlcnic_set_drv_state(struct qlcnic_adapter *adapter, u8 state)
1954{ 1954{
1955 u32 val; 1955 u32 val;
1956 1956
@@ -1958,7 +1958,7 @@ qlcnic_set_drv_state(struct qlcnic_adapter *adapter, int state)
1958 state != QLCNIC_DEV_NEED_QUISCENT); 1958 state != QLCNIC_DEV_NEED_QUISCENT);
1959 1959
1960 if (qlcnic_api_lock(adapter)) 1960 if (qlcnic_api_lock(adapter))
1961 return ; 1961 return -EIO;
1962 1962
1963 val = QLCRD32(adapter, QLCNIC_CRB_DRV_STATE); 1963 val = QLCRD32(adapter, QLCNIC_CRB_DRV_STATE);
1964 1964
@@ -1970,6 +1970,8 @@ qlcnic_set_drv_state(struct qlcnic_adapter *adapter, int state)
1970 QLCWR32(adapter, QLCNIC_CRB_DRV_STATE, val); 1970 QLCWR32(adapter, QLCNIC_CRB_DRV_STATE, val);
1971 1971
1972 qlcnic_api_unlock(adapter); 1972 qlcnic_api_unlock(adapter);
1973
1974 return 0;
1973} 1975}
1974 1976
1975static int 1977static int
@@ -2195,7 +2197,8 @@ qlcnic_detach_work(struct work_struct *work)
2195 if (adapter->temp == QLCNIC_TEMP_PANIC) 2197 if (adapter->temp == QLCNIC_TEMP_PANIC)
2196 goto err_ret; 2198 goto err_ret;
2197 2199
2198 qlcnic_set_drv_state(adapter, adapter->dev_state); 2200 if (qlcnic_set_drv_state(adapter, adapter->dev_state))
2201 goto err_ret;
2199 2202
2200 adapter->fw_wait_cnt = 0; 2203 adapter->fw_wait_cnt = 0;
2201 2204