Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752851AbcCVXUd (ORCPT ); Tue, 22 Mar 2016 19:20:33 -0400 Received: from mail-qk0-f177.google.com ([209.85.220.177]:36235 "EHLO mail-qk0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751322AbcCVXUa (ORCPT ); Tue, 22 Mar 2016 19:20:30 -0400 Subject: Re: [RFC 0/2] staging: ion: of_ion_device_get To: Moritz Fischer References: <1458686031-31031-1-git-send-email-moritz.fischer@ettus.com> <56F1CC7B.7040909@redhat.com> Cc: Arnd Bergmann , Greg KH , arve@android.com, riandrews@android.com, Sumit Semwal , dan.carpenter@oracle.com, sriram@marirs.net.in, Linux Kernel Mailing List , devel@driverdev.osuosl.org From: Laura Abbott Message-ID: <56F1D33A.9050509@redhat.com> Date: Tue, 22 Mar 2016 16:20:26 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1295 Lines: 50 On 03/22/2016 04:08 PM, Moritz Fischer wrote: > Hi Laura, > > On Tue, Mar 22, 2016 at 3:51 PM, Laura Abbott wrote: > >> In the past what drivers have done is a foo_ion_client_create which has the >> reference >> to the ion_device created from ion_device_create. Drivers then call the >> foo_ion_client_create function. > > Oh, so you mean you add a function to create a client to the platform > device implementing > the heap and the export this function? > > heap implements: > > foo_create_client(); > > driver calls: > > foo_create_client() ? > Yes, exactly >> Can you elaborate more on your sharing and allocation flow? This might >> suggest >> another idea. > > Well I'll have a bunch of DMA streams to / from an FPGA that contains > DMA engines & accelerators. To that end > my userland software would allocate say 64 buffers, hand them over to > driver A to queue/deque them. > > In future I might want to share these buffers between streams and with > other peripherals on the same bus, > which is why I looked at ION. > If allocation is coming from userspace and drivers are only importing you should be using the dma_buf APIs instead of Ion APIs directly. Ion is a dma_buf exporter and dma_buf APIs are the preferred API. > Thanks, > > Moritz > Thanks, Laura