summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTanmay Shah <tanmay.shah@amd.com>2026-06-29 17:48:05 -0700
committerMathieu Poirier <mathieu.poirier@linaro.org>2026-07-06 11:21:36 -0600
commitd93ffd549fb4df18c934ca7a47d4128a18c718cb (patch)
tree140fa6d4fe868f992774582dbafd7cc8011e8c09
parent1f9ecae2ec6aa473825d713221d43bae72fcdfe9 (diff)
downloadlinux-d93ffd549fb4df18c934ca7a47d4128a18c718cb.tar.gz
linux-d93ffd549fb4df18c934ca7a47d4128a18c718cb.zip
remoteproc: core: Full attach detach during recovery
Current attach on recovery mechanism loads the clean resource table during recovery, but doesn't re-allocate the resources. RPMsg communication will fail after recovery due to this. Fix this incorrect behavior by doing the full detach and attach of remote processor during the recovery. This will load the clean resource table and re-allocate all the resources, which will set up correct vring information in the resource table. Signed-off-by: Tanmay Shah <tanmay.shah@amd.com> Link: https://lore.kernel.org/r/20260630004806.3835488-2-tanmay.shah@amd.com Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
-rw-r--r--drivers/remoteproc/remoteproc_core.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index f003be006b1b..8393468fa1ee 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1776,7 +1776,20 @@ static int rproc_attach_recovery(struct rproc *rproc)
if (ret)
return ret;
- return __rproc_attach(rproc);
+ /* clean up all acquired resources */
+ rproc_resource_cleanup(rproc);
+
+ /* release HW resources if needed */
+ rproc_unprepare_device(rproc);
+
+ rproc_disable_iommu(rproc);
+
+ /* Free the copy of the resource table */
+ kfree(rproc->cached_table);
+ rproc->cached_table = NULL;
+ rproc->table_ptr = NULL;
+
+ return rproc_attach(rproc);
}
static int rproc_boot_recovery(struct rproc *rproc)