From patchwork Thu Jan 10 13:50:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Pallardy X-Patchwork-Id: 155170 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1917237jaa; Thu, 10 Jan 2019 05:51:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN6nW9dteZapXcU1bMiWZwy+nS7wVyK4/sgSU6oMljw/qdx41lA9Db1NhwiFIenFpK61ug6D X-Received: by 2002:a63:e74b:: with SMTP id j11mr2780011pgk.397.1547128264624; Thu, 10 Jan 2019 05:51:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547128264; cv=none; d=google.com; s=arc-20160816; b=wTAhfh5JoMmOMG/fR2wSwcfemx+Dpb+jMT6BMKW/GroGbjj+HHvLa36z35ed0j8LJO iFapkzIuDBn3X8AdeaND9k7VPjVFXvWGFEfituOHsV2NH2owkY6IoWfjalfSTZF/zj4H SAzBux6Z9tY6DBNsy1/nHqRNIqSysrnnwlFtNiUxqZnESBZtUhUOsN6EMBzEYfRtwFCZ I0cX8WRhIAcBAXaYNp1NlzIEBWzRyzeoRJLq8CcXWxWICTFJ0ghIsnHkCR61xaTOYDG5 6D6+69IpY50yP6wZkmBAobyDD/50pK6JOlBxymSoWQp5+MWV4SdZgu2sCunFckIfz+m8 IGJQ== 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=kYWIjL612pklSQuyrRsiMSzlTsvoam1XC27Fl0KIVLU=; b=QyDWayVEp4bq8nlReffHLRpIu6p/X19s/l5acN5djUFa/aPKcrKJEqB6dBNlW24qzM MV/DsReZ+fBSvXdD446K+FG3HvDWHH1hLQRKAM4CZtDZ7lXjI6QFkHYduwkSJ8A10ZrE UgypMVSP1NSotjFUyt/cRHCv/E9hG9hWgzWT3R6GnSbGoNtcFlMnRhXcyWGmkNDWnpMp feCxUx67HDcQNk7HdOmicD4iRcdXucV+727F69+C5rW7ZHemq4nDgVBLfAyhkRuc2i60 8NRnepqrRQipPuFSVX8WroKazIn6YlVsVpsJRToyCK/38Uyca2owWyfGRLn8B2r1XLjv h4ww== 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 f34si1986572pgm.318.2019.01.10.05.51.04; Thu, 10 Jan 2019 05:51:04 -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 S1728137AbfAJNvD (ORCPT + 31 others); Thu, 10 Jan 2019 08:51:03 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:25430 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727795AbfAJNvB (ORCPT ); Thu, 10 Jan 2019 08:51:01 -0500 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0ADfOrY008990; Thu, 10 Jan 2019 14:50:56 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2ptwtdsw9n-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 10 Jan 2019 14:50:56 +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 C2C5738; Thu, 10 Jan 2019 13:50:55 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id A36CF505F; Thu, 10 Jan 2019 13:50:55 +0000 (GMT) Received: from SAFEX1HUBCAS21.st.com (10.75.90.45) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 10 Jan 2019 14:50:55 +0100 Received: from localhost (10.201.20.178) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 10 Jan 2019 14:50:54 +0100 From: Loic Pallardy To: , CC: , , , , , Loic Pallardy Subject: [PATCH v2 3/3] rpmsg: virtio: allocate buffer from parent Date: Thu, 10 Jan 2019 14:50:51 +0100 Message-ID: <1547128251-44137-4-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547128251-44137-1-git-send-email-loic.pallardy@st.com> References: <1547128251-44137-1-git-send-email-loic.pallardy@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.20.178] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-01-10_05:, , 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);