summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeleswar Padhi <b-padhi@ti.com>2025-05-13 11:14:38 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-27 11:11:24 +0100
commit30b031c0bd4fe7e7f52cdd1835e504e7947360f7 (patch)
tree3fec57009a5b4e75573c1812279d12eaeac79db9
parentf4ef928ca504c996f9222eb2c59ac6d6eefd9c75 (diff)
remoteproc: k3-m4: Don't assert reset in detach routine
commit 23532524594c211871054a15c425812a4ac35102 upstream. The rproc_detach() function invokes __rproc_detach() before rproc_unprepare_device(). The __rproc_detach() function sets the rproc->state to "RPROC_DETACHED". However, the TI K3 M4 driver erroneously looks for "RPROC_ATTACHED" state in its .unprepare ops to identify IPC-only mode; which leads to resetting the rproc in detach routine. Therefore, correct the IPC-only mode detection logic to look for "RPROC_DETACHED" in k3_m4_rproc_unprepare() function. Fixes: ebcf9008a895 ("remoteproc: k3-m4: Add a remoteproc driver for M4F subsystem") Signed-off-by: Beleswar Padhi <b-padhi@ti.com> Reviewed-by: Hari Nagalla <hnagalla@ti.com> Reviewed-by: Martyn Welch <martyn.welch@collabora.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20250513054510.3439842-5-b-padhi@ti.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/remoteproc/ti_k3_m4_remoteproc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/remoteproc/ti_k3_m4_remoteproc.c b/drivers/remoteproc/ti_k3_m4_remoteproc.c
index 09f0484a90e1..fba6e393635e 100644
--- a/drivers/remoteproc/ti_k3_m4_remoteproc.c
+++ b/drivers/remoteproc/ti_k3_m4_remoteproc.c
@@ -228,7 +228,7 @@ static int k3_m4_rproc_unprepare(struct rproc *rproc)
int ret;
/* If the core is going to be detached do not assert the module reset */
- if (rproc->state == RPROC_ATTACHED)
+ if (rproc->state == RPROC_DETACHED)
return 0;
ret = kproc->ti_sci->ops.dev_ops.put_device(kproc->ti_sci,