]> git.itanic.dy.fi Git - linux-stable/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)
commit1033be58992f818dc564196ded2bcc3f360bc297
tree837ac0c44192f43def42e7fe9cd17c6358ea46c8
parent2486e67374aa8b7854c2de32869642c2873b3d53
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: d58f2bf261fd ("gpio: Timestamp events in hardirq handler")
Cc: stable@vger.kernel.org
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpiolib.c