From patchwork Tue Sep 19 10:25:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 112977 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4729708qgf; Tue, 19 Sep 2017 03:26:03 -0700 (PDT) X-Received: by 10.98.61.17 with SMTP id k17mr874042pfa.48.1505816763689; Tue, 19 Sep 2017 03:26:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505816763; cv=none; d=google.com; s=arc-20160816; b=rnFFxXzWfAUvZnZZJo2wjLp0lhOtnw39tw9ghjM348lTy/E/Hs5QaYVBTRTv7Zl4V6 TzvSMdyWunwtaP7ZVf2R+Jj1z0DgZhpoIUEkD1VNJF7EF+IBHfcOYXbHBYQmU6Dtm1jv 3Bcs6Yx36upO/dTTrqXcUxPVKQ5b+U7PrPMAP0sTz+B6dLt9KVIiJryGXuKC9NgO965g j1E8/nDKMhiay+abaU+HZJvbghVrhvId2tl/Rdq0V2mriBbDUCfhERHUMHW52JNdMD1C 2B+gWUlv7tFRSQsWlQ82Z+FJgie3DUG2wqPE00GaKMRbMmEzzdXQU+KQBL3Ntpq5A9dx Q3cg== 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=GGfcBMss8dQedQwQ21KY466Dzt0xKM3ufM1Jx5MSVrc=; b=UL+SHih0VB5oWPLX2UrxZVMaUosI9MFjVobYQI+RYJBkq1zlfdOGmUba5P7k4/w/Fc YNoH6iFOEl+r+lhp7Z53SdKwApS60OoNGn+R2HnWzsOWQ3RoS+RCYhbnRAEIGyU9gP3L bgPotyU2zEi4p49K7jFI6l6Og0vkMsvUOjhTNZKkFt3ibZZLmFSOcFxMdQCuWOCha/Op WPB6iH2pwObla1RC9gXbpkaJl1PB1f+pR44gi+vfs50lG/wdo8crBQgoG5UfGzg+kWfo KfPgizJdbU1Z7BSaHXV8trXZ6MRNPLC30beOtSytCoJ1NNpUac1UbbOaH96Ic8eMHo/U yN5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VM+BabEI; 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 g8si1156930pgr.309.2017.09.19.03.26.03; Tue, 19 Sep 2017 03:26:03 -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; dkim=pass header.i=@linaro.org header.s=google header.b=VM+BabEI; 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 S1751370AbdISK0B (ORCPT + 26 others); Tue, 19 Sep 2017 06:26:01 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:50498 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750974AbdISKZ7 (ORCPT ); Tue, 19 Sep 2017 06:25:59 -0400 Received: by mail-wr0-f176.google.com with SMTP id w12so2652888wrc.7 for ; Tue, 19 Sep 2017 03:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=GGfcBMss8dQedQwQ21KY466Dzt0xKM3ufM1Jx5MSVrc=; b=VM+BabEIc7gveS5akaYovinGoi7xtPqonUYbeif1JbAFCWalsIzIOD0ZXXDlvr1eO3 uHS5a8XB0dzYdOOmjwaIjBiDKVq1ns2v70BQsB4zugF9GBGgTqsiNj08pwUSVUujwWug iD5F1GkYLxe76srDt60JVTmTZcJ3jRUS2FF7I= 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=GGfcBMss8dQedQwQ21KY466Dzt0xKM3ufM1Jx5MSVrc=; b=jIPVCQ0iFD7hFIYu256urIYSJk2cd29gv7DNuhSQYrG4ckZsCqQRNPScx4xces2HFf AjhI4WEebsa+hzNJ+FPVe/2j3wDYNs13KTtuHkOM9GeolO75wqTbNyOLh3/gTLhasZqI XUl+Dn13Vt3qKysUPnW2i+vY9Ovn+rl57qTWd9h4oL2JR3UZzA/wJk/QHRjK/nWHFrdU /N/ojx8vcB/jgFtE3kOng1BndVesjIOk1QsG35bAHXhwNXZUalb8RC9I6IR5SUBQA9mh tUNE0Ne31kL06GmUCpLJzx4+3FNkVn/o7bcEoXRwOtpIPtajv2ACjUHIL+Jy+GwF+Wtq fjfQ== X-Gm-Message-State: AHPjjUj9ndguy30eOAY5PKQH2bFvoXO/+pPB9OFXqBYGpg7/C0hIzvHE Z+y0aHdsZX9QuHIWCYT8M5OMMmQTPU0= X-Google-Smtp-Source: AOwi7QC1/Jhicm+rF4Wdpaq5ixv+GUhNbSSP1F2x9OvwEAqBtF9suHnv7B0TJJ2XYUAtQLIEn9aeCg== X-Received: by 10.223.195.144 with SMTP id p16mr1041114wrf.123.1505816758271; Tue, 19 Sep 2017 03:25:58 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([80.215.227.50]) by smtp.gmail.com with ESMTPSA id 56sm9039451wrx.2.2017.09.19.03.25.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Sep 2017 03:25:57 -0700 (PDT) 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, Benjamin Gaignard Subject: [PATCH v2 0/2] staging: ion: get one device per heap Date: Tue, 19 Sep 2017 12:25:36 +0200 Message-Id: <1505816738-30017-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 2: - simplify ioctl check like propose by Dan - make sure that we don't register more than ION_DEV_MAX heaps 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. Benjamin Gaignard (2): staging: ion: simplify ioctl args checking function staging: ion: create one device entry per heap drivers/staging/android/ion/ion-ioctl.c | 20 +++++++++++++------- drivers/staging/android/ion/ion.c | 23 +++++++++++++++++------ drivers/staging/android/ion/ion.h | 10 +++++++--- 3 files changed, 37 insertions(+), 16 deletions(-) -- 2.7.4