On Sun, Aug 19, 2018 at 7:22 PM Bartosz Golaszewski <brgl@xxxxxxxx> wrote: > While your concern is real I think that our approach is mostly fine - > we try to read the value as soon as we can in the interrupt handler. > > What we could do however for some theoretical improvement is use > gpiod_get_value() since we're in non-sleeping context and maybe even > call it as the very first operation - even before calling > ktime_get_real_ns(). We can call *get_value() directly in the hard interrupt handler lineevent_irq_handler() if and only if the IRQ handler does not sleep, such as MMIO GPIO, but not on I2C expanders for example. The code is written to deal with any cases and assuming the worst so right now it is just timestamping in the hop half. But we could check if .can_sleep() is set on the struct gpio_chip and if it isn't, just read the value directly in the hardirq handler. Yours, Linus Walleij