* [PATCH] staging:iio:adc:max1363 ring_sw->kfifo conversion
@ 2012-05-30 19:44 Jonathan Cameron
2012-05-31 1:30 ` Ge Gao
0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Cameron @ 2012-05-30 19:44 UTC (permalink / raw)
To: linux-iio; +Cc: Jonathan Cameron
We are moving towards scrapping ring_sw so this move
is necessary.
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
drivers/staging/iio/adc/max1363_ring.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/iio/adc/max1363_ring.c b/drivers/staging/iio/adc/max1363_ring.c
index 73273c0..94377ed 100644
--- a/drivers/staging/iio/adc/max1363_ring.c
+++ b/drivers/staging/iio/adc/max1363_ring.c
@@ -16,7 +16,7 @@
#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
-#include "../ring_sw.h"
+#include <linux/iio/kfifo_buf.h>
#include <linux/iio/trigger_consumer.h>
#include "max1363.h"
@@ -100,7 +100,7 @@ int max1363_register_ring_funcs_and_init(struct iio_dev *indio_dev)
struct max1363_state *st = iio_priv(indio_dev);
int ret = 0;
- indio_dev->buffer = iio_sw_rb_allocate(indio_dev);
+ indio_dev->buffer = iio_kfifo_allocate(indio_dev);
if (!indio_dev->buffer) {
ret = -ENOMEM;
goto error_ret;
@@ -125,7 +125,7 @@ int max1363_register_ring_funcs_and_init(struct iio_dev *indio_dev)
return 0;
error_deallocate_sw_rb:
- iio_sw_rb_free(indio_dev->buffer);
+ iio_kfifo_free(indio_dev->buffer);
error_ret:
return ret;
}
@@ -134,5 +134,5 @@ void max1363_ring_cleanup(struct iio_dev *indio_dev)
{
/* ensure that the trigger has been detached */
iio_dealloc_pollfunc(indio_dev->pollfunc);
- iio_sw_rb_free(indio_dev->buffer);
+ iio_kfifo_free(indio_dev->buffer);
}
--
1.7.10.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] staging:iio:adc:max1363 ring_sw->kfifo conversion
2012-05-30 19:44 [PATCH] staging:iio:adc:max1363 ring_sw->kfifo conversion Jonathan Cameron
@ 2012-05-31 1:30 ` Ge Gao
0 siblings, 0 replies; 2+ messages in thread
From: Ge Gao @ 2012-05-31 1:30 UTC (permalink / raw)
To: Jonathan Cameron; +Cc: linux-iio
[-- Attachment #1: Type: text/plain, Size: 1071 bytes --]
Dear all,
I met a strange problem concerning IIO driver. I wrote a driver that
has trigger, ring buffer, just the standard way of doing things. It
sometimes runs OK. However, I found sometimes, the trigger is NOT triggered
at all. I am using a hardware interrupt to trigger a threaded ISR and
post-ISR. I can see the interrupt coming correctly. By using "cat
/proc/interrupts", I can see that the number of triggers stays the same
while the number of interrupt increases steadily.
I am using "iio_trigger_generic_data_rdy_poll" in the trigger. In the
post ISR, I am using "iio_trigger_notify_done".
I check the IIO trigger code. The trigger uses "trig->use_count" to do
things. If "trig->use_count" is not zero, nothing will happen. Where the
only place trig->use_count decreases is in "iio_trigger_notify_done". It is
possible that, if system is busy, that post ISR is NOT scheduled, such that
trig->use_count will NOT decrease. This would defeat all the mechanism of
trigger. Or there are other possibilities that would fail?
Thanks.
Best regards,
Ge GAO
[-- Attachment #2: Type: text/html, Size: 1211 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-31 1:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-30 19:44 [PATCH] staging:iio:adc:max1363 ring_sw->kfifo conversion Jonathan Cameron
2012-05-31 1:30 ` Ge Gao
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).