Problem Summary
EPOLLERR is always set, as part of epoll_wait() return status, even under no error condition.
Platform Summary
- i.MX6SDL Board
- Kernel Version :: 4.1.15
- rootfs :: Ubuntu Xenial repo
Description
From user space app, I use epoll mechanism to monitor & capture GPIO events.
Functionality looks ok as expected. but I observe EPOLLERR ( epoll event flag ) is
always set, but epoll_wait() returns +ve return value ( indicates no error ).
I tried to investigate the source of event flag EPOLLERR.
With help of ftrace (ftrace-function-flowgraph.zip), I managed
to get the below simplified sequence flow graph (epoll-gpio-EPOLLERR-trace-sfg.png).
I unable to trace out How IMX GPIO ISR status value is get transformed
to ePoll event flags in below simplified ISR sequence flow.
gic_handle_irq() {irq-gic.c} --> \
mx3_gpio_irq_handler() {gpio-mxc.c} [ reading & broadcasting GPIO_ISR status value ] --> \
gpio_sysfs_irq() {gpiolib-sysfs.c} --> \
ep_poll_callback() {eventpoll.c}
Note :: I tried with different set of epoll event mask to epoll_ctl() &
with increased timeout value to epoll_wait(). But no change in behaviour.
Like to know in community does any one come across similar kind of issue.
Hi RajeshKumar
one can look at epoll documentation
Quick test using epoll to wait on GPIO events · GitHub
In general since this is not specific i.MX issue it can be posted on
kernel mail list
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------