linux-remoteproc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remoteproc: recopy parent dma_pfn_offset for vdev
@ 2019-06-12  9:55 Clement Leger
  2019-06-17 10:10 ` Loic PALLARDY
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Clement Leger @ 2019-06-12  9:55 UTC (permalink / raw)
  To: Ohad Ben-Cohen, Bjorn Andersson, linux-remoteproc; +Cc: Clement Leger

When preparing the subdevice for the vdev, also copy dma_pfn_offset
since this is used for sub device dma allocations. Without that, there
is incoherency between the parent dma settings and the childs one,
potentially leading to dma_alloc_coherent failure (due to phys_to_dma
using dma_pfn_offset for translation).
---
 drivers/remoteproc/remoteproc_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 263e9c9614a8..3b56ca043231 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -520,6 +520,7 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,
 	/* Initialise vdev subdevice */
 	snprintf(name, sizeof(name), "vdev%dbuffer", rvdev->index);
 	rvdev->dev.parent = rproc->dev.parent;
+	rvdev->dev.dma_pfn_offset = rproc->dev.parent->dma_pfn_offset;
 	rvdev->dev.release = rproc_rvdev_release;
 	dev_set_name(&rvdev->dev, "%s#%s", dev_name(rvdev->dev.parent), name);
 	dev_set_drvdata(&rvdev->dev, rvdev);
-- 
2.15.0.276.g89ea799

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2019-07-22  9:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-12  9:55 [PATCH] remoteproc: recopy parent dma_pfn_offset for vdev Clement Leger
2019-06-17 10:10 ` Loic PALLARDY
2019-06-29 18:59 ` Bjorn Andersson
2019-07-01  7:02 ` [PATCH v2] remoteproc: copy " Clement Leger
2019-07-02  6:27   ` Bjorn Andersson
2019-07-02 13:22   ` Christoph Hellwig
2019-07-02 15:36     ` Loic PALLARDY
2019-07-08 18:45       ` Christoph Hellwig
2019-07-19  6:32         ` Christoph Hellwig
2019-07-22  8:41           ` Loic PALLARDY
2019-07-22  9:24             ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).