diff -r 466c0828c525 sys/dev/cxgbe/t4_main.c --- a/sys/dev/cxgbe/t4_main.c Tue May 15 22:26:09 2018 +0000 +++ b/sys/dev/cxgbe/t4_main.c Tue May 15 16:44:40 2018 -0700 @@ -3453,8 +3453,30 @@ use_config_on_flash: if (rc != 0) { device_printf(sc->dev, "failed to pre-process config file: %d " - "(mtype %d, moff 0x%x).\n", rc, mtype, moff); - goto done; + "(mtype %d, moff 0x%x). Will reset the firmware and retry " + "with the built-in configuration.\n", rc, mtype, moff); + + rc = -t4_fw_reset(sc, sc->mbox, F_PIORSTMODE | F_PIORST); + if (rc != 0) { + device_printf(sc->dev, + "firmware reset failed: %d.\n", rc); + if (rc != ETIMEDOUT && rc != EIO) { + t4_fw_bye(sc, sc->mbox); + sc->flags &= ~FW_OK; + } + goto done; + } + snprintf(sc->cfg_file, sizeof(sc->cfg_file), "%s", "built-in"); + bzero(&caps, sizeof(caps)); + caps.op_to_write = htobe32(V_FW_CMD_OP(FW_CAPS_CONFIG_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_READ); + caps.cfvalid_to_len16 = htobe32(FW_LEN16(caps)); + rc = t4_wr_mbox(sc, sc->mbox, &caps, sizeof(caps), &caps); + if (rc != 0) { + device_printf(sc->dev, + "built-in configuration failed: %d.\n", rc); + goto done; + } } finicsum = be32toh(caps.finicsum);