android_kernel_google_msm/drivers/watchdog
Uwe Kleine-König dd7ad96cc3 watchdog: omap: assert the counter being stopped before reprogramming
commit 530c11d432727c697629ad5f9d00ee8e2864d453 upstream.

The omap watchdog has the annoying behaviour that writes to most
registers don't have any effect when the watchdog is already running.
Quoting the AM335x reference manual:

	To modify the timer counter value (the WDT_WCRR register),
	prescaler ratio (the WDT_WCLR[4:2] PTV bit field), delay
	configuration value (the WDT_WDLY[31:0] DLY_VALUE bit field), or
	the load value (the WDT_WLDR[31:0] TIMER_LOAD bit field), the
	watchdog timer must be disabled by using the start/stop sequence
	(the WDT_WSPR register).

Currently the timer is stopped in the .probe callback but still there
are possibilities that yield to a situation where omap_wdt_start is
entered with the timer running (e.g. when /dev/watchdog is closed
without stopping and then reopened). In such a case programming the
timeout silently fails!

To circumvent this stop the timer before reprogramming.

Assuming one of the first things the watchdog user does is setting the
timeout explicitly nothing too bad should happen because this explicit
setting works fine.

Fixes: 7768a13c25 ("[PATCH] OMAP: Add Watchdog driver support")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-10-22 09:20:06 +08:00
..
Kconfig Merge git://www.linux-watchdog.org/linux-watchdog 2012-03-28 13:03:26 -07:00
Makefile watchdog: new driver for VIA chipsets 2012-01-06 15:33:41 +01:00
acquirewdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
advantechwdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
alim1535_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
alim7101_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
ar7_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
at32ap700x_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
at91rm9200_wdt.c Merge git://www.linux-watchdog.org/linux-watchdog 2012-03-28 13:03:26 -07:00
at91sam9_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
at91sam9_wdt.h ARM: at91: make watchdog drivers soc independent 2011-11-28 22:50:39 +08:00
ath79_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
bcm47xx_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
bcm63xx_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
bfin_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
booke_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
coh901327_wdt.c watchdog: coh901327_wdt.c: fix timeout 2012-03-27 20:15:57 +02:00
cpu5wdt.c watchdog: Use pr_<fmt> and pr_<level> 2012-03-27 19:59:26 +02:00
cpwd.c watchdog: Use pr_<fmt> and pr_<level> 2012-03-27 19:59:26 +02:00
davinci_wdt.c watchdog: convert drivers/watchdog/* to use module_platform_driver() 2012-01-06 15:17:25 +01:00
dw_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
ep93xx_wdt.c watchdog: ep93xx_wdt: timeout is an unsigned int value. 2012-03-27 20:15:24 +02:00
eurotechwdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
f71808e_wdt.c watchdog: Use pr_<fmt> and pr_<level> 2012-03-27 19:59:26 +02:00
gef_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
geodewdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
hpwdt.c hpwdt: Fix kdump issue in hpwdt 2012-10-02 10:30:08 -07:00
i6300esb.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
iTCO_vendor.h
iTCO_vendor_support.c watchdog: Use pr_<fmt> and pr_<level> 2012-03-27 19:59:26 +02:00
iTCO_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
ib700wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
ibmasr.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
imx2_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
indydog.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
intel_scu_watchdog.c watchdog: Use pr_<fmt> and pr_<level> 2012-03-27 19:59:26 +02:00
intel_scu_watchdog.h watchdog: Use pr_<fmt> and pr_<level> 2012-03-27 19:59:26 +02:00
iop_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
it87_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
it8712f_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
ixp4xx_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
ixp2000_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
jz4740_wdt.c watchdog: fix set_timeout operations 2012-03-27 20:08:09 +02:00
ks8695_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
lantiq_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
m54xx_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
machzwd.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
max63xx_wdt.c watchdog: Convert max63xx_wdt driver to watchdog framework 2012-03-27 20:06:59 +02:00
mixcomwd.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
mpc8xxx_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
mpcore_wdt.c watchdog: mpcore_wdt: Allow platform_get_irq() to fail 2012-03-27 20:14:20 +02:00
mtx-1_wdt.c watchdog: convert drivers/watchdog/* to use module_platform_driver() 2012-01-06 15:17:25 +01:00
mv64x60_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
nuc900_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
nv_tco.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
nv_tco.h
octeon-wdt-main.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
octeon-wdt-nmi.S
of_xilinx_wdt.c watchdog: Use pr_<fmt> and pr_<level> 2012-03-27 19:59:26 +02:00
omap_wdt.c watchdog: omap: assert the counter being stopped before reprogramming 2015-10-22 09:20:06 +08:00
omap_wdt.h watchdog: cleanup spaces before tabs 2011-03-15 16:02:27 +00:00
orion_wdt.c Merge git://www.linux-watchdog.org/linux-watchdog 2012-03-28 13:03:26 -07:00
pc87413_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
pcwd.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
pcwd_pci.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
pcwd_usb.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
pika_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
pnx833x_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
pnx4008_wdt.c watchdog: fix set_timeout operations 2012-03-27 20:08:09 +02:00
rc32434_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
rdc321x_wdt.c watchdog: convert drivers/watchdog/* to use module_platform_driver() 2012-01-06 15:17:25 +01:00
riowd.c watchdog: Use pr_<fmt> and pr_<level> 2012-03-27 19:59:26 +02:00
s3c2410_wdt.c watchdog: fix compiler error for missing parenthesis 2012-03-27 20:09:13 +02:00
sa1100_wdt.c ARM: cleanups of io includes 2012-03-29 18:02:10 -07:00
sb_wdog.c watchdog: Use pr_<fmt> and pr_<level> 2012-03-27 19:59:26 +02:00
sbc60xxwdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
sbc7240_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
sbc8360.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
sbc_epx_c3.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
sbc_fitpc2_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
sc520_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
sc1200wdt.c sc1200_wdt: Fix oops 2013-12-20 07:34:21 -08:00
sch311x_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
scx200_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
shwdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
smsc37b787_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
softdog.c watchdog: softdog: convert to watchdog core 2012-03-27 20:07:21 +02:00
sp805_wdt.c watchdog: sp805: Set watchdog_device->timeout from ->set_timeout() 2014-07-06 18:49:19 -07:00
sp5100_tco.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
sp5100_tco.h
stmp3xxx_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
ts72xx_wdt.c watchdog: ts72xx_wdt: locking bug in ioctl 2013-10-22 09:02:25 +01:00
twl4030_wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
txx9wdt.c watchdog: txx9wdt: fix timeout 2012-03-27 20:16:13 +02:00
via_wdt.c watchdog: fix set_timeout operations 2012-03-27 20:08:09 +02:00
w83627hf_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
w83697hf_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
w83697ug_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
w83877f_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
w83977f_wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
wafer5823wdt.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
watchdog_core.c watchdog: Use pr_<fmt> and pr_<level> 2012-03-27 19:59:26 +02:00
watchdog_dev.c watchdog: Add support for WDIOC_GETTIMELEFT IOCTL in watchdog core 2012-03-27 20:15:37 +02:00
watchdog_dev.h watchdog: WatchDog Timer Driver Core - Add basic framework 2011-07-28 08:01:04 +00:00
wd501p.h
wdrtas.c watchdog: nowayout is bool 2012-03-27 20:06:02 +02:00
wdt.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
wdt285.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
wdt977.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
wdt_pci.c Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
wm831x_wdt.c watchdog: fix set_timeout operations 2012-03-27 20:08:09 +02:00
wm8350_wdt.c watchdog: fix set_timeout operations 2012-03-27 20:08:09 +02:00
xen_wdt.c watchdog: xen: don't clear is_active when xen_wdt_stop() failed 2012-03-27 20:13:55 +02:00