Skip to content

Commit

Permalink
rtc/ab8500: set uie_unsupported flag
Browse files Browse the repository at this point in the history
Currently, ab8500 doesn't set uie_unsupported of rtc_device, while it
doesn't support UIE, see ab8500_rtc_set_alarm().

Thus, when going through rtc_update_irq_enable()->rtc_timer_enqueue(),
there's a chance it has an alarm timer1 queued before which is going to
fired, so this update timer2 will be queued because it isn't the leftmost
one, which means rtc_timer_enqueue() will return 0.

This will result in two problems:
1) UIE EMUL will not be used.
2) When the alarm timer1 is fired, in rtc_timer_do_work() timer2 will
   fail to set the alarm time, so this rtc will disfunctional due to
   timer2 with the earliest expires in the timerqueue.

So, rtc drivers must set this flag if they don't support UIE.

Signed-off-by: Xunlei Pang <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: John Stultz <[email protected]>
Cc: Arnd Bergmann <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Xunlei Pang authored and torvalds committed Dec 11, 2014
1 parent 7654e9d commit c594d67
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/rtc/rtc-ab8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@ static int ab8500_rtc_probe(struct platform_device *pdev)
return err;
}

rtc->uie_unsupported = 1;

return 0;
}

Expand Down

0 comments on commit c594d67

Please sign in to comment.