Skip to content

Commit

Permalink
rtc: s3c: Disable all enable (RTC, tick) bits in the probe
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Alexandre Belloni <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
mszyprow authored and alexandrebelloni committed Dec 3, 2020
1 parent 00c3348 commit 31b16d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/rtc/rtc-s3c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 31b16d9

Please sign in to comment.