Skip to content

Commit 1dc7242

Browse files
3V3RYONEmathieupoirier
authored andcommitted
remoteproc: k3-r5: Jump to error handling labels in start/stop errors
In case of errors during core start operation from sysfs, the driver directly returns with the -EPERM error code. Fix this to ensure that mailbox channels are freed on error before returning by jumping to the 'put_mbox' error handling label. Similarly, jump to the 'out' error handling label to return with required -EPERM error code during the core stop operation from sysfs. Fixes: 3c8a906 ("remoteproc: k3-r5: Do not allow core1 to power up before core0 via sysfs") Signed-off-by: Beleswar Padhi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
1 parent 47558cb commit 1dc7242

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/remoteproc/ti_k3_r5_remoteproc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,8 @@ static int k3_r5_rproc_start(struct rproc *rproc)
580580
if (core != core0 && core0->rproc->state == RPROC_OFFLINE) {
581581
dev_err(dev, "%s: can not start core 1 before core 0\n",
582582
__func__);
583-
return -EPERM;
583+
ret = -EPERM;
584+
goto put_mbox;
584585
}
585586

586587
ret = k3_r5_core_run(core);
@@ -648,7 +649,8 @@ static int k3_r5_rproc_stop(struct rproc *rproc)
648649
if (core != core1 && core1->rproc->state != RPROC_OFFLINE) {
649650
dev_err(dev, "%s: can not stop core 0 before core 1\n",
650651
__func__);
651-
return -EPERM;
652+
ret = -EPERM;
653+
goto out;
652654
}
653655

654656
ret = k3_r5_core_halt(core);

0 commit comments

Comments
 (0)