Re: [PATCH v2] remoteproc: virtio: Synchronize virtqueue teardown with rproc_vq_interrupt()

From: Mathieu Poirier

Date: Tue Oct 13 2026 - 14:18:03 EST


On Fri, Oct 09, 2026 at 05:23:42PM -0400, Yuho Choi wrote:
> On Fri, 9 Oct 2026 at 13:23, Mathieu Poirier <mathieu.poirier@xxxxxxxxxx> wrote:
> >
> > > - list_for_each_entry_safe(vq, n, &vdev->vqs, list) {
> > > + list_for_each_entry(vq, &vdev->vqs, list) {
> >
> > How is list_for_each_entry_safe() no longer needed?
>
> The first loop only clears the pointers with RCU_INIT_POINTER(). It does not
> modify the list, so the 'safe' variant is not needed there.
> synchronize_srcu() is
> then called once, after that loop, to wait for in-flight readers. The
> actual removal
> still happens in the second loop, which keeps list_for_each_entry_safe().

I agree with your assessment. I will merge this patch patch when 7.4-rc1 comes
out.

Thanks,
Mathieu