From patchwork Thu Nov 29 21:32:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Pallardy X-Patchwork-Id: 152469 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2891037ljp; Thu, 29 Nov 2018 13:33:06 -0800 (PST) X-Google-Smtp-Source: AFSGD/VLf5uqWJ4MJYtdfIgmDb/6zrh0vC2EJuoMyGtYtyo7mQCV9G+Z0T7x6WJkzfc6fFlnLJ+K X-Received: by 2002:a63:3703:: with SMTP id e3mr2586259pga.348.1543527186283; Thu, 29 Nov 2018 13:33:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543527186; cv=none; d=google.com; s=arc-20160816; b=Ln2sd9jCHeSTVVepykipujg75SKJ9sC9ztKEvRjr2NAY9XN+HdKaFFMLOe4J/CMWtY zhGFJbpTPu73Itb86CbxjZPyPTymjURxCEMT5FwORUk39+QzO0f8hCO62DUwFGFqodMU NCWCJMnNqCBd2b/5LgXcZyCMB0TO7a7x/NH9I/Se92lDQANgGr8+hx/dpcNtGYO6Scj/ fizviG9wog7TDewy88+m8WtT9MGCMsQjevnlqptqLIeENlGVoY6+dcYIqkW59bm17Gjk xpBr7fXsaRiNjs/IEIljTEjv+ciOUZjB9DJ3a75Kpj0t8OlNgxrqnoa4n1svc1+pPKRI 45lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=XcXlfQLJ4+rJlEO4W2qT0oeP7qv8c7pr6avZFyVlvkg=; b=MC/Qeddg1KJVV56K3xFeZPmMjHcxW0pl6V9g/2m/EXbmssMz0gcypBbNSmx68vQsuG BdQ32JrYRED+eD4UEh/nfen8AULPx8CrPsxHKKOqpM+qCLhcf8m98zfhkx5cjnGT/9Pe 6NTgg6vE6LyK0LzjBOwAuYJjjeCdoPGf00X32dybMs7fqRonl8RXKxgu7mjD9zkDZvjn EfaUzHZ9gegG4oQm6M/GOKWUoxZdUJ0urVkFxLQP6+eARcjczI/xq2bEJxy8QEv9tNew xRTfQDXaS1G7XXNAWtHcEWgpDQwVE//dtjEVBJDCMGHn/Dp8S3JwDNYP8SonDq1T2Eqc 2hVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t5si3174409pgm.79.2018.11.29.13.33.05; Thu, 29 Nov 2018 13:33:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727057AbeK3Ijw (ORCPT + 32 others); Fri, 30 Nov 2018 03:39:52 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:17103 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726216AbeK3Ijw (ORCPT ); Fri, 30 Nov 2018 03:39:52 -0500 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id wATLTaD1001701; Thu, 29 Nov 2018 22:32:59 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2nxvnb6guq-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 29 Nov 2018 22:32:59 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 609F8490; Thu, 29 Nov 2018 22:32:29 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas23.st.com [10.75.90.46]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 9C0BD59A4; Thu, 29 Nov 2018 21:32:58 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by SAFEX1HUBCAS23.st.com (10.75.90.46) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 29 Nov 2018 22:32:58 +0100 Received: from localhost (10.129.6.191) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 29 Nov 2018 22:32:57 +0100 From: Loic Pallardy To: , CC: , , , , , Loic Pallardy Subject: [PATCH 3/3] rpmsg: virtio: allocate buffer from parent Date: Thu, 29 Nov 2018 22:32:38 +0100 Message-ID: <1543527158-56163-4-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543527158-56163-1-git-send-email-loic.pallardy@st.com> References: <1543527158-56163-1-git-send-email-loic.pallardy@st.com> MIME-Version: 1.0 X-Originating-IP: [10.129.6.191] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-11-29_13:, , signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remoteproc is now capable to create one specific sub-device per virtio link to associate a dedicated memory pool. This implies to change device used by virtio_rpmsg for buffer allocation from grand-parent to parent. Signed-off-by: Loic Pallardy Reviewed-by: Anup Patel Tested-by: Anup Patel --- drivers/rpmsg/virtio_rpmsg_bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 664f957012cd..5c892019ce89 100644 --- a/drivers/rpmsg/virtio_rpmsg_bus.c +++ b/drivers/rpmsg/virtio_rpmsg_bus.c @@ -912,7 +912,7 @@ static int rpmsg_probe(struct virtio_device *vdev) total_buf_space = vrp->num_bufs * vrp->buf_size; /* allocate coherent memory for the buffers */ - bufs_va = dma_alloc_coherent(vdev->dev.parent->parent, + bufs_va = dma_alloc_coherent(vdev->dev.parent, total_buf_space, &vrp->bufs_dma, GFP_KERNEL); if (!bufs_va) { @@ -980,7 +980,7 @@ static int rpmsg_probe(struct virtio_device *vdev) return 0; free_coherent: - dma_free_coherent(vdev->dev.parent->parent, total_buf_space, + dma_free_coherent(vdev->dev.parent, total_buf_space, bufs_va, vrp->bufs_dma); vqs_del: vdev->config->del_vqs(vrp->vdev); @@ -1015,7 +1015,7 @@ static void rpmsg_remove(struct virtio_device *vdev) vdev->config->del_vqs(vrp->vdev); - dma_free_coherent(vdev->dev.parent->parent, total_buf_space, + dma_free_coherent(vdev->dev.parent, total_buf_space, vrp->rbufs, vrp->bufs_dma); kfree(vrp);