From: Yonghao Zhang <hyz3367@gmail.com>
To: mathieu.poirier@linaro.org, andersson@kernel.org
Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org,
Yonghao Zhang <hyz3367@gmail.com>
Subject: [PATCH v2 1/4] remoteproc: core: Reset freed vring entries to FW_RSC_ADDR_ANY
Date: Tue, 24 Nov 2026 15:14:06 +0800 [thread overview]
Message-ID: <20261124071409.972-2-hyz3367@gmail.com> (raw)
In-Reply-To: <20261124071409.972-1-hyz3367@gmail.com>
rproc_free_vring() resets a vring entry in the resource table as it
releases it. Resetting da to 0 leaves the entry looking like a vring
at device address 0; write FW_RSC_ADDR_ANY instead, the marker for an
unallocated address, which is what the entry means from then on.
The last sentence of the comment above the reset claims that the
cached table is only available for a processor booted by the core.
rproc_reset_rsc_table_on_{stop,detach}() now install a copy of the
table for processors started by another entity, so drop the sentence.
Fixes: c0d631570ad5 ("remoteproc: set vring addresses in resource table")
Fixes: 4d3ebb3b9990 ("remoteproc: Refactor function rproc_free_vring()")
Signed-off-by: Yonghao Zhang <hyz3367@gmail.com>
---
drivers/remoteproc/remoteproc_core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index d5fa9d23bd5c..b6fe74d34e5c 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -417,16 +417,14 @@ void rproc_free_vring(struct rproc_vring *rvring)
* At this point rproc_stop() has been called and the installed resource
* table in the remote processor memory may no longer be accessible. As
* such and as per rproc_stop(), rproc->table_ptr points to the cached
- * resource table (rproc->cached_table). The cached resource table is
- * only available when a remote processor has been booted by the
- * remoteproc core, otherwise it is NULL.
+ * resource table (rproc->cached_table).
*
* Based on the above, reset the virtio device section in the cached
* resource table only if there is one to work with.
*/
if (rproc->table_ptr) {
rsc = (void *)rproc->table_ptr + rvring->rvdev->rsc_offset;
- rsc->vring[idx].da = 0;
+ rsc->vring[idx].da = FW_RSC_ADDR_ANY;
rsc->vring[idx].notifyid = -1;
}
}
--
2.34.1
next prev parent reply other threads:[~2026-11-24 7:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 7:14 [PATCH v2 0/4] remoteproc: core: Fix the error unwind paths Yonghao Zhang
2026-11-24 7:14 ` Yonghao Zhang [this message]
2026-11-24 7:14 ` [PATCH v2 2/4] remoteproc: core: Guard against a missing stop() in rproc_start() Yonghao Zhang
2026-11-24 7:14 ` [PATCH v2 3/4] remoteproc: core: Guard against a missing stop() in the attach unwind Yonghao Zhang
2026-11-24 7:14 ` [PATCH v2 4/4] remoteproc: core: Clean up after a failed recovery Yonghao Zhang
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=20261124071409.972-2-hyz3367@gmail.com \
--to=hyz3367@gmail.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®