Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753000AbcCVWvq (ORCPT ); Tue, 22 Mar 2016 18:51:46 -0400 Received: from mail-qk0-f180.google.com ([209.85.220.180]:36079 "EHLO mail-qk0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752333AbcCVWvo (ORCPT ); Tue, 22 Mar 2016 18:51:44 -0400 Subject: Re: [RFC 0/2] staging: ion: of_ion_device_get To: Moritz Fischer , arnd@arndb.de References: <1458686031-31031-1-git-send-email-moritz.fischer@ettus.com> Cc: gregkh@linuxfoundation.org, arve@android.com, riandrews@android.com, gioh.kim@lge.com, sumit.semwal@linaro.org, dan.carpenter@oracle.com, sriram@marirs.net.in, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org From: Laura Abbott Message-ID: <56F1CC7B.7040909@redhat.com> Date: Tue, 22 Mar 2016 15:51:39 -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: <1458686031-31031-1-git-send-email-moritz.fischer@ettus.com> Content-Type: text/plain; charset=windows-1252; 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: 1326 Lines: 36 On 03/22/2016 03:33 PM, Moritz Fischer wrote: > Hi all, > > probably I'm doing this all wrong. I'm playing around with a bunch of accelerators > and I need to share buffers between them. I have my heaps implemented as a > platform device and from what I understand I'll need a reference to the > struct ion_device in each of them. > I couldn't find a way to get to that via devicetree, though. I'll admit that hacking > up miscdevice is quite hacky, maybe I should add a foo_get_ion_device() to my > heap implementing platform device? > If someone can explain me how to correctly do that with what we currently have, > even better. > > Cheers, > > Moritz > > Moritz Fischer (2): > misc: Add of_get_misc get a reference from devicetree > staging: android: ion: Add of_ion_device_get function > > drivers/char/misc.c | 38 ++++++++++++++++++++++++++++++++++++++ > drivers/staging/android/ion/ion.c | 10 ++++++++++ > include/linux/miscdevice.h | 3 +++ > 3 files changed, 51 insertions(+) > 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. Can you elaborate more on your sharing and allocation flow? This might suggest another idea. Thanks, Laura