Skip to contentSkip to conversation

iio:kfifo_buf: Use wake_up_interruptible_poll()

PATCH Applied Lars-Peter Clausen 2 participants 2 messages Sep 15, 2013 IIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio:kfifo_buf: Use wake_up_interruptible_poll()

Use wake_up_interruptible_poll() instead of wake_up_interruptible() to only wake up those threads that listen for input poll notifications.

---
 drivers/iio/kfifo_buf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/kfifo_buf.c +2 -1
index a923c78..1bea41b 100644
@@ -7,6 +7,7 @@
 #include <linux/mutex.h>
 #include <linux/iio/kfifo_buf.h>
 #include <linux/sched.h>
+#include <linux/poll.h>
 
 struct iio_kfifo {
 	struct iio_buffer buffer;
@@ -102,7 +103,7 @@ static int iio_store_to_kfifo(struct iio_buffer *r,
 	if (ret != 1)
 		return -EBUSY;
 	r->stufftoread = true;
-	wake_up_interruptible(&r->pollq);
+	wake_up_interruptible_poll(&r->pollq, POLLIN | POLLRDNORM);
 
 	return 0;
 }
Signature · 1 line
1.8.0
maintainer Applied
#1 lore raw
Quoted 4 lines · Lars-Peter Clausen

Use wake_up_interruptible_poll() instead of wake_up_interruptible() to only wake up those threads that listen for input poll notifications.

You learn something new every day (or several things today!)...

Applied to the togreg branch of iio.git

Thanks,

Jonathan

Quoted 26 lines
---
 drivers/iio/kfifo_buf.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/iio/kfifo_buf.c +2 -1
index a923c78..1bea41b 100644
@@ -7,6 +7,7 @@
 #include <linux/mutex.h>
 #include <linux/iio/kfifo_buf.h>
 #include <linux/sched.h>
+#include <linux/poll.h>
 
 struct iio_kfifo {
 	struct iio_buffer buffer;
@@ -102,7 +103,7 @@ static int iio_store_to_kfifo(struct iio_buffer *r,
 	if (ret != 1)
 		return -EBUSY;
 	r->stufftoread = true;
-	wake_up_interruptible(&r->pollq);
+	wake_up_interruptible_poll(&r->pollq, POLLIN | POLLRDNORM);
 
 	return 0;
 }