From 21a829af60a7f5c7456f1f0ff9b6b0eff0ceb738 Mon Sep 17 00:00:00 2001 From: Imre Kaloz Date: Tue, 13 Oct 2026 14:02:07 +0200 Subject: [PATCH] rtc: ds1685: do not sleep in the power-off handler 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 Closes: https://lore.kernel.org/all/sashiko-outbox-169477@kernel.org/ Signed-off-by: Imre Kaloz Acked-by: Joshua Kinard Link: https://patch.msgid.link/20261013120208.11268-3-kaloz@kernel.org Signed-off-by: Alexandre Belloni --- 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 e251cb06842d..1c84c5debca1 100644 --- a/drivers/rtc/rtc-ds1685.c +++ b/drivers/rtc/rtc-ds1685.c @@ -1425,7 +1425,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));