]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
rtc: fix ds1388 time corruption
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Tue, 29 Jun 2010 22:05:34 +0000 (15:05 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 Aug 2010 17:20:53 +0000 (10:20 -0700)
commit8ab78dc05e61a6840a041d1a973616e9815dd84c
treeab45865288161d7814a06c78f1a9f67ce29d853b
parentdc6330590fbd5fad17f06663c5f0bed834054b2b
rtc: fix ds1388 time corruption

commit 96fc3a45ea073136566f3c2676cad52f8b39a7df upstream.

The ds1307 driver misreads the ds1388 registers when checking for 12 or 24
hour mode.  Instead of checking the hour register it reads the minute
register.  Therefore the driver thinks minutes >= 40 has the 12HR bit set
and resets the minute register by zeroing the high bits.  This results in
minutes are reset to 0-9, jumping back in time 40 or 50 minutes.  The time
jump is also written back to the RTC.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Cc: Wan ZongShun <mcuos.com@gmail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/rtc/rtc-ds1307.c