]> git.karo-electronics.de Git - karo-tx-linux.git/commit
watchdog: sp805: Flush posted writes in enable/disable.
authorNick Bowler <nbowler@elliptictech.com>
Fri, 15 Jul 2011 15:04:02 +0000 (11:04 -0400)
committerWim Van Sebroeck <wim@iguana.be>
Fri, 22 Jul 2011 17:10:20 +0000 (17:10 +0000)
commit55e30c3a90abe9a022ea064c00aea06fd42aa152
treeb4c29c20a46487ab77752c88e503dc3edbeda972
parentd2df6e0d1e7947791b2f66eed96d82d5c3429c25
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: Nick Bowler <nbowler@elliptictech.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/sp805_wdt.c