[PATCH v2 2/3] rtc: ds1685: do not sleep in the power-off handler
From: Imre Kaloz
Date: Tue Oct 13 2026 - 08:58:17 EST
Power-off handlers run from an atomic notifier chain and must not
sleep. Use mdelay() for the delay before setting PAB.
Fixes: aaaf5fbf56f1 ("rtc: add driver for DS1685 family of real time clocks")
Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
Closes: https://lore.kernel.org/all/sashiko-outbox-169477@xxxxxxxxxx/
Signed-off-by: Imre Kaloz <kaloz@xxxxxxxxxx>
---
drivers/rtc/rtc-ds1685.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-ds1685.c b/drivers/rtc/rtc-ds1685.c
index 94c89333c5d5..123ab9fc9c8d 100644
--- a/drivers/rtc/rtc-ds1685.c
+++ b/drivers/rtc/rtc-ds1685.c
@@ -1426,7 +1426,7 @@ ds1685_rtc_poweroff(struct platform_device *pdev)
/* Set PAB to 1 in Control 4A to power the system down. */
dev_warn(&pdev->dev, "Powerdown.\n");
- msleep(20);
+ mdelay(20);
rtc->write(rtc, RTC_EXT_CTRL_4A,
(ctrl4a | RTC_CTRL_4A_PAB));
--
2.47.3