From: Laura Abbott <labbott@redhat.com>
To: "Sumit Semwal" <sumit.semwal@linaro.org>,
"John Stultz" <john.stultz@linaro.org>,
"Arve Hjønnevåg" <arve@android.com>,
"Riley Andrews" <riandrews@android.com>
Cc: Laura Abbott <labbott@redhat.com>,
Daniel Vetter <daniel.vetter@ffwll.ch>,
linaro-mm-sig@lists.linaro.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org,
Eun Taik Lee <eun.taik.lee@samsung.com>,
Liviu Dudau <Liviu.Dudau@arm.com>, Jon Medhurst <tixy@linaro.org>,
Mitchel Humpherys <mitchelh@codeaurora.org>,
Jeremy Gebben <jgebben@codeaurora.org>,
Bryan Huntsman <bryanh@codeaurora.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Android Kernel Team <kernel-team@android.com>
Subject: [RFC][PATCH 5/6] staging: android: ion: Add an ioctl for ABI checking
Date: Mon, 6 Jun 2016 11:23:32 -0700 [thread overview]
Message-ID: <1465237413-10549-6-git-send-email-labbott@redhat.com> (raw)
In-Reply-To: <1465237413-10549-1-git-send-email-labbott@redhat.com>
The current Ion ioctls lack a good way to tell what ioctls are
available. Introduce an ioctl to give an ABI version. This way when the
ABI inevitably gets screwed up userspace will have a way to tell what
version of the screw up is available.
Signed-off-by: Laura Abbott <labbott@redhat.com>
---
drivers/staging/android/ion/ion-ioctl.c | 6 ++++++
drivers/staging/android/uapi/ion.h | 23 +++++++++++++++++++++++
2 files changed, 29 insertions(+)
diff --git a/drivers/staging/android/ion/ion-ioctl.c b/drivers/staging/android/ion/ion-ioctl.c
index 341ba7d..45b89e8 100644
--- a/drivers/staging/android/ion/ion-ioctl.c
+++ b/drivers/staging/android/ion/ion-ioctl.c
@@ -48,6 +48,7 @@ long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
struct ion_allocation_data allocation;
struct ion_handle_data handle;
struct ion_custom_data custom;
+ struct ion_abi_version abi_version;
} data;
dir = ion_ioctl_dir(cmd);
@@ -129,6 +130,11 @@ long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
data.custom.arg);
break;
}
+ case ION_IOC_ABI_VERSION:
+ {
+ data.abi_version.abi_version = ION_ABI_VERSION;
+ break;
+ }
default:
return -ENOTTY;
}
diff --git a/drivers/staging/android/uapi/ion.h b/drivers/staging/android/uapi/ion.h
index a9c4e8b..145005f 100644
--- a/drivers/staging/android/uapi/ion.h
+++ b/drivers/staging/android/uapi/ion.h
@@ -19,6 +19,7 @@
#include <linux/ioctl.h>
#include <linux/types.h>
+#include <linux/version.h>
typedef int ion_user_handle_t;
@@ -128,6 +129,19 @@ struct ion_custom_data {
unsigned long arg;
};
+/**
+ * struct ion_abi_version
+ *
+ * @version - current ABI version
+ */
+
+#define ION_ABI_VERSION KERNEL_VERSION(0, 1, 0)
+
+struct ion_abi_version {
+ __u32 abi_version;
+ __u32 reserved;
+};
+
#define ION_IOC_MAGIC 'I'
/**
@@ -194,4 +208,13 @@ struct ion_custom_data {
*/
#define ION_IOC_CUSTOM _IOWR(ION_IOC_MAGIC, 6, struct ion_custom_data)
+/**
+ * DOC: ION_IOC_ABI_VERSION - return ABI version
+ *
+ * Returns the ABI version of this driver.
+ */
+#define ION_IOC_ABI_VERSION _IOR(ION_IOC_MAGIC, 8, \
+ struct ion_abi_version)
+
+
#endif /* _UAPI_LINUX_ION_H */
--
2.5.5
next prev parent reply other threads:[~2016-06-06 18:24 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-06 18:23 [RFC][PATCH 0/6] ion: improved ABI Laura Abbott
2016-06-06 18:23 ` [RFC][PATCH 1/6] staging: android: ion: return error value for ion_device_add_heap Laura Abbott
2016-06-08 13:02 ` Liviu Dudau
2016-06-06 18:23 ` [RFC][PATCH 2/6] staging: android: ion: Switch to using an idr to manage heaps Laura Abbott
2016-06-08 13:13 ` Liviu Dudau
2016-06-06 18:23 ` [RFC][PATCH 3/6] staging: android: ion: Drop heap type masks Laura Abbott
2016-06-06 18:23 ` [RFC][PATCH 4/6] staging: android: ion: Pull out ion ioctls to a separate file Laura Abbott
2016-06-08 13:20 ` Liviu Dudau
2016-06-06 18:23 ` Laura Abbott [this message]
2016-06-06 18:23 ` [RFC][PATCH 6/6] staging: android: ion: Introduce new ioctls for dynamic heaps Laura Abbott
2016-06-08 13:50 ` Liviu Dudau
2016-06-08 17:35 ` Laura Abbott
2016-06-08 15:34 ` Brian Starkey
2016-06-08 19:14 ` Laura Abbott
2016-06-09 8:25 ` Brian Starkey
2016-06-07 6:59 ` [Linaro-mm-sig] [RFC][PATCH 0/6] ion: improved ABI Chen Feng
2016-06-08 17:29 ` Laura Abbott
2016-06-08 15:15 ` Brian Starkey
2016-06-08 18:58 ` Laura Abbott
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1465237413-10549-6-git-send-email-labbott@redhat.com \
--to=labbott@redhat.com \
--cc=Liviu.Dudau@arm.com \
--cc=arve@android.com \
--cc=bryanh@codeaurora.org \
--cc=daniel.vetter@ffwll.ch \
--cc=devel@driverdev.osuosl.org \
--cc=eun.taik.lee@samsung.com \
--cc=gregkh@linuxfoundation.org \
--cc=jgebben@codeaurora.org \
--cc=john.stultz@linaro.org \
--cc=kernel-team@android.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mitchelh@codeaurora.org \
--cc=riandrews@android.com \
--cc=sumit.semwal@linaro.org \
--cc=tixy@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®