aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/benet/be_cmds.c25
-rw-r--r--drivers/net/benet/be_main.c8
2 files changed, 22 insertions, 11 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index b57abc0c9f48..28a0eda92680 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -243,15 +243,26 @@ static int be_POST_stage_get(struct be_adapter *adapter, u16 *stage)
243 243
244int be_cmd_POST(struct be_adapter *adapter) 244int be_cmd_POST(struct be_adapter *adapter)
245{ 245{
246 u16 stage, error; 246 u16 stage;
247 int status, timeout = 0;
247 248
248 error = be_POST_stage_get(adapter, &stage); 249 do {
249 if (error || stage != POST_STAGE_ARMFW_RDY) { 250 status = be_POST_stage_get(adapter, &stage);
250 dev_err(&adapter->pdev->dev, "POST failed.\n"); 251 if (status) {
251 return -1; 252 dev_err(&adapter->pdev->dev, "POST error; stage=0x%x\n",
252 } 253 stage);
254 return -1;
255 } else if (stage != POST_STAGE_ARMFW_RDY) {
256 set_current_state(TASK_INTERRUPTIBLE);
257 schedule_timeout(2 * HZ);
258 timeout += 2;
259 } else {
260 return 0;
261 }
262 } while (timeout < 20);
253 263
254 return 0; 264 dev_err(&adapter->pdev->dev, "POST timeout; stage=0x%x\n", stage);
265 return -1;
255} 266}
256 267
257static inline void *embedded_payload(struct be_mcc_wrb *wrb) 268static inline void *embedded_payload(struct be_mcc_wrb *wrb)
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 36cb94869b01..1f941f027718 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -2058,6 +2058,10 @@ static int be_hw_up(struct be_adapter *adapter)
2058 if (status) 2058 if (status)
2059 return status; 2059 return status;
2060 2060
2061 status = be_cmd_reset_function(adapter);
2062 if (status)
2063 return status;
2064
2061 status = be_cmd_get_fw_ver(adapter, adapter->fw_ver); 2065 status = be_cmd_get_fw_ver(adapter, adapter->fw_ver);
2062 if (status) 2066 if (status)
2063 return status; 2067 return status;
@@ -2111,10 +2115,6 @@ static int __devinit be_probe(struct pci_dev *pdev,
2111 if (status) 2115 if (status)
2112 goto free_netdev; 2116 goto free_netdev;
2113 2117
2114 status = be_cmd_reset_function(adapter);
2115 if (status)
2116 goto ctrl_clean;
2117
2118 status = be_stats_init(adapter); 2118 status = be_stats_init(adapter);
2119 if (status) 2119 if (status)
2120 goto ctrl_clean; 2120 goto ctrl_clean;