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

From: Ido Yariv
Date: Thu Dec 20 2012 - 21:19:50 EST


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@xxxxxxxxxxxxxx>

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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/