lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 28 Feb 2013 16:43:04 -0800
From:	John Stultz <john.stultz@...aro.org>
To:	lkml <linux-kernel@...r.kernel.org>
Cc:	Erik Gilling <konkers@...roid.com>,
	Maarten Lankhorst <maarten.lankhorst@...onical.com>,
	Daniel Vetter <daniel.vetter@...ll.ch>,
	Rob Clark <robclark@...il.com>,
	Sumit Semwal <sumit.semwal@...aro.org>,
	Greg KH <gregkh@...uxfoundation.org>,
	dri-devel@...ts.freedesktop.org,
	Android Kernel Team <kernel-team@...roid.com>,
	John Stultz <john.stultz@...aro.org>
Subject: [PATCH 08/30] staging: sync: Add poll support

From: Erik Gilling <konkers@...roid.com>

Support poll on sync fence

Cc: Maarten Lankhorst <maarten.lankhorst@...onical.com>
Cc: Erik Gilling <konkers@...roid.com>
Cc: Daniel Vetter <daniel.vetter@...ll.ch>
Cc: Rob Clark <robclark@...il.com>
Cc: Sumit Semwal <sumit.semwal@...aro.org>
Cc: Greg KH <gregkh@...uxfoundation.org>
Cc: dri-devel@...ts.freedesktop.org
Cc: Android Kernel Team <kernel-team@...roid.com>
Signed-off-by: Erik Gilling <konkers@...roid.com>
[jstultz: Add commit message]
Signed-off-by: John Stultz <john.stultz@...aro.org>
---
 drivers/staging/android/sync.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index f84caad..9e35ea3 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -18,6 +18,7 @@
 #include <linux/file.h>
 #include <linux/fs.h>
 #include <linux/kernel.h>
+#include <linux/poll.h>
 #include <linux/sched.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
@@ -221,12 +222,14 @@ out:
 }
 
 static int sync_fence_release(struct inode *inode, struct file *file);
+static unsigned int sync_fence_poll(struct file *file, poll_table *wait);
 static long sync_fence_ioctl(struct file *file, unsigned int cmd,
 			     unsigned long arg);
 
 
 static const struct file_operations sync_fence_fops = {
 	.release = sync_fence_release,
+	.poll = sync_fence_poll,
 	.unlocked_ioctl = sync_fence_ioctl,
 };
 
@@ -497,6 +500,20 @@ static int sync_fence_release(struct inode *inode, struct file *file)
 	return 0;
 }
 
+static unsigned int sync_fence_poll(struct file *file, poll_table *wait)
+{
+	struct sync_fence *fence = file->private_data;
+
+	poll_wait(file, &fence->wq, wait);
+
+	if (fence->status == 1)
+		return POLLIN;
+	else if (fence->status < 0)
+		return POLLERR;
+	else
+		return 0;
+}
+
 static long sync_fence_ioctl_wait(struct sync_fence *fence, unsigned long arg)
 {
 	__s32 value;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ