Skip to content

Commit 0fc4dd4

Browse files
emuslnkuba-moo
authored andcommitted
ionic: fix up issues with handling EAGAIN on FW cmds
In looping on FW update tests we occasionally see the FW_ACTIVATE_STATUS command fail while it is in its EAGAIN loop waiting for the FW activate step to finsh inside the FW. The firmware is complaining that the done bit is set when a new dev_cmd is going to be processed. Doing a clean on the cmd registers and doorbell before exiting the wait-for-done and cleaning the done bit before the sleep prevents this from occurring. Fixes: fbfb803 ("ionic: Add hardware init and device commands") Signed-off-by: Shannon Nelson <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9cb9dad commit 0fc4dd4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/pensando/ionic/ionic_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,8 @@ static int __ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds,
474474
ionic_opcode_to_str(opcode), opcode,
475475
ionic_error_to_str(err), err);
476476

477-
msleep(1000);
478477
iowrite32(0, &idev->dev_cmd_regs->done);
478+
msleep(1000);
479479
iowrite32(1, &idev->dev_cmd_regs->doorbell);
480480
goto try_again;
481481
}
@@ -488,6 +488,8 @@ static int __ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds,
488488
return ionic_error_to_errno(err);
489489
}
490490

491+
ionic_dev_cmd_clean(ionic);
492+
491493
return 0;
492494
}
493495

0 commit comments

Comments
 (0)