User Space GPIO Interrupt programming - GSoC-2018
Dr. Rolf Jansen
freebsd-rj at obsigna.com
Fri Nov 27 22:45:41 UTC 2020
Am 27.11.2020 um 15:04 schrieb Ian Lepore <ian at freebsd.org>:
> On Fri, 2020-11-27 at 10:16 -0700, Ian Lepore wrote:
>> On Fri, 2020-11-27 at 14:28 +0300, Vladimir Goncharov wrote:
>>> Here it is.
>>> There is struct gpioc_event with pin number and bintime which is send
>>> to userspace.
>>>
>>> Also I'm thinking about to implementation notofication without extra
>>> reading from socket via struct kevent's extra fields (fflags/ext[4]),
>>> looks like it is possible.
>>>
>>
>> Please don't top-post on freebsd mailing lists.
>>
>> I think we need a way for the app to choose whether it wants simple
>> reporting of pin number (like the original code) perhaps along with a
>> count, versus requesting detailed per-event data. I'm going to propose
>> something more detailed about this as soon as I get my thoughts all
>> organized. I also want to get the original code and the locking fixes
>> I've done to it into a phab review for people to start looking at
>> before starting to do new major changes to it.
>>
>> Allocating memory in the interrupt handler isn't a good idea, it will
>> just increase latency on processing other pin interrupts and lead to
>> inaccurate timestamps. IMO, it would be better to allocate a fixed
>> array of events; when the app requests detailed event reporting it can
>> request the number of stored events it wants handled and we could
>> allocate all at once based on that.
>>
>
> The gsoc2018 code, with locking and style(9) fixes, is now at:
>
> https://reviews.freebsd.org/D27398
I got it working, and as expected, by your comments the level interrupt mode has been disabled. I am OK with this. Later, I will add more comments on this in my response to you other e-mail.
Best regards
Rolf
More information about the freebsd-arm
mailing list