提交 081d83a3 编写于 作者: N Nick Bowler 提交者: Wim Van Sebroeck

watchdog: sp805: Flush posted writes in enable/disable.

There are no reads in these functions, so if MMIO writes are posted,
the writes in enable/disable may not have completed by the time these
functions return.  If the functions run from different CPUs, it's
in theory possible for the writes to be interleaved, which would be
disastrous for this driver.

At the very least, we need an mmiowb() before releasing the lock, but
since it seems desirable for the watchdog timer to be actually stopped
or reset when these functions return, read the lock register to force
the writes out.
Signed-off-by: NNick Bowler <nbowler@elliptictech.com>
Signed-off-by: NWim Van Sebroeck <wim@iguana.be>
上级 da3e5150
......@@ -134,6 +134,8 @@ static void wdt_enable(void)
writel(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL);
writel(LOCK, wdt->base + WDTLOCK);
/* Flush posted writes. */
readl(wdt->base + WDTLOCK);
spin_unlock(&wdt->lock);
}
......@@ -146,6 +148,8 @@ static void wdt_disable(void)
writel(0, wdt->base + WDTCONTROL);
writel(LOCK, wdt->base + WDTLOCK);
/* Flush posted writes. */
readl(wdt->base + WDTLOCK);
spin_unlock(&wdt->lock);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册