public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] remoteproc: k3-r5: Fix error handling when power-up failed
@ 2024-08-19 15:24 Jan Kiszka
  2024-08-21  5:30 ` Beleswar Prasad Padhi
  0 siblings, 1 reply; 8+ messages in thread
From: Jan Kiszka @ 2024-08-19 15:24 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, linux-remoteproc
  Cc: Linux Kernel Mailing List, Apurva Nandan, Beleswar Padhi,
	stable@vger.kernel.org, Nishanth Menon

From: Jan Kiszka <jan.kiszka@siemens.com>

By simply bailing out, the driver was violating its rule and internal
assumptions that either both or no rproc should be initialized. E.g.,
this could cause the first core to be available but not the second one,
leading to crashes on its shutdown later on while trying to dereference
that second instance.

Fixes: 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 drivers/remoteproc/ti_k3_r5_remoteproc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/remoteproc/ti_k3_r5_remoteproc.c b/drivers/remoteproc/ti_k3_r5_remoteproc.c
index 39a47540c590..eb09d2e9b32a 100644
--- a/drivers/remoteproc/ti_k3_r5_remoteproc.c
+++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c
@@ -1332,7 +1332,7 @@ static int k3_r5_cluster_rproc_init(struct platform_device *pdev)
 			dev_err(dev,
 				"Timed out waiting for %s core to power up!\n",
 				rproc->name);
-			return ret;
+			goto err_powerup;
 		}
 	}
 
@@ -1348,6 +1348,7 @@ static int k3_r5_cluster_rproc_init(struct platform_device *pdev)
 		}
 	}
 
+err_powerup:
 	rproc_del(rproc);
 err_add:
 	k3_r5_reserved_mem_exit(kproc);
-- 
2.43.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-08-28 16:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-19 15:24 [PATCH] remoteproc: k3-r5: Fix error handling when power-up failed Jan Kiszka
2024-08-21  5:30 ` Beleswar Prasad Padhi
2024-08-21 18:10   ` Jan Kiszka
2024-08-22  5:22     ` Beleswar Prasad Padhi
2024-08-22  5:27       ` Jan Kiszka
2024-08-22  5:42         ` Beleswar Prasad Padhi
2024-08-22  5:47           ` Jan Kiszka
2024-08-28 16:01       ` Mathieu Poirier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox