2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-15 16:53:54 +08:00
linux-next/drivers/rtc
David Brownell f8245c2688 rtc: remove "RTC_ALM_SET mode" bugs
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>
2007-05-08 11:15:19 -07:00
..
class.c rtc: update to class device removal patches 2007-05-08 11:15:18 -07:00
hctosys.c rtc: remove rest of class_device 2007-05-08 11:15:18 -07:00
interface.c rtc: remove "RTC_ALM_SET mode" bugs 2007-05-08 11:15:19 -07:00
Kconfig RTC Kconfig cleanup 2007-05-08 11:15:18 -07:00
Makefile rtc: simplified /proc/driver/rtc handling 2007-05-08 11:15:18 -07:00
rtc-at91rm9200.c rtc: suspend()/resume() restores system clock 2007-05-08 11:15:18 -07:00
rtc-bfin.c Blackfin: on-chip RTC controller driver 2007-05-07 12:12:58 -07:00
rtc-cmos.c rtc-cmos wakeup interface 2007-05-08 11:15:18 -07:00
rtc-core.h rtc: update to class device removal patches 2007-05-08 11:15:18 -07:00
rtc-dev.c rtc: remove "RTC_ALM_SET mode" bugs 2007-05-08 11:15:19 -07:00
rtc-ds1307.c [PATCH] RTC: build fixes 2006-10-04 08:15:14 -07:00
rtc-ds1553.c rtc: rtc interfaces don't use class_device 2007-05-08 11:15:18 -07:00
rtc-ds1672.c i2c: Stop using i2c_adapter.class_dev 2007-02-13 22:09:04 +01:00
rtc-ds1742.c [PATCH] change __init to __devinit in 2 rtc drivers 2007-02-12 09:48:30 -08:00
rtc-ep93xx.c [PATCH] constify rtc_class_ops: update drivers 2006-10-01 00:39:25 -07:00
rtc-isl1208.c [PATCH] constify rtc_class_ops: update drivers 2006-10-01 00:39:25 -07:00
rtc-lib.c revert "rtc: Add rtc_merge_alarm()" 2007-05-08 11:15:18 -07:00
rtc-m48t86.c [PATCH] constify rtc_class_ops: update drivers 2006-10-01 00:39:25 -07:00
rtc-max6900.c rtc: add RTC class driver for the Maxim MAX6900 2007-05-08 11:15:03 -07:00
rtc-max6902.c [PATCH] rtc-max6902: month conversion fix 2006-10-17 08:18:44 -07:00
rtc-omap.c rtc: remove "RTC_ALM_SET mode" bugs 2007-05-08 11:15:19 -07:00
rtc-pcf8563.c i2c: Stop using i2c_adapter.class_dev 2007-02-13 22:09:04 +01:00
rtc-pcf8583.c [ARM] rtc-pcf8583: Final fixes for this RTC on RiscPC 2007-03-04 20:33:07 +00:00
rtc-pl031.c rtc: rtc interfaces don't use class_device 2007-05-08 11:15:18 -07:00
rtc-proc.c rtc: remove rest of class_device 2007-05-08 11:15:18 -07:00
rtc-rs5c313.c RTC: add rtc-rs5c313 driver 2007-05-08 11:15:03 -07:00
rtc-rs5c348.c [PATCH] constify rtc_class_ops: update drivers 2006-10-01 00:39:25 -07:00
rtc-rs5c372.c i2c: Stop using i2c_adapter.class_dev 2007-02-13 22:09:04 +01:00
rtc-s3c.c rtc: suspend()/resume() restores system clock 2007-05-08 11:15:18 -07:00
rtc-sa1100.c rtc: rtc interfaces don't use class_device 2007-05-08 11:15:18 -07:00
rtc-sh.c rtc: rtc interfaces don't use class_device 2007-05-08 11:15:18 -07:00
rtc-sysfs.c rtc: remove rest of class_device 2007-05-08 11:15:18 -07:00
rtc-test.c rtc: rtc interfaces don't use class_device 2007-05-08 11:15:18 -07:00
rtc-v3020.c [PATCH] rtc: fix printk of 64-bit res on 32-bit platform 2006-10-17 08:18:47 -07:00
rtc-vr41xx.c rtc: update vr41xx alarm handling 2007-05-08 11:15:18 -07:00
rtc-x1205.c i2c: Stop using i2c_adapter.class_dev 2007-02-13 22:09:04 +01:00