Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2989256imu; Thu, 29 Nov 2018 13:35:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/UOpqiF/YziA66sM0OkG4MOl5O71TSy30Ie0RznFSA7+jzM3LsSkDtItxASlpIPUHoia+4w X-Received: by 2002:a62:130c:: with SMTP id b12mr3018678pfj.247.1543527333436; Thu, 29 Nov 2018 13:35:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543527333; cv=none; d=google.com; s=arc-20160816; b=X3nAyHx67s5O+ObBDPI4B48+U1lm18YdYTs2zZvx0CIJoSLbfoKkHSa7Xktc4U1B8A IbsldmVkxJzZSptkM6gxAtpn442ihryUTNJ4kuviVXyc/E5PyMduXUHnuWeoxy7/r+Ly drduFGnurbOg4xQTR4vRr7HBchu5xqjI72QdIk43hNmZRIUysfFCT7+HXufBEHbtjuom yi9OfcbHDwIcvXx+pzVpSCz3qdJY3dACwyEt34l+7JZtmpZUw/w0Pl1Eb5nRxA9l9UbU t7a7zkjPKOMvXh2IalDZOpKoKTD5lc7GCajoREFM4BvTIWAxO5ltswxTmBOI+wtzgKTl 5nEg== 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 h91si3158224pld.411.2018.11.29.13.35.18; Thu, 29 Nov 2018 13:35:33 -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 S1727048AbeK3Ijw (ORCPT + 99 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 Content-Type: text/plain 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(-) 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); -- 2.7.4