mirror of https://github.com/thesofproject/sof.git
ipc: ipc3: handler: fix error handling for pm_core_enable
Check and return error if enabling a core fails instead of overwriting the error with a subsequent successful core power up. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This commit is contained in:
parent
c4666dc27d
commit
da79c5073b
|
@ -644,7 +644,7 @@ static int ipc_pm_context_restore(uint32_t header)
|
|||
static int ipc_pm_core_enable(uint32_t header)
|
||||
{
|
||||
struct sof_ipc_pm_core_config pm_core_config;
|
||||
int ret = 0;
|
||||
int ret;
|
||||
int i = 0;
|
||||
|
||||
/* copy message with ABI safe method */
|
||||
|
@ -662,14 +662,19 @@ static int ipc_pm_core_enable(uint32_t header)
|
|||
|
||||
for (i = 0; i < CONFIG_CORE_COUNT; i++) {
|
||||
if (i != PLATFORM_PRIMARY_CORE_ID) {
|
||||
if (pm_core_config.enable_mask & (1 << i))
|
||||
if (pm_core_config.enable_mask & (1 << i)) {
|
||||
ret = cpu_enable_core(i);
|
||||
else
|
||||
if (ret < 0) {
|
||||
tr_err(&ipc_tr, "Failed to enable core %d", i);
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
cpu_disable_core(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ipc_pm_gate(uint32_t header)
|
||||
|
|
Loading…
Reference in New Issue