rtc: zynqmp: Clear alarm interrupt status before interrupt enable
authorSrinivas Neeli <srinivas.neeli@xilinx.com>
Wed, 12 Feb 2020 10:24:39 +0000 (15:54 +0530)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Wed, 12 Feb 2020 11:21:42 +0000 (12:21 +0100)
commit4594d082dbe6385c2df6b838817ccd214c16b358
tree14f9a96b17e082ce1667a337757a00acb8fdd56c
parent38a49742de113746dfb954afe7b1b65a098a69a8
rtc: zynqmp: Clear alarm interrupt status before interrupt enable

Fix multiple occurring interrupts for alarm interrupt. RTC module doesn't
clear the alarm interrupt status bit immediately after the interrupt is
triggered.This is due to the sticky nature of the alarm interrupt status
register. The alarm interrupt status register can be cleared only after
the second counter outruns the set alarm value. To fix multiple spurious
interrupts, disable alarm interrupt in the handler and clear the status
bit before enabling the alarm interrupt.

Fixes: 11143c19eb57 ("rtc: add xilinx zynqmp rtc driver")
Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/1581503079-387-1-git-send-email-srinivas.neeli@xilinx.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-zynqmp.c