Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 954fed21 authored by Saravana Kannan's avatar Saravana Kannan Committed by Gerrit - the friendly Code Review server
Browse files

PM / devfreq: bimc-bwmon: Fix counter clearing



The counter needs to be cleared and acknowledged before clearing the IRQ
bits. Otherwise, the HW could set the IRQ bit again if the old counter
value was higher than the threshold. So, add a memory barrier after
clearing the counter.

Change-Id: I35f9f7905b05b8a185eb94d04d9c0a8ccfc2db51
Signed-off-by: default avatarSaravana Kannan <skannan@codeaurora.org>
parent b7868f12
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -78,6 +78,12 @@ static void mon_disable(struct bwmon *m)
static void mon_clear(struct bwmon *m)
{
	writel_relaxed(0x1, MON_CLEAR(m));
	/*
	 * The counter clear and IRQ clear bits are not in the same 4KB
	 * region. So, we need to make sure the counter clear is completed
	 * before we try to clear the IRQ or do any other counter operations.
	 */
	mb();
}

static void mon_irq_enable(struct bwmon *m)