]> git.karo-electronics.de Git - karo-tx-linux.git/commit
vrtc: change its year offset from 1960 to 1972
authorFeng Tang <feng.tang@intel.com>
Tue, 8 Nov 2011 00:19:52 +0000 (11:19 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 9 Nov 2011 02:10:05 +0000 (13:10 +1100)
commit8eed04cadaac301ae99dda7aac0a12bfcc430f44
treefab9b9c02035113b6fef444943348eb26752fba8
parentd260ecb85196d477ce27b89a622eef69e8392119
vrtc: change its year offset from 1960 to 1972

Real world year equals the value in vrtc YEAR register plus an offset.  We
used 1960 for original developepment as the offset to make leap year
consistent, but for a device's first use, its YEAR register is 0 and the
system year will be parsed as 1960 which is not a valid UNIX time and will
cause many applications to fail mysteriously.  Devices use 1972 instead to
fix this issue.

Updated patch which adds a sanity check suggested by Mathias

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/platform/mrst/vrtc.c
drivers/rtc/rtc-mrst.c