[PATCH v2 1/4] remoteproc: core: Reset freed vring entries to FW_RSC_ADDR_ANY

From: Yonghao Zhang

Date: Tue Nov 24 2026 - 02:14:45 EST


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