diff --git a/fs/timerfd.c b/fs/timerfd.c index d69ad801eb80..71fd26b93e93 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -238,6 +238,12 @@ static __poll_t timerfd_poll(struct file *file, poll_table *wait) spin_lock_irqsave(&ctx->wqh.lock, flags); if (ctx->ticks) events |= EPOLLIN; + + if (ctx->expired && isalarm(ctx)) + pr_info("%s: comm:%s pid:%d exp:%llu\n", __func__, + current->comm, current->pid, + ktime_to_ms(ctx->t.alarm.node.expires)); + spin_unlock_irqrestore(&ctx->wqh.lock, flags); return events; diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 4bb158755ef7..28000dd75592 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -63,6 +63,7 @@ static struct wakeup_source *ws; /* rtc timer and device for setting alarm wakeups at suspend */ static struct rtc_timer rtctimer; static struct rtc_device *rtcdev; +static int alarm_debug = 0; static DEFINE_SPINLOCK(rtcdev_lock); /** @@ -211,6 +212,12 @@ static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer) alarmtimer_dequeue(base, alarm); spin_unlock_irqrestore(&base->lock, flags); + if(alarm_debug & 0x1){ + pr_info("%s: type=%d, func=%pf, exp:%llu\n", __func__, + alarm->type, alarm->function, ktime_to_ms(alarm->node.expires)); + alarm_debug &= 0xFE; + } + if (alarm->function) restart = alarm->function(alarm, base->gettime()); @@ -252,6 +259,7 @@ static int alarmtimer_suspend(struct device *dev) struct rtc_device *rtc; unsigned long flags; struct rtc_time tm; + struct alarm* min_timer = NULL; spin_lock_irqsave(&freezer_delta_lock, flags); min = freezer_delta; @@ -278,6 +286,7 @@ static int alarmtimer_suspend(struct device *dev) continue; delta = ktime_sub(next->expires, base->gettime()); if (!min || (delta < min)) { + min_timer = container_of(next, struct alarm, node); expires = next->expires; min = delta; type = i; @@ -286,6 +295,14 @@ static int alarmtimer_suspend(struct device *dev) if (min == 0) return 0; + if (min_timer){ + pr_info("%s: [%p]type=%d, func=%pf, exp:%llu\n", __func__, + min_timer, min_timer->type, min_timer->function, + ktime_to_ms(min_timer->node.expires)); + min_timer = NULL; + } + alarm_debug = 0x1; + if (ktime_to_ns(min) < 2 * NSEC_PER_SEC) { __pm_wakeup_event(ws, 2 * MSEC_PER_SEC); return -EBUSY;