From 33caeaafc5a2bb3e6a914d7bd844d45cdaa4c9ae Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 19 Jun 2024 13:19:00 +0200 Subject: [PATCH] 5.10-stable patches added patches: remoteproc-k3-r5-jump-to-error-handling-labels-in-start-stop-errors.patch --- ...handling-labels-in-start-stop-errors.patch | 47 +++++++++++++++++++ queue-5.10/series | 1 + 2 files changed, 48 insertions(+) create mode 100644 queue-5.10/remoteproc-k3-r5-jump-to-error-handling-labels-in-start-stop-errors.patch diff --git a/queue-5.10/remoteproc-k3-r5-jump-to-error-handling-labels-in-start-stop-errors.patch b/queue-5.10/remoteproc-k3-r5-jump-to-error-handling-labels-in-start-stop-errors.patch new file mode 100644 index 00000000000..b9c6264b879 --- /dev/null +++ b/queue-5.10/remoteproc-k3-r5-jump-to-error-handling-labels-in-start-stop-errors.patch @@ -0,0 +1,47 @@ +From 1dc7242f6ee0c99852cb90676d7fe201cf5de422 Mon Sep 17 00:00:00 2001 +From: Beleswar Padhi +Date: Mon, 6 May 2024 19:48:49 +0530 +Subject: remoteproc: k3-r5: Jump to error handling labels in start/stop errors + +From: Beleswar Padhi + +commit 1dc7242f6ee0c99852cb90676d7fe201cf5de422 upstream. + +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: 3c8a9066d584 ("remoteproc: k3-r5: Do not allow core1 to power up before core0 via sysfs") +Signed-off-by: Beleswar Padhi +Link: https://lore.kernel.org/r/20240506141849.1735679-1-b-padhi@ti.com +Signed-off-by: Mathieu Poirier +Signed-off-by: Greg Kroah-Hartman +--- + drivers/remoteproc/ti_k3_r5_remoteproc.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/remoteproc/ti_k3_r5_remoteproc.c ++++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c +@@ -484,7 +484,8 @@ static int k3_r5_rproc_start(struct rpro + if (core != core0 && core0->rproc->state == RPROC_OFFLINE) { + dev_err(dev, "%s: can not start core 1 before core 0\n", + __func__); +- return -EPERM; ++ ret = -EPERM; ++ goto put_mbox; + } + + ret = k3_r5_core_run(core); +@@ -547,7 +548,8 @@ static int k3_r5_rproc_stop(struct rproc + if (core != core1 && core1->rproc->state != RPROC_OFFLINE) { + dev_err(dev, "%s: can not stop core 0 before core 1\n", + __func__); +- return -EPERM; ++ ret = -EPERM; ++ goto out; + } + + ret = k3_r5_core_halt(core); diff --git a/queue-5.10/series b/queue-5.10/series index c1ddfb668c3..90ce8f37223 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -126,3 +126,4 @@ hugetlb_encode.h-fix-undefined-behaviour-34-26.patch mptcp-ensure-snd_una-is-properly-initialized-on-connect.patch mptcp-pm-inc-rmaddr-mib-counter-once-per-rm_addr-id.patch mptcp-pm-update-add_addr-counters-after-connect.patch +remoteproc-k3-r5-jump-to-error-handling-labels-in-start-stop-errors.patch -- 2.47.3