aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
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 1651d7f0a303..d1adfdf50fb3 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)
828 /* Do not leak kernel stack to userspace */ 828 /* Do not leak kernel stack to userspace */
829 memset(&ge, 0, sizeof(ge)); 829 memset(&ge, 0, sizeof(ge));
830 830
831 ge.timestamp = le->timestamp; 831 /*
832 * We may be running from a nested threaded interrupt in which case
833 * we didn't get the timestamp from lineevent_irq_handler().
834 */
835 if (!le->timestamp)
836 ge.timestamp = ktime_get_real_ns();
837 else
838 ge.timestamp = le->timestamp;
832 839
833 if (le->eflags & GPIOEVENT_REQUEST_RISING_EDGE 840 if (le->eflags & GPIOEVENT_REQUEST_RISING_EDGE
834 && le->eflags & GPIOEVENT_REQUEST_FALLING_EDGE) { 841 && le->eflags & GPIOEVENT_REQUEST_FALLING_EDGE) {