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>
This commit is contained in:
Tanmay Shah 2026-06-29 17:48:05 -07:00 committed by Mathieu Poirier
parent 1f9ecae2ec
commit d93ffd549f

View File

@ -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)