Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp793363imm; Fri, 27 Jul 2018 06:16:47 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcGrEquU3npsw/NljQx7tawUL7QGsj1kJKTQgHl+JqjvhI07ZlGwgqJqzffhhCNYzLa/ZXS X-Received: by 2002:a17:902:7c0a:: with SMTP id x10-v6mr5928337pll.77.1532697407118; Fri, 27 Jul 2018 06:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532697407; cv=none; d=google.com; s=arc-20160816; b=IdzzEBxK45oExs3vFe8j/cjy9s6QTqrEcRrsu+WVgflUosij56ytktsJQVzyh/THkX rwL6BaJfiAQAp4xXtFjkNnvFYnig0slfAwle6nKMOkKwp05wU0aJu8IJyrXFJADkLW0T SdflmJk2JptZ0hZUz3Vz1FF8B92R4tyZ/lNLgXXvfJf4OviCJStiUfgZEOmKOTd8OEyv Um2BuBmG/EJNxWUND6NmwCTSC9e/ig3XkxroSaMLXGdSSk4pNOELXDZGQq4kPrzO9p30 GuTs7MuhcrtiolbpQXVI0tmENGmbIkIoRmfTBbMGX9TTpBgQzs83waJsJqY5yykqoVN4 p8Yg== 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 190-v6si3999771pgd.673.2018.07.27.06.16.32; Fri, 27 Jul 2018 06:16:47 -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 S2388828AbeG0Ohd (ORCPT + 99 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 Content-Type: text/plain 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(-) 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); -- 1.9.1