linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rpmsg: use right device paramter when calling dma_free_coherent function
@ 2012-08-30  0:24 Fernando Guzman Lugo
  2012-09-12  9:06 ` Ohad Ben-Cohen
  0 siblings, 1 reply; 2+ messages in thread
From: Fernando Guzman Lugo @ 2012-08-30  0:24 UTC (permalink / raw)
  To: ohad, linux-omap, linux-arm-kernel, linux-kernel; +Cc: Fernando Guzman Lugo

dma_alloc/free_coherent APIs requires the platform specific remoteproc
device as the device parameter. We are passing vdev->dev.parent to the
dma_free_coherent function which is the generic rproc device and it is
wrong, it has to be vdev->dev.parent->parent instead, same as when we
call dma_alloc_coherent function.

Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
---
 drivers/rpmsg/virtio_rpmsg_bus.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 590cfaf..1859f71 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -1008,8 +1008,8 @@ static int rpmsg_probe(struct virtio_device *vdev)
 	return 0;
 
 free_coherent:
-	dma_free_coherent(vdev->dev.parent, RPMSG_TOTAL_BUF_SPACE, bufs_va,
-					vrp->bufs_dma);
+	dma_free_coherent(vdev->dev.parent->parent, RPMSG_TOTAL_BUF_SPACE,
+					bufs_va, vrp->bufs_dma);
 vqs_del:
 	vdev->config->del_vqs(vrp->vdev);
 free_vrp:
@@ -1043,7 +1043,7 @@ static void __devexit rpmsg_remove(struct virtio_device *vdev)
 
 	vdev->config->del_vqs(vrp->vdev);
 
-	dma_free_coherent(vdev->dev.parent, RPMSG_TOTAL_BUF_SPACE,
+	dma_free_coherent(vdev->dev.parent->parent, RPMSG_TOTAL_BUF_SPACE,
 					vrp->rbufs, vrp->bufs_dma);
 
 	kfree(vrp);
-- 
1.7.1


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

* Re: [PATCH] rpmsg: use right device paramter when calling dma_free_coherent function
  2012-08-30  0:24 [PATCH] rpmsg: use right device paramter when calling dma_free_coherent function Fernando Guzman Lugo
@ 2012-09-12  9:06 ` Ohad Ben-Cohen
  0 siblings, 0 replies; 2+ messages in thread
From: Ohad Ben-Cohen @ 2012-09-12  9:06 UTC (permalink / raw)
  To: Fernando Guzman Lugo; +Cc: linux-omap, linux-arm-kernel, linux-kernel

Hi Fernando,

On Thu, Aug 30, 2012 at 3:24 AM, Fernando Guzman Lugo
<fernando.lugo@ti.com> wrote:
> dma_alloc/free_coherent APIs requires the platform specific remoteproc
> device as the device parameter. We are passing vdev->dev.parent to the
> dma_free_coherent function which is the generic rproc device and it is
> wrong, it has to be vdev->dev.parent->parent instead, same as when we
> call dma_alloc_coherent function.
>
> Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>

Thanks, applied to rpmsg-fixes.

Ohad.

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

end of thread, other threads:[~2012-09-12  9:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-30  0:24 [PATCH] rpmsg: use right device paramter when calling dma_free_coherent function Fernando Guzman Lugo
2012-09-12  9:06 ` Ohad Ben-Cohen

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).