mirror of
https://github.com/rd-stuffs/msm-4.14.git
synced 2025-02-20 11:45:48 +08:00
alarmtimer: Don't fail on wakeup
Userspace abuses alarmtimers, let's relax the check and not fail suspend. Change-Id: I0dc7e3988e98c573676b618c71d575ba81966a5a Signed-off-by: celtare21 <celtare21@gmail.com> Signed-off-by: Richard Raya <rdxzv.dev@gmail.com>
This commit is contained in:
parent
cf2c1b628e
commit
66f6f139c4
@ -72,7 +72,7 @@ static void alarmtimer_triggered_func(void *p)
|
|||||||
|
|
||||||
if (!(rtc->irq_data & RTC_AF))
|
if (!(rtc->irq_data & RTC_AF))
|
||||||
return;
|
return;
|
||||||
__pm_wakeup_event(ws, 2 * MSEC_PER_SEC);
|
__pm_wakeup_event(ws, MSEC_PER_SEC / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct rtc_task alarmtimer_rtc_task = {
|
static struct rtc_task alarmtimer_rtc_task = {
|
||||||
@ -312,10 +312,8 @@ static int alarmtimer_suspend(struct device *dev)
|
|||||||
if (min == 0)
|
if (min == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (ktime_to_ns(min) < 2 * NSEC_PER_SEC) {
|
if (ktime_to_ns(min) < NSEC_PER_SEC / 2)
|
||||||
__pm_wakeup_event(ws, 2 * MSEC_PER_SEC);
|
__pm_wakeup_event(ws, MSEC_PER_SEC / 2);
|
||||||
return -EBUSY;
|
|
||||||
}
|
|
||||||
|
|
||||||
trace_alarmtimer_suspend(expires, type);
|
trace_alarmtimer_suspend(expires, type);
|
||||||
|
|
||||||
@ -328,7 +326,7 @@ static int alarmtimer_suspend(struct device *dev)
|
|||||||
/* Set alarm, if in the past reject suspend briefly to handle */
|
/* Set alarm, if in the past reject suspend briefly to handle */
|
||||||
ret = rtc_timer_start(rtc, &rtctimer, now, 0);
|
ret = rtc_timer_start(rtc, &rtctimer, now, 0);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
__pm_wakeup_event(ws, MSEC_PER_SEC);
|
__pm_wakeup_event(ws, MSEC_PER_SEC / 2);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user