]> git.baikalelectronics.ru Git - kernel.git/commit
gpiolib: fix line event timestamps for nested irqs
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Fri, 4 Jan 2019 10:24:20 +0000 (11:24 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 23 Jan 2019 16:24:01 +0000 (17:24 +0100)
commit5964d74382930cdba801ec385a90392d19cada29
tree837ac0c44192f43def42e7fe9cd17c6358ea46c8
parent2d43e556a90346650706f5ac3df055cddfa5690c
gpiolib: fix line event timestamps for nested irqs

Nested interrupts run inside the calling thread's context and the top
half handler is never called which means that we never read the
timestamp.

This issue came up when trying to read line events from a gpiochip
using regmap_irq_chip for interrupts.

Fix it by reading the timestamp from the irq thread function if it's
still 0 by the time the second handler is called.

Fixes: a436763a7854 ("gpio: Timestamp events in hardirq handler")
Cc: stable@vger.kernel.org
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpiolib.c