From: Tanmay Shah <tanmay.shah@amd.com>
To: <andersson@kernel.org>, <mathieu.poirier@linaro.org>
Cc: <linux-remoteproc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, Tanmay Shah <tanmay.shah@amd.com>
Subject: [PATCH v4 1/2] remoteproc: core: full attach detach during recovery
Date: Tue, 3 Mar 2026 15:35:32 -0800 [thread overview]
Message-ID: <20260303233533.2310513-2-tanmay.shah@amd.com> (raw)
In-Reply-To: <20260303233533.2310513-1-tanmay.shah@amd.com>
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>
---
Changes in v4:
- move pieces needed from rproc_detach() to rproc_attach_recovery() to
cleanup the resources
- use rproc_attach() over __rproc_attach() to create resources again
- keep rproc_trigger_recovery() unmodified
Changes in v3:
- both rproc_attach_recovery() and
rproc_boot_recovery() are called the same way.
- remove unrelated changes
Changes in v2:
- use rproc_boot instead of rproc_attach
- move debug message early in the function
drivers/remoteproc/remoteproc_core.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index b087ed21858a..d56788e8df76 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1781,7 +1781,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)
--
2.34.1
next prev parent reply other threads:[~2026-03-03 23:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-03 23:35 [PATCH v4 0/2] remoteproc: xlnx: remote crash recovery Tanmay Shah
2026-03-03 23:35 ` Tanmay Shah [this message]
2026-03-03 23:35 ` [PATCH v4 2/2] remoteproc: xlnx: add crash detection mechanism Tanmay Shah
2026-03-11 17:21 ` [PATCH v4 0/2] remoteproc: xlnx: remote crash recovery Mathieu Poirier
2026-03-17 21:16 ` Shah, Tanmay
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260303233533.2310513-2-tanmay.shah@amd.com \
--to=tanmay.shah@amd.com \
--cc=andersson@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®