From: Mathieu Poirier <mathieu.poirier@linaro.org>
To: Tanmay Shah <tanmay.shah@amd.com>
Cc: andersson@kernel.org, linux-remoteproc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 1/2] remoteproc: core: full attach detach during recovery
Date: Tue, 16 Jun 2026 09:29:10 -0600 [thread overview]
Message-ID: <ajFrxvdmz6gb782Y@p14s> (raw)
In-Reply-To: <20260610182711.1758544-2-tanmay.shah@amd.com>
Hi Tanmay,
On Wed, Jun 10, 2026 at 11:27:10AM -0700, Tanmay Shah wrote:
> 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>
> ---
> 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 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);
That part works.
> }
>
> static int rproc_boot_recovery(struct rproc *rproc)
> --
> 2.34.1
>
next prev parent reply other threads:[~2026-06-16 15:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 18:27 [PATCH v5 0/2] remoteproc: xlnx: remote crash recovery Tanmay Shah
2026-06-10 18:27 ` [PATCH v5 1/2] remoteproc: core: full attach detach during recovery Tanmay Shah
2026-06-16 15:29 ` Mathieu Poirier [this message]
2026-06-10 18:27 ` [PATCH v5 2/2] remoteproc: xlnx: add crash detection mechanism Tanmay Shah
2026-06-16 16:01 ` Mathieu Poirier
2026-06-16 19:52 ` 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=ajFrxvdmz6gb782Y@p14s \
--to=mathieu.poirier@linaro.org \
--cc=andersson@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=tanmay.shah@amd.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.