diff --git a/board/qca/arm/common/cmd_bootqca.c b/board/qca/arm/common/cmd_bootqca.c index 4fa5ad0bbd..96b5c6dbb6 100644 --- a/board/qca/arm/common/cmd_bootqca.c +++ b/board/qca/arm/common/cmd_bootqca.c @@ -1363,13 +1363,13 @@ int do_dumpqca_flash_data(const char *offset) #endif } else { printf("command not supported for this flash memory\n"); - return CMD_RET_FAILURE; + return -EINVAL; } ret_val = str2off(offset, &crashdump_offset); if (!ret_val) - return CMD_RET_USAGE; + return -EINVAL; g_crashdump_data.cpu_context = kernel_crashdump_address; tlv_msg.msg_buffer = kernel_crashdump_address + CONFIG_CPU_CONTEXT_DUMP_SIZE; @@ -1384,11 +1384,11 @@ int do_dumpqca_flash_data(const char *offset) if (ret_val) { printf("crashdump data writing in flash failure\n"); - return CMD_RET_FAILURE; + return -EPERM; } printf("crashdump data writing in flash successful\n"); - return CMD_RET_SUCCESS; + return 0; } #endif diff --git a/common/autoboot.c b/common/autoboot.c index 751abe7e9e..08407a6ae0 100644 --- a/common/autoboot.c +++ b/common/autoboot.c @@ -371,8 +371,10 @@ void autoboot_command(const char *s) if (apps_iscrashed()) { printf("Crashdump magic found, initializing dump activity..\n"); s = getenv("dump_to_flash"); - if (s) + if (s) { do_dumpqca_flash_data(s); /* write core dump data to flash */ + run_command("reset", 0); + } else dump_func(); return;