linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: imu: st_lsm6dsx: irq not handled unless data pushed to buffers
@ 2018-07-11  8:32 Jorge Ramirez-Ortiz
  2018-07-11 12:29 ` Lorenzo Bianconi
  0 siblings, 1 reply; 10+ messages in thread
From: Jorge Ramirez-Ortiz @ 2018-07-11  8:32 UTC (permalink / raw)
  To: jramirez, jic23, lorenzo.bianconi
  Cc: knaack.h, lars, pmeerw, linux-iio, linux-kernel

Currently IRQ_NONE is returned only when there is no data on the fifo.

When there is no data on the fifo the driver can not push to the
buffers and therefore user space readers polling for data available
will not be awoken and continue to wait.

This commit just extends the same semantics to fifo read errors.

Signed-off-by: Jorge Ramirez-Ortiz <jramirez@baylibre.com>
---
 drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
index 4994f92..4959923 100644
--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
+++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
@@ -472,7 +472,7 @@ static irqreturn_t st_lsm6dsx_handler_thread(int irq, void *private)
 	count = st_lsm6dsx_read_fifo(hw);
 	mutex_unlock(&hw->fifo_lock);
 
-	return !count ? IRQ_NONE : IRQ_HANDLED;
+	return (!count || count < 0) ? IRQ_NONE : IRQ_HANDLED;
 }
 
 static int st_lsm6dsx_buffer_preenable(struct iio_dev *iio_dev)
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2018-07-12  7:59 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-11  8:32 [PATCH] iio: imu: st_lsm6dsx: irq not handled unless data pushed to buffers Jorge Ramirez-Ortiz
2018-07-11 12:29 ` Lorenzo Bianconi
2018-07-11 13:24   ` Jorge Ramirez-Ortiz
2018-07-11 14:17     ` Lorenzo Bianconi
2018-07-11 15:26     ` Lorenzo Bianconi
2018-07-11 16:00       ` Jorge Ramirez-Ortiz
2018-07-11 16:34         ` Lorenzo Bianconi
2018-07-11 16:59           ` Jorge Ramirez-Ortiz
2018-07-11 17:07             ` Lorenzo Bianconi
2018-07-12  7:59             ` Lorenzo Bianconi

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).