From patchwork Thu Aug 30 00:24:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Guzman Lugo, Fernando" X-Patchwork-Id: 1386331 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 7F4A2DF2AB for ; Thu, 30 Aug 2012 00:28:11 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T6sZG-0007gm-Dc; Thu, 30 Aug 2012 00:25:06 +0000 Received: from na3sys009aog120.obsmtp.com ([74.125.149.140]) by merlin.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1T6sZD-0007gU-04 for linux-arm-kernel@lists.infradead.org; Thu, 30 Aug 2012 00:25:03 +0000 Received: from mail-ob0-f177.google.com ([209.85.214.177]) (using TLSv1) by na3sys009aob120.postini.com ([74.125.148.12]) with SMTP ID DSNKUD6y3eZPHEAUAaDbzPkTEDjvGCNXFoTm@postini.com; Wed, 29 Aug 2012 17:25:02 PDT Received: by obbta17 with SMTP id ta17so2403133obb.36 for ; Wed, 29 Aug 2012 17:25:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=W7MwEkojRhr265wEZLZOi9w6xOxYdYNd9v3P3mofUl4=; b=Bn7ZJplO7fCo/weofw3ZaHmMFkj5m+oAQY+vkSeIXsIpjsboAvvTWSYEMx8SqAsaR5 LoxwGmU/xQBKz/PMEl6c9ra1zKL1if6s8E+GemcB/iKSe03NEwcVzy9y9NbxXailL8Cu L3qpu8cuwetZYI+GzCxDIkeU4ftpWndT58KPmqjxtq3k8FbkQIU+k42dBud/frRd4Htz znjMQdev/q+Rip10wtDRtW9zzZeEjklHb8sHsQcdt0a/LYCwKlhFcOHVWldj2OgS2qGo 5fAK2e/CdVP8uy0NPZ9X2v9Qj4Xx0DVYxgp3puYNPMP6bTW4IFN1HX5dhgf8NBPNDDH/ tSZg== Received: by 10.60.22.104 with SMTP id c8mr2855181oef.2.1346286300767; Wed, 29 Aug 2012 17:25:00 -0700 (PDT) Received: from localhost.localdomain (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id r1sm94473oea.4.2012.08.29.17.24.59 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 29 Aug 2012 17:25:00 -0700 (PDT) From: Fernando Guzman Lugo To: , , , Subject: [PATCH] rpmsg: use right device paramter when calling dma_free_coherent function Date: Wed, 29 Aug 2012 19:24:52 -0500 Message-Id: <1346286292-21773-1-git-send-email-fernando.lugo@ti.com> X-Mailer: git-send-email 1.7.1 X-Gm-Message-State: ALoCoQnFvoI/PIIyd6ZWNXrrthY5imqGDZwXOSPdLg0Ksb0SecyeebmRjxWgZ9QlhGRyd4Fh6hip X-Spam-Note: CRM114 invocation failed X-Spam-Score: -4.2 (----) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-4.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.140 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Fernando Guzman Lugo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 --- 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);