From patchwork Fri Jul 27 13:14:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Pallardy X-Patchwork-Id: 143057 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp806989ljj; Fri, 27 Jul 2018 06:15:43 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeF0OUtppoe5ivseOHRtujIoqvg2FVGIHIngDBAEjqrVvpv3gy1oy4C5PjPYwV0oUyzK42b X-Received: by 2002:a63:6188:: with SMTP id v130-v6mr6136290pgb.100.1532697343582; Fri, 27 Jul 2018 06:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532697343; cv=none; d=google.com; s=arc-20160816; b=so9ERtWFPa5DQHUH26VQ7z8uSNmjXB3RfLbypLXXw4KqBA4i0c0n8VVNfSi1rCWQSW urXWTblsa8yGpYJWst8b6xrS4NgL0UP0rK1dpYSXynKasDSIP96z4YSkzrqkaNAfpBJ7 PhKmR7pjakkzuKKnjVOqOo4OmGfyUdeYw6V2mrJArFURPlRcgO59YL7yUZV3hzc1uUYh z+4hBv946CEkJ7rOMGOLZzzU2cPCaKInQZNl0vKwkG91nnCn/fdeEO/1t9niTV9wedID JuxrJvaGMg+ufnEtFNVexCb0usampAWtZ28cNsfuOeKlkyDyPyKhibjC5jGEk/OWsv+I SJIA== 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:arc-authentication-results; bh=erVfU5vV1SHre22hycRC8OkiExOSCcuHne6RBxDfpn8=; b=tjg3XcHTvUdKA9EFlFYLiooSlV/GFWoAo/g+U4MNDlYYsmwXNimvxqe2bK/rua6W7g RZ21A1Tk66W8BFmVrNUjlErKmPFln8R5xDFiZXFWuqLf9KpiVCI1BLTBf4TOJa8QAfk8 SL6EVTzYK7SC2h0gsyhDiAMyQ39yj+zsEinyDLcQZAD9S95ZRJvM+lsCgpkbRh13HddZ GQcjXxJXCNAxOkn0gDGt1seCvnMbIYA5RDy/lwRgWffJhMIvXyVGJ/9bULcTOF5SpP+6 Pb6aQB1CqTykIGewIM92T/UqIqUXs78yZ43U3IvBNxj2EJgU8D4jjlicj3g3y5Kv+9jk gxQg== 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 v36-v6si3876653pga.336.2018.07.27.06.15.43; Fri, 27 Jul 2018 06:15:43 -0700 (PDT) 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 S2388832AbeG0Ohd (ORCPT + 31 others); Fri, 27 Jul 2018 10:37:33 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:18766 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732124AbeG0Ohc (ORCPT ); Fri, 27 Jul 2018 10:37:32 -0400 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 w6RDEJ13016198; Fri, 27 Jul 2018 15:15:36 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2kg26xrjws-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 27 Jul 2018 15:15:36 +0200 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 52F6F3D; Fri, 27 Jul 2018 13:15:35 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag7node2.st.com [10.75.127.20]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 180B75782; Fri, 27 Jul 2018 13:15:35 +0000 (GMT) Received: from localhost (10.75.127.48) by SFHDAG7NODE2.st.com (10.75.127.20) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 27 Jul 2018 15:15:34 +0200 From: Loic Pallardy To: , CC: , , , , , Loic Pallardy Subject: [PATCH v4 17/17] rpmsg: virtio: allocate buffer from parent Date: Fri, 27 Jul 2018 15:14:52 +0200 Message-ID: <1532697292-14272-18-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1532697292-14272-1-git-send-email-loic.pallardy@st.com> References: <1532697292-14272-1-git-send-email-loic.pallardy@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG6NODE3.st.com (10.75.127.18) To SFHDAG7NODE2.st.com (10.75.127.20) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-07-27_06:, , 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 --- drivers/rpmsg/virtio_rpmsg_bus.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 1.9.1 Reviewed-by: Anup Patel Tested-by: Anup Patel diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c index 664f957..5c89201 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);