From patchwork Mon Nov 6 15:59:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 118068 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2919817qgn; Mon, 6 Nov 2017 07:59:59 -0800 (PST) X-Google-Smtp-Source: ABhQp+S5uLSNmPHYhC/KhqXiX3deq8RYBh7GIuGVbXEVqBi/cym+4aE0YyOXm2VAy9iMgzXq/TuE X-Received: by 10.159.206.199 with SMTP id x7mr15198935plo.342.1509983999223; Mon, 06 Nov 2017 07:59:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509983999; cv=none; d=google.com; s=arc-20160816; b=ecT50dLPQjaypz0ccJ4ocU5KaJ1oyQS5FMG4Ywicd5pMna/+cikZ62cRv1XYABtejm wjdFcXEmYM7Q71Hel1Ape02RS7MQpTI+Tsut3soevFCioPyng6OCK/S/BQO4dWugmJh6 IXS2xHqknr3sDpgtR1x2PyFn/0gnWRI5Y6MyzGn31SwM7ua+Z1zlLn4oZ0Lkx1ZlaTHA Vd413/eapd7gnx+LVqYGGbjDsuFtOlpdSgeGEStnABiVAvtxErl5sozcttzVhs1CdIWO CL2l8e0ZVM7Yhny5+knelpWWzJDEzr1NUtoJeTdzJJPKGTPpSG/Yzah5Bhgsc7BeFdvs pHfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=hz+khfkxlxgfLA70XeYw91KbEyknIBCY7e1nuuUrY+E=; b=bzd+KWTVNpimp+2NIldhACu3TGLh7Ag6nVae/kx3ITSro2UbiTbC5UV0opYqFwnIUT VGUWa7ZigrtVXQmAYLeaKf0+Ha/0Yk8Y/bdVd7mOO2/UbbvCE/EuVE5ywVTXWxyDMIsP UjzbSskfBTQqBiZ5yUwv6EbOJFn7eR6BLZHFIRU3WKGonx+ldE0lH+Xdamh+0HgUtMUf g9HDF27Mbug/jk/g2rtMeFnwvou4WInGvzQy8YU/exBFIfMGeaf8Ewss6l8FstVJ4Afb k7WGCki2YzEgLeySNiXbvj6Wgye4U/R9cNUbfgKo2bjNTO1wf47O5HSaw8l5TMa/+o2R EaRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VnZIBE+0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg6si10309757plb.123.2017.11.06.07.59.58; Mon, 06 Nov 2017 07:59:59 -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; dkim=pass header.i=@linaro.org header.s=google header.b=VnZIBE+0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754019AbdKFP74 (ORCPT + 26 others); Mon, 6 Nov 2017 10:59:56 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:44620 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754005AbdKFP7z (ORCPT ); Mon, 6 Nov 2017 10:59:55 -0500 Received: by mail-wr0-f195.google.com with SMTP id u97so1597725wrc.1 for ; Mon, 06 Nov 2017 07:59:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=hz+khfkxlxgfLA70XeYw91KbEyknIBCY7e1nuuUrY+E=; b=VnZIBE+0MANblF7SzmGefNCwc77ex/nYJn3gbfU2n5p4v5xAqV+0HXjkaQCU+xZU0l ZS9QeN5164U8HtHxC7nOy4SMOSIT4TDx8lSM8u1/WtN4h0d0Dt72r9VrZRQEMs+UbV2Y 1D4XJwx3vGNN4qliVttIoFGgHXNDc+VUMIHKQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=hz+khfkxlxgfLA70XeYw91KbEyknIBCY7e1nuuUrY+E=; b=ak2LCrRjXeW5t1OhdAybXGZEsVvycsReGrBqkRmtbfQcoRHy6lAwrrPE9+gbqrSlwc nmuIpnPpGzuNAxkZpJifLwcE4uJr1kXhRL5wcV2fu04pKE4YwOvadu3qMf1zZ1FqfnXI lmGxLeKSA3v2Z7+JTYZ/NUDIpyb342axr93Dz7hmWdLbeGYpK705frl28MGc5w3D1Noq JvsjWbP56IVMHDc6v5PnzIYVuhjCodvTc++PCpjoKYb1y+FbOgzGz0ZN3siAy7Ayxx2i XOSl2/sPHig/TAenztT1isPB0C/v9v9xTrHOJcSCZYH54yEZyXDJd0/j6/taI3VayB1M r+JA== X-Gm-Message-State: AMCzsaW7vzr+xPCgtVA9daE8rji63mIAd/m1hHLFwV6F6SgszLdXl8ym GlL2ez7L6CX85vpkpDfKv6US8Q== X-Received: by 10.223.130.56 with SMTP id 53mr14254591wrb.131.1509983993925; Mon, 06 Nov 2017 07:59:53 -0800 (PST) Received: from lmecxl0911.lme.st.com ([80.215.204.172]) by smtp.gmail.com with ESMTPSA id x63sm9601003wma.39.2017.11.06.07.59.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Nov 2017 07:59:53 -0800 (PST) From: Benjamin Gaignard To: labbott@redhat.com, sumit.semwal@linaro.org, gregkh@linuxfoundation.org, arve@android.com, riandrews@android.com, broonie@kernel.org, dan.carpenter@oracle.com Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-api@vger.kernel.org, Benjamin Gaignard Subject: [PATCH v6 0/2] staging: ion: get one device per heap Date: Mon, 6 Nov 2017 16:59:43 +0100 Message-Id: <1509983985-20950-1-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org version 6: - add an ION bus so heap are show as devices in /sys/bus/ion/ instead of platform bus. - split the patch in two: one for include reordering and one for per heap device change - rebased on top of next-2017110 tag version 5: - create a configuration flag to keep legacy Ion misc device version 4: - add a configuration flag to switch between legacy Ion misc device and one device per heap version. This change has been suggested after Laura talks at XDC 2017. version 3: - change ion_device_add_heap prototype to return a possible error. version 2: - simplify ioctl check like propose by Dan - make sure that we don't register more than ION_DEV_MAX heaps. Until now all ion heaps are addressing using the same device "/dev/ion". This way of working doesn't allow to give access rights (for example with SElinux rules) per heap. This series propose to have one device "/dev/ionX" per heap. Query heaps informations will be possible on each device node but allocation request will only be possible if heap_mask_id match with device minor number. Using legacy Ion misc device is still by setting ION_LEGACY_DEVICE_API configuration flag. Benjamin Gaignard (2): staging: ion: reorder include staging: ion: create one device entry per heap drivers/staging/android/TODO | 1 - drivers/staging/android/ion/Kconfig | 7 +++ drivers/staging/android/ion/ion-ioctl.c | 18 +++++++- drivers/staging/android/ion/ion.c | 76 +++++++++++++++++++++++++++------ drivers/staging/android/ion/ion.h | 15 ++++++- 5 files changed, 98 insertions(+), 19 deletions(-) -- 2.7.4