lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250531-pcf8563-fix-alarm-v2-1-cac4b1716167@gmail.com>
Date: Sat, 31 May 2025 15:20:40 +0800
From: Troy Mitchell <troymitchell988@...il.com>
To: Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org, 
 Troy Mitchell <troymitchell988@...il.com>
Subject: [PATCH v2] rtc: pcf8563: fix wrong alarm register

When the regmap framework was introduced to this driver,
the PCF8563_REG_AMN register within the set_alarm function was
incorrectly changed to PCF8563_REG_SC.

The PCF8563_REG_SC register is the seconds register.
This caused alarm values to be written to the seconds register
when an alarm was set. Which means the alarm would not trigger
as expected and the seconds register would be overwritten
with an incorrect value.

Signed-off-by: Troy Mitchell <troymitchell988@...il.com>
---
Since this patch[1], the set_alarm function has been setting
an wrong register.

Link:
https://lore.kernel.org/all/20241010084949.3351182-3-iwamatsu@nigauri.org/ [1]
---
Changes in v2:
- Remove irrelevant changes
- Link to v1: https://lore.kernel.org/r/20250419-pcf8563-fix-alarm-v1-1-b893a5de55b8@gmail.com
---
 drivers/rtc/rtc-pcf8563.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c
index 5a084d426e58d09cfedf0809695a96a27627c420..b2611697fa5e3adc61f687e39385d10736dec677 100644
--- a/drivers/rtc/rtc-pcf8563.c
+++ b/drivers/rtc/rtc-pcf8563.c
@@ -285,7 +285,7 @@ static int pcf8563_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *tm)
 	buf[2] = bin2bcd(tm->time.tm_mday);
 	buf[3] = tm->time.tm_wday & 0x07;
 
-	err = regmap_bulk_write(pcf8563->regmap, PCF8563_REG_SC, buf,
+	err = regmap_bulk_write(pcf8563->regmap, PCF8563_REG_AMN, buf,
 				sizeof(buf));
 	if (err)
 		return err;

---
base-commit: 8560697b23dc2f405cb463af2b17256a9888129d
change-id: 20250419-pcf8563-fix-alarm-5e787f095861

Best regards,
-- 
Troy Mitchell <troymitchell988@...il.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ