aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_cmds.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 9e305d7fb4bd..ce437b639cf8 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -186,7 +186,7 @@ static int be_mcc_notify_wait(struct be_adapter *adapter)
186 186
187static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db) 187static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db)
188{ 188{
189 int cnt = 0, wait = 5; 189 int msecs = 0;
190 u32 ready; 190 u32 ready;
191 191
192 do { 192 do {
@@ -201,15 +201,14 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db)
201 if (ready) 201 if (ready)
202 break; 202 break;
203 203
204 if (cnt > 4000000) { 204 if (msecs > 4000) {
205 dev_err(&adapter->pdev->dev, "mbox poll timed out\n"); 205 dev_err(&adapter->pdev->dev, "mbox poll timed out\n");
206 return -1; 206 return -1;
207 } 207 }
208 208
209 if (cnt > 50) 209 set_current_state(TASK_INTERRUPTIBLE);
210 wait = 200; 210 schedule_timeout(msecs_to_jiffies(1));
211 cnt += wait; 211 msecs++;
212 udelay(wait);
213 } while (true); 212 } while (true);
214 213
215 return 0; 214 return 0;