summaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2020-12-02 12:13:17 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2020-12-03 23:51:30 +0100
commit31b16d978f902bd9ac7fdc20738f67e39959cd5c (patch)
tree4389e6972a46d112b9726654a330d83ca154cb95 /drivers/rtc
parent00c33482bb6110bce8110daa351f9b3baf4df7dc (diff)
downloadlinux-31b16d978f902bd9ac7fdc20738f67e39959cd5c.tar.gz
linux-31b16d978f902bd9ac7fdc20738f67e39959cd5c.tar.bz2
linux-31b16d978f902bd9ac7fdc20738f67e39959cd5c.zip
rtc: s3c: Disable all enable (RTC, tick) bits in the probe
Bootloader might use RTC hardware and leave it in the enabled state. Ensure that the potentially enabled periodic tick interrupts are disabled before enabling the driver, because they might cause lockup if tick interrupt happens after disabling RTC gate clock. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20201202111318.5353-1-m.szyprowski@samsung.com
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-s3c.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c
index 24a41909f049..16a326e95d46 100644
--- a/drivers/rtc/rtc-s3c.c
+++ b/drivers/rtc/rtc-s3c.c
@@ -503,6 +503,10 @@ static int s3c_rtc_probe(struct platform_device *pdev)
goto err_src_clk;
}
+ /* disable RTC enable bits potentially set by the bootloader */
+ if (info->data->disable)
+ info->data->disable(info);
+
/* check to see if everything is setup correctly */
if (info->data->enable)
info->data->enable(info);