+ rtc-isl12022-properly-handle-military-hour-format-fix.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     rtc-isl12022-properly-handle-military-hour-format-fix.txt
has been added to the -mm tree.  Its filename is
     rtc-isl12022-properly-handle-military-hour-format-fix.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: rtc-isl12022-properly-handle-military-hour-format-fix.txt
From: Roman Fietze <roman.fietze@xxxxxxxxxxxxx>

The patch corrects a bug that could only be found after some testing,
because it happens only when reading the time between 20:00 and
24:00UTC.

Accidently my previous patch for this driver masks out the highest bit
of the BCD hour, which is also the AM/PM indicator if not in MIL mode,
always resulting in hours below 20. The error was not detected when
reviewing the patch, because the fact was missed, that ISL register
values are all BCD and not binary, and therefore a mask of 0x1F cannot
hold all values from 0..23.

The proper solution is to always set the MIL bit when writing the
hour, and of course masking with 0x3F, properly keeping both hour BCD
digits.

Signed-off-by: Roman Fietze <roman.fietze@xxxxxxxxxxxxx>
Cc: Wan ZongShun <mcuos.com@xxxxxxxxx>
Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/rtc/rtc-isl12022.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/rtc/rtc-isl12022.c~rtc-isl12022-properly-handle-military-hour-format-fix drivers/rtc/rtc-isl12022.c
--- a/drivers/rtc/rtc-isl12022.c~rtc-isl12022-properly-handle-military-hour-format-fix
+++ a/drivers/rtc/rtc-isl12022.c
@@ -135,7 +135,7 @@ static int isl12022_get_datetime(struct 
 
 	tm->tm_sec = bcd2bin(buf[ISL12022_REG_SC] & 0x7F);
 	tm->tm_min = bcd2bin(buf[ISL12022_REG_MN] & 0x7F);
-	tm->tm_hour = bcd2bin(buf[ISL12022_REG_HR] & 0x1F);
+	tm->tm_hour = bcd2bin(buf[ISL12022_REG_HR] & 0x3F);
 	tm->tm_mday = bcd2bin(buf[ISL12022_REG_DT] & 0x3F);
 	tm->tm_wday = buf[ISL12022_REG_DW] & 0x07;
 	tm->tm_mon = bcd2bin(buf[ISL12022_REG_MO] & 0x1F) - 1;
_

Patches currently in -mm which might be from roman.fietze@xxxxxxxxxxxxx are

rtc-add-intersil-isl12022-rtc-driver.patch
rtc-isl12022-properly-handle-military-hour-format.patch
rtc-isl12022-properly-handle-military-hour-format-fix.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux