runmulticore: disable console prints during cpu bringup

Printing on console while executing multi core command causes a race
condition in serial driver and results in data abort. Disable serial
console briefly during secondary cpu bring up to overcome the race
condition and data abort exception.

Signed-off-by: Sivaprakash Murugesan <sivaprak@codeaurora.org>
Change-Id: I6b3cda3bd828cbcaf8e766f243f8137ab496a805
This commit is contained in:
Sivaprakash Murugesan 2020-08-27 17:36:58 +05:30
parent cf7ac0ed01
commit 6ea54bd348
2 changed files with 13 additions and 0 deletions

View file

@ -58,6 +58,16 @@ asmlinkage void secondary_core_entry(char *argv, int *cmd_complete,
bring_secondary_core_down(state); bring_secondary_core_down(state);
} }
static void disable_console(void)
{
gd->flags |= GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE;
}
static void enable_console(void)
{
gd->flags &= ~(GD_FLG_SILENT | GD_FLG_DISABLE_CONSOLE);
}
int do_runmulticore(cmd_tbl_t *cmdtp, int do_runmulticore(cmd_tbl_t *cmdtp,
int flag, int argc, char *const argv[]) int flag, int argc, char *const argv[])
{ {
@ -109,6 +119,7 @@ int do_runmulticore(cmd_tbl_t *cmdtp,
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
printf("Scheduling Core %d\n", i); printf("Scheduling Core %d\n", i);
delay = 0; delay = 0;
disable_console();
ret = bring_sec_core_up(i, (unsigned int)secondary_cpu_init, ret = bring_sec_core_up(i, (unsigned int)secondary_cpu_init,
(unsigned int)&(core[i - 1])); (unsigned int)&(core[i - 1]));
if (ret) { if (ret) {
@ -121,6 +132,7 @@ int do_runmulticore(cmd_tbl_t *cmdtp,
if (!(core[i - 1].cpu_up)) { if (!(core[i - 1].cpu_up)) {
panic("Can't bringup core %d\n",i); panic("Can't bringup core %d\n",i);
} }
enable_console();
core_status |= (BIT(i - 1)); core_status |= (BIT(i - 1));
core_on_status |= (BIT(i - 1)); core_on_status |= (BIT(i - 1));

View file

@ -344,6 +344,7 @@ extern loff_t board_env_size;
#define CONFIG_CMD_RUN #define CONFIG_CMD_RUN
#define CONFIG_ARMV7_PSCI #define CONFIG_ARMV7_PSCI
#undef CONFIG_IPQ_ROOTFS_AUTH #undef CONFIG_IPQ_ROOTFS_AUTH
#define CONFIG_SILENT_CONSOLE
#endif /* _IPQCDP_H */ #endif /* _IPQCDP_H */