On Dec 15 2011, Lars-Peter Clausen wrote:
Hi, Currently it is possible to open the iio device chrdev file multiple times. Since we only support one reader for the buffer at a time this can cause problems. There is a busy flag for the buffer, which is cleared when the buffer is released. But the flag is never set and never tested. I suppose this is a left over from the merge of the event and buffer chrdevs into one. Events btw. still implement the busy logic and you can only get one event file descriptor at a time.
oops. Sounds like this feel by the way side at some point... Definitely want to prevent multiple readers of a buffer. If we really have a use case for it then we can allow multiple instances of the buffer. (not that I'm suggesting we do have a user).
Should we add a per iio device busy flag which only allows one open file descriptor of the iio device chrdev at a time? This has the downside that it will no longer be possible for one application to listen to the events of the device and for another application to read from the buffer. But I suppose the use-case for this is rather limited anyway.
Single busy flag sounds like the best plan to me. The usecase where it gets in the way is pretty unlikely anyway. Jonathan -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html