Skip to content

Commit b327c72

Browse files
Joakim Zhangmathieupoirier
authored andcommitted
remoteproc: virtio: Fix wdg cannot recovery remote processor
Recovery remote processor failed when wdg irq received: [ 0.842574] remoteproc remoteproc0: crash detected in cix-dsp-rproc: type watchdog [ 0.842750] remoteproc remoteproc0: handling crash #1 in cix-dsp-rproc [ 0.842824] remoteproc remoteproc0: recovering cix-dsp-rproc [ 0.843342] remoteproc remoteproc0: stopped remote processor cix-dsp-rproc [ 0.847901] rproc-virtio rproc-virtio.0.auto: Failed to associate buffer [ 0.847979] remoteproc remoteproc0: failed to probe subdevices for cix-dsp-rproc: -16 The reason is that dma coherent mem would not be released when recovering the remote processor, due to rproc_virtio_remove() would not be called, where the mem released. It will fail when it try to allocate and associate buffer again. Releasing reserved memory from rproc_virtio_dev_release(), instead of rproc_virtio_remove(). Fixes: 1d7b61c ("remoteproc: virtio: Create platform device for the remoteproc_virtio") Signed-off-by: Joakim Zhang <[email protected]> Acked-by: Arnaud Pouliquen <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
1 parent 6613476 commit b327c72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/remoteproc/remoteproc_virtio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ static void rproc_virtio_dev_release(struct device *dev)
351351

352352
kfree(vdev);
353353

354+
of_reserved_mem_device_release(&rvdev->pdev->dev);
355+
dma_release_coherent_memory(&rvdev->pdev->dev);
356+
354357
put_device(&rvdev->pdev->dev);
355358
}
356359

@@ -584,9 +587,6 @@ static void rproc_virtio_remove(struct platform_device *pdev)
584587
rproc_remove_subdev(rproc, &rvdev->subdev);
585588
rproc_remove_rvdev(rvdev);
586589

587-
of_reserved_mem_device_release(&pdev->dev);
588-
dma_release_coherent_memory(&pdev->dev);
589-
590590
put_device(&rproc->dev);
591591
}
592592

0 commit comments

Comments
 (0)