Re: [RFCv2 03/11] remoteproc: Set vring addresses in resource table

Ido Yariv
2012-12-21T02:20:00Z

Hi Sjur,

On Fri, Dec 14, 2012 at 05:06:52PM +0100, Sjur Brændeland wrote:
> Set the vring addresses in the resource table so that
> the remote device can read the actual addresses used.
>
> Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>

Since this new member will only be referenced in the last patch, perhaps
squash the two patches?

> ---
> drivers/remoteproc/remoteproc_core.c | 5 +++++
> include/linux/remoteproc.h | 2 ++
> 2 files changed, 7 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 7d593a1..151e138 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -238,6 +238,8 @@ int rproc_alloc_vring(struct rproc_vdev *rvdev, int i)
> rvring->dma = dma;
> rvring->notifyid = notifyid;
>
> + rvdev->rsc->vring[i].da = dma;

This could be a bit problematic when iommu is used. Since not all
platforms use dma_alloc_coherent to automatically set up the iommu, the
dma variable might hold the physical address instead of the device
address. Setting da may be a bit misleading, so this should probably be
documented.

Thanks,
Ido.