Skip to content

Commit 5466491

Browse files
brettcreeleykuba-moo
authored andcommitted
ionic: Prevent driver/fw getting out of sync on devcmd(s)
Some stress/negative firmware testing around devcmd(s) returning EAGAIN found that the done bit could get out of sync in the firmware when it wasn't cleared in a retry case. While here, change the type of the local done variable to a bool to match the return type from ionic_dev_cmd_done(). Fixes: ec8ee71 ("ionic: stretch heartbeat detection") Signed-off-by: Brett Creeley <[email protected]> Signed-off-by: Shannon Nelson <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 27605c8 commit 5466491

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,16 +516,17 @@ static int __ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds,
516516
unsigned long start_time;
517517
unsigned long max_wait;
518518
unsigned long duration;
519-
int done = 0;
520519
bool fw_up;
521520
int opcode;
521+
bool done;
522522
int err;
523523

524524
/* Wait for dev cmd to complete, retrying if we get EAGAIN,
525525
* but don't wait any longer than max_seconds.
526526
*/
527527
max_wait = jiffies + (max_seconds * HZ);
528528
try_again:
529+
done = false;
529530
opcode = idev->opcode;
530531
start_time = jiffies;
531532
for (fw_up = ionic_is_fw_running(idev);

0 commit comments

Comments
 (0)