Skip to contentSkip to conversation

remoteproc: k3-r5: Delay notification of wakeup event

PATCH Superseded Beleswar Padhi 2 participants 2 messages Aug 9, 2024 – Aug 19, 2024 Remote processor (remoteproc)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remoteproc: k3-r5: Delay notification of wakeup event

From: Udit Kumar <[email protected]>

Few times, core1 was scheduled to boot first before core0, which leads to error:

'k3_r5_rproc_start: can not start core 1 before core 0'.

This was happening due to some scheduling between prepare and start callback. The probe function waits for event, which is getting triggered by prepare callback. To avoid above condition move event trigger to start instead of prepare callback.

Fixes 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1")
[ Applied wakeup event trigger only for Split-Mode booted rprocs ]
---
 drivers/remoteproc/ti_k3_r5_remoteproc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/remoteproc/ti_k3_r5_remoteproc.c +3 -2
index 39a47540c590..f1710a61247f 100644
@@ -464,8 +464,6 @@ static int k3_r5_rproc_prepare(struct rproc *rproc)
 			ret);
 		return ret;
 	}
-	core->released_from_reset = true;
-	wake_up_interruptible(&cluster->core_transition);
 
 	/*
 	 * Newer IP revisions like on J7200 SoCs support h/w auto-initialization
@@ -587,6 +585,9 @@ static int k3_r5_rproc_start(struct rproc *rproc)
 		ret = k3_r5_core_run(core);
 		if (ret)
 			goto put_mbox;
+
+		core->released_from_reset = true;
+		wake_up_interruptible(&cluster->core_transition);
 	}
 
 	return 0;
Signature · 1 line
2.34.1
maintainer
#1 lore raw
Quoted 11 lines · Beleswar Padhi

From: Udit Kumar <[email protected]>

Few times, core1 was scheduled to boot first before core0, which leads to error:

'k3_r5_rproc_start: can not start core 1 before core 0'.

This was happening due to some scheduling between prepare and start callback. The probe function waits for event, which is getting triggered by prepare callback. To avoid above condition move event trigger to start instead of prepare callback.

I can see the race condition.

Quoted 23 lines
Fixes 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1")
[ Applied wakeup event trigger only for Split-Mode booted rprocs ]
---
 drivers/remoteproc/ti_k3_r5_remoteproc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/remoteproc/ti_k3_r5_remoteproc.c +0 -2
index 39a47540c590..f1710a61247f 100644
@@ -464,8 +464,6 @@ static int k3_r5_rproc_prepare(struct rproc *rproc)
 			ret);
 		return ret;
 	}
-	core->released_from_reset = true;
-	wake_up_interruptible(&cluster->core_transition);
 
 	/*
 	 * Newer IP revisions like on J7200 SoCs support h/w auto-initialization

drivers/remoteproc/ti_k3_r5_remoteproc.c static int k3_r5_rproc_start(struct rproc *rproc) · line 590

Quoted 6 lines
drivers/remoteproc/ti_k3_r5_remoteproc.c +3 -0
@@ -587,6 +585,9 @@ static int k3_r5_rproc_start(struct rproc *rproc)
 		ret = k3_r5_core_run(core);
 		if (ret)
 			goto put_mbox;
+
+		core->released_from_reset = true;
+		wake_up_interruptible(&cluster->core_transition);

This patch doesn't apply due to recent changes made to the k3-r5 driver. Please rebase and resubmit.

Thanks,
Mathieu

Quoted 6 lines
drivers/remoteproc/ti_k3_r5_remoteproc.c +0 -0
 	}
 
 	return 0;
Signature · 1 line
2.34.1