2019-02-22 05:18:59

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build failure after merge of the rpmsg tree

Hi Bjorn,

After merging the rpmsg tree, today's linux-next build (arm
multi_v7_defconfig) failed like this:

drivers/remoteproc/remoteproc_virtio.c: In function 'rproc_add_virtio_dev':
drivers/remoteproc/remoteproc_virtio.c:374:11: error: 'DMA_MEMORY_EXCLUSIVE' undeclared (first use in this function); did you mean 'WQ_FLAG_EXCLUSIVE'?
DMA_MEMORY_EXCLUSIVE);
^~~~~~~~~~~~~~~~~~~~
WQ_FLAG_EXCLUSIVE
drivers/remoteproc/remoteproc_virtio.c:374:11: note: each undeclared identifier is reported only once for each function it appears in
drivers/remoteproc/remoteproc_virtio.c:371:10: error: too many arguments to function 'dma_declare_coherent_memory'
ret = dma_declare_coherent_memory(dev, pa,
^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/remoteproc/remoteproc_virtio.c:20:
include/linux/dma-mapping.h:748:5: note: declared here
int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
^~~~~~~~~~~~~~~~~~~~~~~~~~~

Caused by commit

086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool")

interacting with commit

82c5de0ab8db ("dma-mapping: remove the DMA_MEMORY_EXCLUSIVE flag")

from the dma-mapping tree.

I have applied the following merge fix patch:

From: Stephen Rothwell <[email protected]>
Date: Fri, 22 Feb 2019 16:14:45 +1100
Subject: [PATCH] remoteproc: fix for "dma-mapping: remove the DMA_MEMORY_EXCLUSIVE flag"

Signed-off-by: Stephen Rothwell <[email protected]>
---
drivers/remoteproc/remoteproc_virtio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c
index 337327d21c1c..44774de6f17b 100644
--- a/drivers/remoteproc/remoteproc_virtio.c
+++ b/drivers/remoteproc/remoteproc_virtio.c
@@ -370,8 +370,7 @@ int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id)
/* Associate vdev buffer memory pool to vdev subdev */
ret = dma_declare_coherent_memory(dev, pa,
mem->da,
- mem->len,
- DMA_MEMORY_EXCLUSIVE);
+ mem->len);
if (ret < 0) {
dev_err(dev, "Failed to associate buffer\n");
goto out;
--
2.20.1

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2019-02-22 12:52:35

by Christoph Hellwig

[permalink] [raw]
Subject: Re: linux-next: build failure after merge of the rpmsg tree

FYI, can I please get an explanation for the remoteproc changes?

We really should avoid adding new callers of dma_declare_coherent_memory,
which is a rather badly designed interface.

2019-02-22 14:03:22

by Loic Pallardy

[permalink] [raw]
Subject: RE: linux-next: build failure after merge of the rpmsg tree

Hi,

Changes in remoteproc have been introduced to associate dedicated dma coherent memory pool to each virtio device.
It is needed when we have several virtio devices for which buffers can't be allocated from the same memory region.
Patch introduces support in both ways:
- memory region declared thanks to reserved memory and associated thanks to of_reserved_mem_device_init_by_idx(): mainly used for regions located in DDR.
- memory region specified in rproc driver itself and defined as dma coherent thanks to dma_declare_coherent_memory(): These regions are generally located in coprocessor/SoC internal memories and declared in different ways by the different rproc drivers (regs in DT, hard coded values in drivers...).

For me, dma_declare_coherent_memory based solution is there to allow a smooth transition from current rproc drivers implementations to a cleaner and unified one based on reserved memory declaration.

Regards,
Loic

> -----Original Message-----
> From: Christoph Hellwig <[email protected]>
> Sent: vendredi 22 f?vrier 2019 13:51
> To: Stephen Rothwell <[email protected]>
> Cc: Bjorn Andersson <[email protected]>; Christoph Hellwig
> <[email protected]>; Linux Next Mailing List <[email protected]>; Linux
> Kernel Mailing List <[email protected]>; Loic PALLARDY
> <[email protected]>
> Subject: Re: linux-next: build failure after merge of the rpmsg tree
>
> FYI, can I please get an explanation for the remoteproc changes?
>
> We really should avoid adding new callers of
> dma_declare_coherent_memory,
> which is a rather badly designed interface.