* [PATCH] iio:kfifo_buf: Use wake_up_interruptible_poll()
@ 2013-09-15 15:31 Lars-Peter Clausen
2013-09-15 16:39 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Lars-Peter Clausen @ 2013-09-15 15:31 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio, 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.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
drivers/iio/kfifo_buf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/kfifo_buf.c b/drivers/iio/kfifo_buf.c
index a923c78..1bea41b 100644
--- a/drivers/iio/kfifo_buf.c
+++ b/drivers/iio/kfifo_buf.c
@@ -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;
}
--
1.8.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio:kfifo_buf: Use wake_up_interruptible_poll()
2013-09-15 15:31 [PATCH] iio:kfifo_buf: Use wake_up_interruptible_poll() Lars-Peter Clausen
@ 2013-09-15 16:39 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2013-09-15 16:39 UTC (permalink / raw)
To: Lars-Peter Clausen; +Cc: linux-iio
On 09/15/13 16:31, Lars-Peter Clausen wrote:
> Use wake_up_interruptible_poll() instead of wake_up_interruptible() to only wake
> up those threads that listen for input poll notifications.
>
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
You learn something new every day (or several things today!)...
Applied to the togreg branch of iio.git
Thanks,
Jonathan
> ---
> drivers/iio/kfifo_buf.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iio/kfifo_buf.c b/drivers/iio/kfifo_buf.c
> index a923c78..1bea41b 100644
> --- a/drivers/iio/kfifo_buf.c
> +++ b/drivers/iio/kfifo_buf.c
> @@ -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;
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-15 15:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-15 15:31 [PATCH] iio:kfifo_buf: Use wake_up_interruptible_poll() Lars-Peter Clausen
2013-09-15 16:39 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).