From patchwork Mon Oct 23 15:55:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Gaignard X-Patchwork-Id: 116740 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp4800722qgn; Mon, 23 Oct 2017 08:56:34 -0700 (PDT) X-Received: by 10.99.119.79 with SMTP id s76mr12074492pgc.3.1508774194348; Mon, 23 Oct 2017 08:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508774194; cv=none; d=google.com; s=arc-20160816; b=xVax2smjGHdzc0Nw2wGeiZNOPVzz/hpA9fSs/gIdStTH6cHLw9/Jx9Ej+dasIMZnW3 e+4bSQw5htztX391cHZ95a5wm/lqb8cFUbkE65yFZroazmPyrK1BZZe03bclGmHPTdm0 Vz98PkMBbVg5REt7AY2j/it3qW8nLUHyqCTnBSflKjiiCU55J1qatHAysg17PB0TSGEd mWIarfogQl+4I5OVlGAlK/Wdc/joBDPb5f7hogl2ILetuGbAi/ahffx/cl5K/CxG7Snf uaz/VmvWwwNbGM/USwoQtBWuf73zXIoZ9wBs2MSXHdOuoW+WlZRRtndQsBvyD0XKXfGL PKpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:message-id:date:subject:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=ZL96eQHPdpp6F6XDUcMmXvHNFTJfI8p3z72rjjhUYPM=; b=0gB0YPKeY7WqNH+eWzk5D2CI2C/1FIk5jBh8tJRc0/acCaVxcizLTHhP+11/gTpe4N Mam2QHP2/DnzEzEgzIfCQi4tCuCvUGtBoJJIvf4Jw5HEDDPojcdJwGbZSYoyaiHvp0mB ZK6/k5Lu4bpDcv5XuuA5ULiHlYDeD62tRxuZXcvuB9TTKNZZQi7jCNcpGfzY/AutiNT/ 86fz3NVkCttZQBpyYcjsdP8/p5j2rFkQJ82Dn4JB5IBZY0Dam0YIVmZtBcA87VAP35SL g+ypnKO6ap2kSFab/vxEUMpZ3iiXh5BP1Ey/w/psOLIq+xkyv1p1hTeft8Pe1jTVVRmu 3Yug== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=cV4MPdVy; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id 15si4179331pld.802.2017.10.23.08.56.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Oct 2017 08:56:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=cV4MPdVy; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 497D289141; Mon, 23 Oct 2017 15:56:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id CBCE789141 for ; Mon, 23 Oct 2017 15:56:30 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id m72so10496250wmc.1 for ; Mon, 23 Oct 2017 08:56:30 -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=LAJwSPNHtP+1zfloPDSIcJis5iWXMV7CNYXtSOb2CKk=; b=cV4MPdVy+tVF8zwiGhxMWhx2c3CDuiPm5jXy0QJu1MHfUKG5H8BFbd44NCOsohAMv6 bF9ZosSuCVxYKfi/7cAL9YSF4xaZaM9wH2H0q/RZWbssOJQnZPdQXJN1VXPzOQwBZDTO 3Jkrv8YmJkC5fOOq10eHNvJyLlr/LXU2gqYPE= 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=LAJwSPNHtP+1zfloPDSIcJis5iWXMV7CNYXtSOb2CKk=; b=AtzLgizFe2ZzIoidnCrixfdVboaDiuf5YZLMP3nOPgsUvdIt0sZG0PdtXS80bAX5Bp BXkwO7IMUBsB88ZeJsYFrolUjse1KacA/wTtRPuk50+IZAxSSP9etdH7pQxVxSSzeHkP 8g9wY3FFfSLFaFDC4tr7gXGYNaTBddOHpl+QWRUKIB35h9GYcKKwMMmNpnkUoUt8ULhE tdiSJXC3F5CX8hs/Jf+sSoGyI++pDDFI6ZCAhg6ql4l1Ti4D4aFY3VFYlIHIrWrK+qqR t2bU4jvRCAblo+cfiJ272Rdjq4fJNwGMPD/WyeSywQ6kbLQl7Mr8KS+gCfflS80xLWZs IVkg== X-Gm-Message-State: AMCzsaUG5M96/U9KtwNhR//Z6eejBvrvnydrBGamSjzTtvL9Mncw6iCL uo8UVa8INPjIYQsdl5pQhBTyVw== X-Google-Smtp-Source: ABhQp+QorOiR0R5XGIaUA0MsT+gYwH3NdfaX9ave93Ms7LPI/s0XC7rL98WIHfISLiYVTHqJbfOOBg== X-Received: by 10.28.138.133 with SMTP id m127mr6325448wmd.134.1508774189174; Mon, 23 Oct 2017 08:56:29 -0700 (PDT) Received: from lmecxl0911.lme.st.com ([80.214.19.18]) by smtp.gmail.com with ESMTPSA id 55sm8717335wrw.60.2017.10.23.08.56.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Oct 2017 08:56:28 -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 Subject: [PATCH v6 0/2] staging: ion: get one device per heap Date: Mon, 23 Oct 2017 17:55:35 +0200 Message-Id: <1508774137-13835-1-git-send-email-benjamin.gaignard@linaro.org> X-Mailer: git-send-email 2.7.4 Cc: devel@driverdev.osuosl.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" version 6: - add platform_bus and platform_bus_type when register Ion devices to make them appear in /sys/devices/platform. - re-order include files in aphabetic order. 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: simplify ioctl args checking function 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 | 29 +++++++++++++----- drivers/staging/android/ion/ion.c | 53 ++++++++++++++++++++++++++------- drivers/staging/android/ion/ion.h | 15 ++++++++-- 5 files changed, 84 insertions(+), 21 deletions(-)