forked from Minki/linux
f8245c2688
This fixes a common glitch in how RTC drivers handle two "set alarm" modes, by getting rid of the surprising/hidden one that was rarely implemented correctly (and which could expose nonportable hardware-specific behavior). The glitch comes from the /dev/rtcX logic implementing the legacy RTC_ALM_SET (limited to 24 hours, needing RTC_AIE_ON) ioctl on top of the RTC driver call providing access to the newer RTC_WKALM_SET (without those limitations) by initializing the day/month/year fields to be invalid ... that second mode. Now, since few RTC drivers check those fields, and most hardware misbehaves when faced with invalid date fields, many RTC drivers will set bogus alarm times on those RTC_ALM_SET code paths. (Several in-tree drivers have that issue, and I also noticed it with code reviews on several new RTC drivers.) This patch ensures that RTC drivers never see such invalid alarm fields, by moving some logic out of rtc-omap into the RTC_ALM_SET code and adding an explicit check (which will prevent the issue on other code paths). Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Scott Wood <scottwood@freescale.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> |
||
---|---|---|
.. | ||
class.c | ||
hctosys.c | ||
interface.c | ||
Kconfig | ||
Makefile | ||
rtc-at91rm9200.c | ||
rtc-bfin.c | ||
rtc-cmos.c | ||
rtc-core.h | ||
rtc-dev.c | ||
rtc-ds1307.c | ||
rtc-ds1553.c | ||
rtc-ds1672.c | ||
rtc-ds1742.c | ||
rtc-ep93xx.c | ||
rtc-isl1208.c | ||
rtc-lib.c | ||
rtc-m48t86.c | ||
rtc-max6900.c | ||
rtc-max6902.c | ||
rtc-omap.c | ||
rtc-pcf8563.c | ||
rtc-pcf8583.c | ||
rtc-pl031.c | ||
rtc-proc.c | ||
rtc-rs5c313.c | ||
rtc-rs5c348.c | ||
rtc-rs5c372.c | ||
rtc-s3c.c | ||
rtc-sa1100.c | ||
rtc-sh.c | ||
rtc-sysfs.c | ||
rtc-test.c | ||
rtc-v3020.c | ||
rtc-vr41xx.c | ||
rtc-x1205.c |