Skip to contentSkip to conversation

Rework TI K3 R5F remoteproc driver

PATCH New Beleswar Padhi 1 participant 4 messages Jan 8, 2025 Remote processor (remoteproc)

lore
Share & tools
lore
#0 lore raw

v2 cover Rework TI K3 R5F remoteproc driver

This series cleans up the TI R5F remoteproc driver by addressing various bugs. This is also the second series as part of the refactoring of K3 remoteproc drivers[0]. The third and final series for K3 Refactoring is also posted[1] which deals with the TI DSP and TI M4 drivers. The R5F driver takes care of configuring dual core R5Fs in Lockstep/Split mode and therefore has worked out separate data structures & reset logic than the DSP/M4 drivers which deal with single core CPUs. Therefore, I have excluded R5F driver from the common refactoring in the final series[1].

NOTE:
This series is _dependent_ upon the below series which does devm_ cleanup [Now merged in rproc-next/linux-next].
https://lore.kernel.org/all/[email protected]/

Bugs fixed in this series:
1. Fixed IPC-Only mode attach for R5F cores. PATCH #1
2. Fixed IPC-Only mode attach for DSP cores. (Included in this series, as this was related to point 1 and fix is similar) PATCH #2
3. Fixed support to load firmware from userspace by refactoring wait mechanism logic into prepare()/start() ops. PATCH #3

Testing Done:
1. Tested boot of R5F remoteprocs in MCU and MAIN voltage domain in both IPC-Only mode and Kernel remoteproc mode in all Jacinto K3 (j7*) devices.
2. Tested Lockstep, Split and Single-CPU Mode configuration (wherever applicable) of R5F remoteprocs in all Jacinto K3 (j7*) devices.
3. Tested shutdown of R5F remoteprocs from Linux userspace and also by executing modprobe -r ti_k3_r5_remoteproc.
4. Tested usecases where firmware not available at Kernel boot time, but later in sysfs, able to load firmware into a remotecore and start it.
5. Tested that each patch in this series generates no new warnings/errors.
Exception: Using the "wait_event_interruptible_timeout" macro in PATCH #3 raises a -Wshadow warning, which is expected as it is called out in the implementation of the macro itself[2].

v2: Changelog:
1. Changed variable name "is_attach_ongoing" to "is_attached" in PATCH #1 and PATCH #2. [Udit]
2. Triggered wakeup event signal only for core0 in .prepare(), and only for core1 in .unprepare() in PATCH #3. [Udit]
3. Carried Reviewed-by tags from v1 of the series.

Link to v1:
https://lore.kernel.org/all/[email protected]/

Thanks,
Beleswar

[0]: https://lore.kernel.org/all/[email protected]/
[1]: https://lore.kernel.org/all/[email protected]/
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/include/linux/wait.h#n289

Beleswar Padhi (3):
remoteproc: k3-r5: Fix checks in k3_r5_rproc_{mbox_callback/kick}
remoteproc: k3-dsp: Fix checks in k3_dsp_rproc_{mbox_callback/kick}
remoteproc: k3-r5: Refactor sequential core power up/down operations

 drivers/remoteproc/ti_k3_dsp_remoteproc.c |  63 ++++++--
 drivers/remoteproc/ti_k3_r5_remoteproc.c  | 179 ++++++++++++++--------
 2 files changed, 161 insertions(+), 81 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 1/3 remoteproc: k3-r5: Fix checks in k3_r5_rproc_{mbox_callback/kick}

Commit f3f11cfe8907 ("remoteproc: k3-r5: Acquire mailbox handle during probe routine") introduced a check in the "k3_r5_rproc_mbox_callback()" and "k3_r5_rproc_kick()" callbacks to exit if the remote core's state was "RPROC_DETACHED". However, this caused issues in IPC-only mode, as the default state of the core is set to "RPROC_DETACHED", and the transition to "RPROC_ATTACHED" happens only after the "__rproc_attach()" function has invoked "rproc_start_subdevices()".

The "rproc_start_subdevices()" function triggers the probe of Virtio RPMsg subdevices, which require the mailbox callbacks to be functional. To resolve this, a new variable, "is_attached", is introduced to distinguish between core states: when a core is actually detached and when it is in the process of being attached. The callbacks are updated to return early only if the core is actually detached and not during an ongoing attach operation in IPC-only mode.

Fixes f3f11cfe8907 ("remoteproc: k3-r5: Acquire mailbox handle during probe routine")

---
Link to v1:
https://lore.kernel.org/all/[email protected]/

v2: Changelog:
1. Changed variable name "is_attached_ongoing" to "is_attached". [Udit]
2. Improved comments.
3. Carried R/B tag from V1.

Link to RFC version:
https://lore.kernel.org/all/[email protected]/

Improvements in v1:
1. Ensured these mbox callbacks are functional when the core is in the proccess of getting attached in IPC-Only mode.
2. Ensured these mbox callbacks are _not_ functional when the core state is actually detached.

 drivers/remoteproc/ti_k3_r5_remoteproc.c | 63 ++++++++++++++++++------
 1 file changed, 49 insertions(+), 14 deletions(-)
drivers/remoteproc/ti_k3_r5_remoteproc.c +49 -14
index dbc513c5569c..d92c8e4dfcf6 100644
@@ -131,6 +131,7 @@ struct k3_r5_cluster {
  * @btcm_enable: flag to control BTCM enablement
  * @loczrama: flag to dictate which TCM is at device address 0x0
  * @released_from_reset: flag to signal when core is out of reset
+ * @is_attached: Indicates whether core is attached from the k3-r5 driver's POV.
  */
 struct k3_r5_core {
 	struct list_head elem;
@@ -148,6 +149,7 @@ struct k3_r5_core {
 	u32 btcm_enable;
 	u32 loczrama;
 	bool released_from_reset;
+	bool is_attached;
 };
 
 /**
@@ -194,8 +196,16 @@ static void k3_r5_rproc_mbox_callback(struct mbox_client *client, void *data)
 	const char *name = kproc->rproc->name;
 	u32 msg = omap_mbox_message(data);
 
-	/* Do not forward message from a detached core */
-	if (kproc->rproc->state == RPROC_DETACHED)
+	/*
+	 * Do not forward messages from a detached core, except when the core
+	 * is transitioning to the attached state in IPC-only mode.
+	 *
+	 * In IPC-only mode, the default rproc state is "RPROC_DETACHED." To
+	 * distinguish between an actually detached core and one in transition,
+	 * use the "is_attached" flag, which is set once the driver's internal
+	 * attach() operations start.
+	 */
+	if (!kproc->core->is_attached && kproc->rproc->state == RPROC_DETACHED)
 		return;
 
 	dev_dbg(dev, "mbox msg: 0x%x\n", msg);
@@ -233,8 +243,16 @@ static void k3_r5_rproc_kick(struct rproc *rproc, int vqid)
 	mbox_msg_t msg = (mbox_msg_t)vqid;
 	int ret;
 
-	/* Do not forward message to a detached core */
-	if (kproc->rproc->state == RPROC_DETACHED)
+	/*
+	 * Do not forward messages to a detached core, except when the core
+	 * is transitioning to the attached state in IPC-only mode.
+	 *
+	 * In IPC-only mode, the default rproc state is "RPROC_DETACHED." To
+	 * distinguish between an actually detached core and one in transition,
+	 * use the "is_attached" flag, which is set once the driver's internal
+	 * attach() operations start.
+	 */
+	if (!kproc->core->is_attached && kproc->rproc->state == RPROC_DETACHED)
 		return;
 
 	/* send the index of the triggered virtqueue in the mailbox payload */
@@ -671,22 +689,39 @@ static int k3_r5_rproc_stop(struct rproc *rproc)
 /*
  * Attach to a running R5F remote processor (IPC-only mode)
  *
- * The R5F attach callback is a NOP. The remote processor is already booted, and
- * all required resources have been acquired during probe routine, so there is
- * no need to issue any TI-SCI commands to boot the R5F cores in IPC-only mode.
- * This callback is invoked only in IPC-only mode and exists because
- * rproc_validate() checks for its existence.
+ * The R5F attach callback only needs to set the "is_attached" flag to
+ * notify k3_r5_rproc_{kick/mbox_callback} functions that the core is attached
+ * from the k3-r5 driver's POV. The remote processor is already booted, and all
+ * required resources have been acquired during probe routine, so there is no
+ * need to issue any TI-SCI commands to boot the R5F cores in IPC-only mode.
+ * This callback is invoked only in IPC-only mode.
  */
-static int k3_r5_rproc_attach(struct rproc *rproc) { return 0; }
+static int k3_r5_rproc_attach(struct rproc *rproc)
+{
+	struct k3_r5_rproc *kproc = rproc->priv;
+
+	kproc->core->is_attached = true;
+
+	return 0;
+}
 
 /*
  * Detach from a running R5F remote processor (IPC-only mode)
  *
- * The R5F detach callback is a NOP. The R5F cores are not stopped and will be
- * left in booted state in IPC-only mode. This callback is invoked only in
- * IPC-only mode and exists for sanity sake.
+ * The R5F detach callback performs the opposite operation to attach callback
+ * and only needs to clear the "is_attached" flag to ensure no mailbox
+ * messages are sent to or received from a detached core. The R5F cores are
+ * not stopped and will be left in booted state in IPC-only mode. This
+ * callback is invoked only in IPC-only mode.
  */
-static int k3_r5_rproc_detach(struct rproc *rproc) { return 0; }
+static int k3_r5_rproc_detach(struct rproc *rproc)
+{
+	struct k3_r5_rproc *kproc = rproc->priv;
+
+	kproc->core->is_attached = false;
+
+	return 0;
+}
 
 /*
  * This function implements the .get_loaded_rsc_table() callback and is used
Signature · 1 line
2.34.1
#2 lore raw

PATCH v2 2/3 remoteproc: k3-dsp: Fix checks in k3_dsp_rproc_{mbox_callback/kick}

In reply to Beleswar Padhi

Commit ea1d6fb5b571 ("remoteproc: k3-dsp: Acquire mailbox handle during probe routine") introduced a check in the "k3_dsp_rproc_mbox_callback()" and "k3_dsp_rproc_kick()" callbacks to exit if the remote core's state was "RPROC_DETACHED". However, this caused issues in IPC-only mode, as the default state of the core is set to "RPROC_DETACHED", and the transition to "RPROC_ATTACHED" happens only after the "__rproc_attach()" function has invoked "rproc_start_subdevices()".

The "rproc_start_subdevices()" function triggers the probe of Virtio RPMsg subdevices, which require the mailbox callbacks to be functional. To resolve this, a new variable, "is_attached", is introduced to distinguish between core states: when a core is actually detached and when it is in the process of being attached. The callbacks are updated to return early only if the core is actually detached and not during an ongoing attach operation in IPC-only mode.

Fixes ea1d6fb5b571 ("remoteproc: k3-dsp: Acquire mailbox handle during probe routine")

---
Link to v1:
https://lore.kernel.org/all/[email protected]/

v2: Changelog:
1. Changed variable name "is_attached_ongoing" to "is_attached". [Udit]
2. Improved comments.
3. Carried R/B tag from V1.

Link to RFC version:
https://lore.kernel.org/all/[email protected]/

Improvements in v1:
1. Ensured these mbox callbacks are functional when the core is in the proccess of getting attached in IPC-Only mode.
2. Ensured these mbox callbacks are _not_ functional when the core state is actually detached.

 drivers/remoteproc/ti_k3_dsp_remoteproc.c | 63 ++++++++++++++++++-----
 1 file changed, 49 insertions(+), 14 deletions(-)
drivers/remoteproc/ti_k3_dsp_remoteproc.c +49 -14
index a695890254ff..718d07f0180e 100644
@@ -76,6 +76,7 @@ struct k3_dsp_dev_data {
  * @ti_sci_id: TI-SCI device identifier
  * @mbox: mailbox channel handle
  * @client: mailbox client to request the mailbox channel
+ * @is_attached: Indicates whether core is attached from the k3-dsp driver's POV
  */
 struct k3_dsp_rproc {
 	struct device *dev;
@@ -91,6 +92,7 @@ struct k3_dsp_rproc {
 	u32 ti_sci_id;
 	struct mbox_chan *mbox;
 	struct mbox_client client;
+	bool is_attached;
 };
 
 /**
@@ -115,8 +117,16 @@ static void k3_dsp_rproc_mbox_callback(struct mbox_client *client, void *data)
 	const char *name = kproc->rproc->name;
 	u32 msg = omap_mbox_message(data);
 
-	/* Do not forward messages from a detached core */
-	if (kproc->rproc->state == RPROC_DETACHED)
+	/*
+	 * Do not forward messages from a detached core, except when the core
+	 * is transitioning to the attached state in IPC-only mode.
+	 *
+	 * In IPC-only mode, the default rproc state is "RPROC_DETACHED." To
+	 * distinguish between an actually detached core and one in transition,
+	 * use the "is_attached" flag, which is set once the driver's internal
+	 * attach() operations start.
+	 */
+	if (!kproc->is_attached && kproc->rproc->state == RPROC_DETACHED)
 		return;
 
 	dev_dbg(dev, "mbox msg: 0x%x\n", msg);
@@ -159,8 +169,16 @@ static void k3_dsp_rproc_kick(struct rproc *rproc, int vqid)
 	mbox_msg_t msg = (mbox_msg_t)vqid;
 	int ret;
 
-	/* Do not forward messages to a detached core */
-	if (kproc->rproc->state == RPROC_DETACHED)
+	/*
+	 * Do not forward messages to a detached core, except when the core
+	 * is transitioning to the attached state in IPC-only mode.
+	 *
+	 * In IPC-only mode, the default rproc state is "RPROC_DETACHED." To
+	 * distinguish between an actually detached core and one in transition,
+	 * use the "is_attached" flag, which is set once the driver's internal
+	 * attach() operations start.
+	 */
+	if (!kproc->is_attached && kproc->rproc->state == RPROC_DETACHED)
 		return;
 
 	/* send the index of the triggered virtqueue in the mailbox payload */
@@ -357,22 +375,39 @@ static int k3_dsp_rproc_stop(struct rproc *rproc)
 /*
  * Attach to a running DSP remote processor (IPC-only mode)
  *
- * This rproc attach callback is a NOP. The remote processor is already booted,
- * and all required resources have been acquired during probe routine, so there
- * is no need to issue any TI-SCI commands to boot the DSP core. This callback
- * is invoked only in IPC-only mode and exists because rproc_validate() checks
- * for its existence.
+ * This rproc attach callback only needs to set the "is_attached" flag to
+ * notify k3_dsp_rproc_{kick/mbox_callback} functions that the core is attached
+ * from the k3-dsp driver's POV. The remote processor is already booted, and all
+ * required resources have been acquired during probe routine, so there is no
+ * need to issue any TI-SCI commands to boot the DSP core. This callback is
+ * invoked only in IPC-only mode.
  */
-static int k3_dsp_rproc_attach(struct rproc *rproc) { return 0; }
+static int k3_dsp_rproc_attach(struct rproc *rproc)
+{
+	struct k3_dsp_rproc *kproc = rproc->priv;
+
+	kproc->is_attached = true;
+
+	return 0;
+}
 
 /*
  * Detach from a running DSP remote processor (IPC-only mode)
  *
- * This rproc detach callback is a NOP. The DSP core is not stopped and will be
- * left to continue to run its booted firmware. This callback is invoked only in
- * IPC-only mode and exists for sanity sake.
+ * This rproc detach callback performs the opposite operation to attach callback
+ * and only needs to clear the "is_attached" flag to ensure no mailbox
+ * messages are sent to or received from a detached core. The DSP core is not
+ * stopped and will be left to continue to run its booted firmware. This callback
+ * is invoked only in IPC-only mode.
  */
-static int k3_dsp_rproc_detach(struct rproc *rproc) { return 0; }
+static int k3_dsp_rproc_detach(struct rproc *rproc)
+{
+	struct k3_dsp_rproc *kproc = rproc->priv;
+
+	kproc->is_attached = false;
+
+	return 0;
+}
 
 /*
  * This function implements the .get_loaded_rsc_table() callback and is used
Signature · 1 line
2.34.1
#3 lore raw

PATCH v3 3/3 remoteproc: k3-r5: Refactor sequential core power up/down operations

In reply to Beleswar Padhi

The existing implementation of the waiting mechanism in "k3_r5_cluster_rproc_init()" waits for the "released_from_reset" flag to be set as part of the firmware boot process in "k3_r5_rproc_start()". The "k3_r5_cluster_rproc_init()" function is invoked in the probe routine which causes unexpected failures in cases where the firmware is unavailable at boot time, resulting in probe failure and removal of the remoteproc handles in the sysfs paths.

To address this, the waiting mechanism is refactored out of the probe routine into the appropriate "k3_r5_rproc_{prepare/unprepare}()" functions. This allows the probe routine to complete without depending on firmware booting, while still maintaining the required power-synchronization between cores.

Further, this wait mechanism is dropped from "k3_r5_rproc_{start/stop}()" functions as they deal with Core Run/Halt operations, and as such, there is no constraint in Running or Halting the cores of a cluster in order.

Fixes 61f6f68447ab ("remoteproc: k3-r5: Wait for core0 power-up before powering up core1")

---
Link to v2:
https://lore.kernel.org/all/[email protected]/

v3: Changelog:
1. Triggered wakeup event signal only for core0 in .prepare() ops, and for core1 in .unprepare() ops. [Udit]

Link to v1:
https://lore.kernel.org/all/[email protected]/

v2: Changelog:
1. Improved commit message to call out functions correctly. [Mathieu]
2. Removed sequential wait/checks from .start()/.stop() ops as there is no constraint for Core Run/Halt operations.

 drivers/remoteproc/ti_k3_r5_remoteproc.c | 116 ++++++++++++-----------
 1 file changed, 63 insertions(+), 53 deletions(-)
drivers/remoteproc/ti_k3_r5_remoteproc.c +63 -53
index d92c8e4dfcf6..90efa1df8ac7 100644
@@ -466,13 +466,36 @@ static int k3_r5_rproc_prepare(struct rproc *rproc)
 {
 	struct k3_r5_rproc *kproc = rproc->priv;
 	struct k3_r5_cluster *cluster = kproc->cluster;
-	struct k3_r5_core *core = kproc->core;
+	struct k3_r5_core *core = kproc->core, *core0, *core1;
 	struct device *dev = kproc->dev;
 	u32 ctrl = 0, cfg = 0, stat = 0;
 	u64 boot_vec = 0;
 	bool mem_init_dis;
 	int ret;
 
+	/*
+	 * R5 cores require to be powered on sequentially, core0 should be in
+	 * higher power state than core1 in a cluster. So, wait for core0 to
+	 * power up before proceeding to core1 and put timeout of 2sec. This
+	 * waiting mechanism is necessary because rproc_auto_boot_callback() for
+	 * core1 can be called before core0 due to thread execution order.
+	 *
+	 * By placing the wait mechanism here in .prepare() ops, this condition
+	 * is enforced for rproc boot requests from sysfs as well.
+	 */
+	core0 = list_first_entry(&cluster->cores, struct k3_r5_core, elem);
+	core1 = list_last_entry(&cluster->cores, struct k3_r5_core, elem);
+	if (cluster->mode == CLUSTER_MODE_SPLIT && core == core1 &&
+	    !core0->released_from_reset) {
+		ret = wait_event_interruptible_timeout(cluster->core_transition,
+						       core0->released_from_reset,
+						       msecs_to_jiffies(2000));
+		if (ret <= 0) {
+			dev_err(dev, "can not power up core1 before core0");
+			return -EPERM;
+		}
+	}
+
 	ret = ti_sci_proc_get_status(core->tsp, &boot_vec, &cfg, &ctrl, &stat);
 	if (ret < 0)
 		return ret;
@@ -488,6 +511,14 @@ static int k3_r5_rproc_prepare(struct rproc *rproc)
 		return ret;
 	}
 
+	/*
+	 * Notify all threads in the wait queue when core0 state has changed so
+	 * that threads waiting for this condition can be executed.
+	 */
+	core->released_from_reset = true;
+	if (core == core0)
+		wake_up_interruptible(&cluster->core_transition);
+
 	/*
 	 * Newer IP revisions like on J7200 SoCs support h/w auto-initialization
 	 * of TCMs, so there is no need to perform the s/w memzero. This bit is
@@ -533,10 +564,30 @@ static int k3_r5_rproc_unprepare(struct rproc *rproc)
 {
 	struct k3_r5_rproc *kproc = rproc->priv;
 	struct k3_r5_cluster *cluster = kproc->cluster;
-	struct k3_r5_core *core = kproc->core;
+	struct k3_r5_core *core = kproc->core, *core0, *core1;
 	struct device *dev = kproc->dev;
 	int ret;
 
+	/*
+	 * Ensure power-down of cores is sequential in split mode. Core1 must
+	 * power down before Core0 to maintain the expected state. By placing
+	 * the wait mechanism here in .unprepare() ops, this condition is
+	 * enforced for rproc stop or shutdown requests from sysfs and device
+	 * removal as well.
+	 */
+	core0 = list_first_entry(&cluster->cores, struct k3_r5_core, elem);
+	core1 = list_last_entry(&cluster->cores, struct k3_r5_core, elem);
+	if (cluster->mode == CLUSTER_MODE_SPLIT && core == core0 &&
+	    core1->released_from_reset) {
+		ret = wait_event_interruptible_timeout(cluster->core_transition,
+						       !core1->released_from_reset,
+						       msecs_to_jiffies(2000));
+		if (ret <= 0) {
+			dev_err(dev, "can not power down core0 before core1");
+			return -EPERM;
+		}
+	}
+
 	/* Re-use LockStep-mode reset logic for Single-CPU mode */
 	ret = (cluster->mode == CLUSTER_MODE_LOCKSTEP ||
 	       cluster->mode == CLUSTER_MODE_SINGLECPU) ?
@@ -544,6 +595,14 @@ static int k3_r5_rproc_unprepare(struct rproc *rproc)
 	if (ret)
 		dev_err(dev, "unable to disable cores, ret = %d\n", ret);
 
+	/*
+	 * Notify all threads in the wait queue when core1 state has changed so
+	 * that threads waiting for this condition can be executed.
+	 */
+	core->released_from_reset = false;
+	if (core == core1)
+		wake_up_interruptible(&cluster->core_transition);
+
 	return ret;
 }
 
@@ -569,7 +628,7 @@ static int k3_r5_rproc_start(struct rproc *rproc)
 	struct k3_r5_rproc *kproc = rproc->priv;
 	struct k3_r5_cluster *cluster = kproc->cluster;
 	struct device *dev = kproc->dev;
-	struct k3_r5_core *core0, *core;
+	struct k3_r5_core *core;
 	u32 boot_addr;
 	int ret;
 
@@ -591,21 +650,9 @@ static int k3_r5_rproc_start(struct rproc *rproc)
 				goto unroll_core_run;
 		}
 	} else {
-		/* do not allow core 1 to start before core 0 */
-		core0 = list_first_entry(&cluster->cores, struct k3_r5_core,
-					 elem);
-		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 = k3_r5_core_run(core);
 		if (ret)
 			return ret;
-
-		core->released_from_reset = true;
-		wake_up_interruptible(&cluster->core_transition);
 	}
 
 	return 0;
@@ -646,8 +693,7 @@ static int k3_r5_rproc_stop(struct rproc *rproc)
 {
 	struct k3_r5_rproc *kproc = rproc->priv;
 	struct k3_r5_cluster *cluster = kproc->cluster;
-	struct device *dev = kproc->dev;
-	struct k3_r5_core *core1, *core = kproc->core;
+	struct k3_r5_core *core = kproc->core;
 	int ret;
 
 	/* halt all applicable cores */
@@ -660,16 +706,6 @@ static int k3_r5_rproc_stop(struct rproc *rproc)
 			}
 		}
 	} else {
-		/* do not allow core 0 to stop before core 1 */
-		core1 = list_last_entry(&cluster->cores, struct k3_r5_core,
-					elem);
-		if (core != core1 && core1->rproc->state != RPROC_OFFLINE) {
-			dev_err(dev, "%s: can not stop core 0 before core 1\n",
-				__func__);
-			ret = -EPERM;
-			goto out;
-		}
-
 		ret = k3_r5_core_halt(core);
 		if (ret)
 			goto out;
@@ -1164,12 +1200,6 @@ static int k3_r5_rproc_configure_mode(struct k3_r5_rproc *kproc)
 		return reset_ctrl_status;
 	}
 
-	/*
-	 * Skip the waiting mechanism for sequential power-on of cores if the
-	 * core has already been booted by another entity.
-	 */
-	core->released_from_reset = c_state;
-
 	ret = ti_sci_proc_get_status(core->tsp, &boot_vec, &cfg, &ctrl,
 				     &stat);
 	if (ret < 0) {
@@ -1314,26 +1344,6 @@ static int k3_r5_cluster_rproc_init(struct platform_device *pdev)
 		    cluster->mode == CLUSTER_MODE_SINGLECPU ||
 		    cluster->mode == CLUSTER_MODE_SINGLECORE)
 			break;
-
-		/*
-		 * R5 cores require to be powered on sequentially, core0
-		 * should be in higher power state than core1 in a cluster
-		 * So, wait for current core to power up before proceeding
-		 * to next core and put timeout of 2sec for each core.
-		 *
-		 * This waiting mechanism is necessary because
-		 * rproc_auto_boot_callback() for core1 can be called before
-		 * core0 due to thread execution order.
-		 */
-		ret = wait_event_interruptible_timeout(cluster->core_transition,
-						       core->released_from_reset,
-						       msecs_to_jiffies(2000));
-		if (ret <= 0) {
-			dev_err(dev,
-				"Timed out waiting for %s core to power up!\n",
-				rproc->name);
-			goto out;
-		}
 	}
 
 	return 0;
Signature · 1 line
2.34.1