forked from rubenslte/android_kernel_samsung_msm8226
kernel: alarm: :fix the BUG that device automatically powers on
The value of alarm.time is invalid if we get it by:
memset(&alarm, 0, sizeof(alarm)).
So function of rtc_set_alarm aborts before it really calls into:
rtc->ops->set_alarm.
Then we can`t disable the RTC alarm by that. The result is some
alarms enabled by alarm_suspend are not disabled correctly during
alarm_resume. And device will automatically power on.
CRs-fixed: 524051
Change-Id: Ibc99e62878d17ad4f50325630bf0862207e2cf3f
Signed-off-by: Figo Wang <figow@codeaurora.org>
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
parent
ac40291a80
commit
1b2c1c64aa
+2
-2
@@ -455,7 +455,7 @@ static int alarm_suspend(struct platform_device *pdev, pm_message_t state)
|
||||
rtc_delta.tv_sec, rtc_delta.tv_nsec);
|
||||
if (rtc_current_time + 1 >= rtc_alarm_time) {
|
||||
pr_alarm(SUSPEND, "alarm about to go off\n");
|
||||
memset(&rtc_alarm, 0, sizeof(rtc_alarm));
|
||||
rtc_time_to_tm(0, &rtc_alarm.time);
|
||||
rtc_alarm.enabled = 0;
|
||||
rtc_set_alarm(alarm_rtc_dev, &rtc_alarm);
|
||||
|
||||
@@ -480,7 +480,7 @@ static int alarm_resume(struct platform_device *pdev)
|
||||
|
||||
pr_alarm(SUSPEND, "alarm_resume(%p)\n", pdev);
|
||||
|
||||
memset(&alarm, 0, sizeof(alarm));
|
||||
rtc_time_to_tm(0, &alarm.time);
|
||||
alarm.enabled = 0;
|
||||
rtc_set_alarm(alarm_rtc_dev, &alarm);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user