EPOLLERR is always set, as part of epoll_wait() return status, even under no error condition

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EPOLLERR is always set, as part of epoll_wait() return status, even under no error condition

1,942 Views
rajeshkumarraje
Contributor I

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

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.

0 Kudos
1 Reply

1,600 Views
igorpadykov
NXP Employee
NXP Employee

Hi RajeshKumar

one can look at epoll documentation

Quick test using epoll to wait on GPIO events · GitHub 

epoll(7) - Linux manual page 

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos