Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935816AbdIZFJU (ORCPT ); Tue, 26 Sep 2017 01:09:20 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34064 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934183AbdIZFJS (ORCPT ); Tue, 26 Sep 2017 01:09:18 -0400 X-Google-Smtp-Source: AOwi7QCoVvyzFxKfsj3lnisAkNCGxqWBtv8MqzAVEGLZicnp9GvkhXtH+hyTyArVOUWDFRFN6TZZJA== Date: Tue, 26 Sep 2017 07:09:14 +0200 From: Daniel Vetter To: Laura Abbott Cc: Benjamin Gaignard , sumit.semwal@linaro.org, gregkh@linuxfoundation.org, arve@android.com, riandrews@android.com, broonie@kernel.org, dan.carpenter@oracle.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH v3 2/2] staging: ion: create one device entry per heap Message-ID: <20170926050914.pdc64yafdhfg634a@phenom.ffwll.local> Mail-Followup-To: Laura Abbott , Benjamin Gaignard , sumit.semwal@linaro.org, gregkh@linuxfoundation.org, arve@android.com, riandrews@android.com, broonie@kernel.org, dan.carpenter@oracle.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org References: <1505897105-23721-1-git-send-email-benjamin.gaignard@linaro.org> <1505897105-23721-3-git-send-email-benjamin.gaignard@linaro.org> <3dbd167f-c381-8451-5861-3788634885b7@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3dbd167f-c381-8451-5861-3788634885b7@redhat.com> X-Operating-System: Linux phenom 4.12.0-1-amd64 User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1805 Lines: 42 On Mon, Sep 25, 2017 at 11:26:27AM -0700, Laura Abbott wrote: > On 09/20/2017 01:45 AM, Benjamin Gaignard wrote: > > Instead a getting one common device "/dev/ion" for > > all the heaps this patch allow to create one device > > entry ("/dev/ionX") per heap. > > Getting an entry per heap could allow to set security rules > > per heap and global ones for all heaps. > > > > Allocation requests will be only allowed if the mask_id > > match with device minor. > > Query request could be done on any of the devices. > > Deivce node major will also change and that may impact init scripts. > > > > We should start Cc linux-api for future changes since we're going > to have more than just /dev/ion. > > Thinking about this some more, I think we need to allow backwards > compatibility. It's just not feasible to keep throwing workarounds > into userspace if we can avoid it. I'd propose keeping the old /dev/ion > misc interface available under a Kconfig and then creating the new > split heaps in parallel. > > On a somewhat related note, there was some interest in possibly > having a sysfs interface for Ion long term. I don't think this > needs to happen right now but I'd like whatever we do to not > make adding that harder. Not sure sysfs is a good idea for allocating buffers. The backlight interface is in sysfs, which defacto makes it a root-only interface. Distros really hate that, because it makes unpriviledged X/wayland really hard to pull of. Passing a device file otoh from logind to the compositor is dead simple (and how X et al get at e.g. the drm/input devices already). Adding some links from devices to corresponding ion heaps somewhere in sysfs makes sense, and those could be read by anyone. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch