From: Marek Szyprowski Date: Wed, 2 Dec 2020 11:13:17 +0000 (+0100) Subject: rtc: s3c: Disable all enable (RTC, tick) bits in the probe X-Git-Tag: accepted/tizen/unified/20230118.172025~8203^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31b16d978f902bd9ac7fdc20738f67e39959cd5c;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Alexandre Belloni Reviewed-by: Krzysztof Kozlowski Link: https://lore.kernel.org/r/20201202111318.5353-1-m.szyprowski@samsung.com --- diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 24a4190..16a326e9 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);