From: Brett Creeley When polling for a devcmd completion it's possible for the driver to timeout the command even if the dev_cmd has completed. This can cause unexpected failures and device probe to fail. Fix this by reading the dev_cmd's done bit one last time after breaking out of the poll loop. Fixes: fbfb8031533c ("ionic: Add hardware init and device commands") Suggested-by: Neel Patel Signed-off-by: Brett Creeley Signed-off-by: Eric Joyner --- drivers/net/ethernet/pensando/ionic/ionic_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_main.c b/drivers/net/ethernet/pensando/ionic/ionic_main.c index 91f89b9ff807..810cef0fec93 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_main.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_main.c @@ -541,6 +541,10 @@ static int __ionic_dev_cmd_wait(struct ionic *ionic, unsigned long max_seconds, } duration = jiffies - start_time; + /* one final check to prevent unexpected timeout */ + if (!done) + done = ionic_dev_cmd_done(idev); + dev_dbg(ionic->dev, "DEVCMD %s (%d) done=%d took %ld secs (%ld jiffies)\n", ionic_opcode_to_str(opcode), opcode, done, duration / HZ, duration); -- 2.17.1