[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1614670085-26229-2-git-send-email-Fengquan.Chen@mediatek.com>
Date: Tue, 2 Mar 2021 15:28:05 +0800
From: Fengquan Chen <Fengquan.Chen@...iatek.com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
Matthias Brugger <matthias.bgg@...il.com>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-mediatek@...ts.infradead.org>
CC: <fengquan.chen@...iatek.com>, <dehui.sun@...iatek.com>,
Fengquan Chen <Fengquan.Chen@...iatek.com>
Subject: [PATCH] clocksource/drivers/timer-mediatek: optimize systimer irq clear flow on Mediatek Socs
1)ensure systimer is enabled before clear and disable interrupt, which only
for systimer in Mediatek Socs.
2)clear any pending timer-irq when shutdown to keep suspend flow clean,
when use systimer as tick-broadcast timer
Change-Id: Ia3eda83324af2fdaf5cbb3569a9bf020a11f8009
Signed-off-by: Fengquan Chen <fengquan.chen@...iatek.com>
---
drivers/clocksource/timer-mediatek.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/clocksource/timer-mediatek.c b/drivers/clocksource/timer-mediatek.c
index 9318edc..9f1f095dc 100644
--- a/drivers/clocksource/timer-mediatek.c
+++ b/drivers/clocksource/timer-mediatek.c
@@ -75,6 +75,7 @@
static void mtk_syst_ack_irq(struct timer_of *to)
{
/* Clear and disable interrupt */
+ writel(SYST_CON_EN, SYST_CON_REG(to));
writel(SYST_CON_IRQ_CLR | SYST_CON_EN, SYST_CON_REG(to));
}
@@ -111,6 +112,9 @@ static int mtk_syst_clkevt_next_event(unsigned long ticks,
static int mtk_syst_clkevt_shutdown(struct clock_event_device *clkevt)
{
+ /* Clear any irq */
+ mtk_syst_ack_irq(to_timer_of(clkevt));
+
/* Disable timer */
writel(0, SYST_CON_REG(to_timer_of(clkevt)));
--
1.8.1.1.dirty
Powered by blists - more mailing lists