summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorLinus Walleij2019-02-17 21:59:33 +0100
committerLinus Walleij2019-02-17 21:59:33 +0100
commit8fab3d713ca36bf4ad4dadec0bf38f5e70b8999d (patch)
tree18cdadced0870584ceffa02eed47f4c86da8263c /drivers/gpio/gpiolib.c
parentspmi: pmic-arb: select IRQ_DOMAIN_HIERARCHY in Kconfig (diff)
parentgpio: altera-a10sr: Trivial coding style fix (diff)
downloadkernel-qcow2-linux-8fab3d713ca36bf4ad4dadec0bf38f5e70b8999d.tar.gz
kernel-qcow2-linux-8fab3d713ca36bf4ad4dadec0bf38f5e70b8999d.tar.xz
kernel-qcow2-linux-8fab3d713ca36bf4ad4dadec0bf38f5e70b8999d.zip
Merge tag 'gpio-v5.1-updates-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into devel
gpio updates for v5.1 - support for a new variant of pca953x - documentation fix from Wolfram - some tegra186 name changes - two minor fixes for madera and altera-a10sr
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 9be4c9401172..144af0733581 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -828,7 +828,14 @@ static irqreturn_t lineevent_irq_thread(int irq, void *p)
/* Do not leak kernel stack to userspace */
memset(&ge, 0, sizeof(ge));
- ge.timestamp = le->timestamp;
+ /*
+ * We may be running from a nested threaded interrupt in which case
+ * we didn't get the timestamp from lineevent_irq_handler().
+ */
+ if (!le->timestamp)
+ ge.timestamp = ktime_get_real_ns();
+ else
+ ge.timestamp = le->timestamp;
if (le->eflags & GPIOEVENT_REQUEST_RISING_EDGE
&& le->eflags & GPIOEVENT_REQUEST_FALLING_EDGE) {