diff options
author | Amit Kumar Salecha <amit.salecha@qlogic.com> | 2010-03-28 22:43:42 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-29 16:18:36 -0400 |
commit | 6b50ea1516fab30ce5843e5b11e43488f38c776d (patch) | |
tree | 70df437e179bd7d588460549f6f5e996a4ecd13c /drivers/net/netxen | |
parent | ff90cd4a1dcfc03bf228d94f553619198e65bc42 (diff) |
netxen: fix corner cases of firmware recovery
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
o DEV_NEED_RESET state was not handled during fw intialization phase.
o nx_decr_dev_ref_cnt() can return error, if fail to grab pcie seamphore.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netxen')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 08780ef1c1f8..68903bf06cf6 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -2294,6 +2294,7 @@ netxen_fwinit_work(struct work_struct *work) | |||
2294 | } | 2294 | } |
2295 | break; | 2295 | break; |
2296 | 2296 | ||
2297 | case NX_DEV_NEED_RESET: | ||
2297 | case NX_DEV_INITALIZING: | 2298 | case NX_DEV_INITALIZING: |
2298 | if (++adapter->fw_wait_cnt < FW_POLL_THRESH) { | 2299 | if (++adapter->fw_wait_cnt < FW_POLL_THRESH) { |
2299 | netxen_schedule_work(adapter, | 2300 | netxen_schedule_work(adapter, |
@@ -2337,6 +2338,9 @@ netxen_detach_work(struct work_struct *work) | |||
2337 | 2338 | ||
2338 | ref_cnt = nx_decr_dev_ref_cnt(adapter); | 2339 | ref_cnt = nx_decr_dev_ref_cnt(adapter); |
2339 | 2340 | ||
2341 | if (ref_cnt == -EIO) | ||
2342 | goto err_ret; | ||
2343 | |||
2340 | delay = (ref_cnt == 0) ? 0 : (2 * FW_POLL_DELAY); | 2344 | delay = (ref_cnt == 0) ? 0 : (2 * FW_POLL_DELAY); |
2341 | 2345 | ||
2342 | adapter->fw_wait_cnt = 0; | 2346 | adapter->fw_wait_cnt = 0; |