summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'mvebu-watchdog-3.15-2' of git://git.infradead.org/linux-mvebu ↵Olof Johansson2014-03-081-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | into next/drivers mvebu watchdog driver changes for v3.15 (incremental #2) - remove warnings by using %pa for phys_addr_t * tag 'mvebu-watchdog-3.15-2' of git://git.infradead.org/linux-mvebu: watchdog: orion_wdt: Use %pa to print 'phys_addr_t' Signed-off-by: Olof Johansson <olof@lixom.net>
| * watchdog: orion_wdt: Use %pa to print 'phys_addr_t'Fabio Estevam2014-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building an ARM multi_v7_defconfig with LPAE option selected we get the following build warning: drivers/watchdog/orion_wdt.c:272:2: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'phys_addr_t' [-Wformat=] Fix it by using %pa to print 'phys_addr_t'. Reported-by: Olof's autobuilder <build@lixom.net> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
* | Merge tag 'mvebu-watchdog-3.15' of git://git.infradead.org/linux-mvebu into ↵Arnd Bergmann2014-02-252-80/+303
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | next/drivers mvebu watchdog driver changes for v3.15 - orion watchdog - cleanup and extend driver to support Armada 370 and Armada XP Depends: - tags/irqchip-mvebu-fixes-3.14 (already pulled by tglx) - both are based on v3.14-rc1 * tag 'mvebu-watchdog-3.15' of git://git.infradead.org/linux-mvebu: watchdog: orion: Enable the build on ARCH_MVEBU watchdog: orion: Add support for Armada 370 and Armada XP SoC watchdog: orion: Add per-compatible watchdog start implementation watchdog: orion: Add per-compatible clock initialization watchdog: orion: Introduce per-compatible of_device_id data watchdog: orion: Introduce an orion_watchdog device structure watchdog: orion: Remove unneeded BRIDGE_CAUSE clear watchdog: orion: Make RSTOUT register a separate resource watchdog: orion: Handle the interrupt so it's properly acked watchdog: orion: Make sure the watchdog is initially stopped watchdog: orion: Remove unused macros watchdog: orion: Use atomic access for shared registers watchdog: orion: Add clock error handling Signed-off-by: Arnd Bergmann <arnd@arndb.de>
| * watchdog: orion: Enable the build on ARCH_MVEBUEzequiel Garcia2014-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | After adding support for Armada 370/XP SoC let's enable the build on these platforms. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| * watchdog: orion: Add support for Armada 370 and Armada XP SoCEzequiel Garcia2014-02-221-2/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the added infrastructure for handling SoC differences, this commit adds support for the watchdog controller available in Armada 370 and Armada XP SoCs. Also, and because the AXP clock initialization uses of_clk_get_by_name, this commit changes the orion clock initialization to use clk_get() and adds a proper clk_put() on the common exit/error paths. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| * watchdog: orion: Add per-compatible watchdog start implementationEzequiel Garcia2014-02-221-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To handle differences between SoCs this commit adds per-compatible string start() function for the watchdog kick-off. This is preparation work and makes no functionality changes to the current driver. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| * watchdog: orion: Add per-compatible clock initializationEzequiel Garcia2014-02-221-21/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Following the introduction of the compatible-data field, it's now possible to further abstract the clock initialization. This will allow to support SoC with a different clock setup. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| * watchdog: orion: Introduce per-compatible of_device_id dataEzequiel Garcia2014-02-221-19/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds an orion_watchdog_data structure to hold compatible-data information. This allows to remove the driver-wide definition and to be able to add support for multiple compatible-strings in the future. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| * watchdog: orion: Introduce an orion_watchdog device structureEzequiel Garcia2014-02-221-45/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | In order to prepare to support multiple compatible-strings, this commit adds a device structure to hold the driver's state. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| * watchdog: orion: Remove unneeded BRIDGE_CAUSE clearEzequiel Garcia2014-02-221-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After adding the IRQ request, the BRIDGE_CAUSE bit should be cleared by the bridge interrupt controller. There's no longer a need to do it in the watchdog driver, so we can simply remove it. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| * watchdog: orion: Make RSTOUT register a separate resourceEzequiel Garcia2014-02-221-3/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support other SoC, it's required to distinguish the 'control' timer register, from the 'rstout' register that enables system reset on watchdog expiration. To prevent a compatibility break, this commit adds a fallback to a hardcoded RSTOUT address. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| * watchdog: orion: Handle the interrupt so it's properly ackedEzequiel Garcia2014-02-221-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DT-enabled plaforms, where the irqchip driver for the brigde interrupt controller is available, can handle the watchdog IRQ properly. Therefore, request the interrupt and add a dummy handler that merely calls panic(). This is done in order to have an initial 'ack' of the interruption, which clears the watchdog state. Furthermore, since some platforms don't have such IRQ, this commit makes the interrupt specification optional. Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| * watchdog: orion: Make sure the watchdog is initially stoppedEzequiel Garcia2014-02-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having the watchdog initially fully stopped is important to avoid any spurious watchdog triggers, in case the registers are not in its reset state. If the watchdog rstout is enabled and the watchdog counter running, this initial stop is not performed, to comply with the 'nowayout' parameter. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| * watchdog: orion: Remove unused macrosEzequiel Garcia2014-02-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | These are not used anywhere so it's safe to remove them. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| * watchdog: orion: Use atomic access for shared registersEzequiel Garcia2014-02-221-37/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the timer control register is shared with the clocksource driver, use the recently introduced atomic_io_clear_set() to access such register. Given the watchdog core already provides serialization for all the watchdog ops, this commit allows to remove the spinlock entirely. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
| * watchdog: orion: Add clock error handlingEzequiel Garcia2014-02-221-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a check for clk_prepare_enable success and introduces an error path to disable the clock properly. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Tested-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Tested-By: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
* | watchdog: dw_wdt: Add dependency on HAS_IOMEMRichard Weinberger2014-02-081-0/+1
|/ | | | | | | | | | | On archs like S390 or um this driver cannot build nor work. Make it depend on HAS_IOMEM to bypass build failures. drivers/built-in.o: In function `dw_wdt_drv_probe': drivers/watchdog/dw_wdt.c:302: undefined reference to `devm_ioremap_resource' Signed-off-by: Richard Weinberger <richard@nod.at> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: w83627hf_wdt: Reset watchdog trigger during initializationGuenter Roeck2014-01-281-2/+2
| | | | | | | | If the watchdog has already triggered for whatever reason, it won't restart unless the trigger is reset. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: w83627hf: Add support for W83697HF and W83697UGGuenter Roeck2014-01-282-13/+51
| | | | | | | | Major difference is that the watchdog control and counter registers are different on both chips. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: w83627hf: Auto-detect IO address and supported chipsGuenter Roeck2014-01-282-24/+173
| | | | | | | | Instead of requiring the user to provide an IO address per module parameter, auto-detect it as well as supported chips. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: at91sam9_wdt: increase security margin on watchdog counter resetBoris BREZILLON2014-01-281-9/+16
| | | | | | | | | | | Try to reset the watchdog counter 4 or 2 times more often than actually requested, to avoid spurious watchdog reset. If this is not possible because of the min_heartbeat value, reset it at the min_heartbeat period. Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: at91sam9_wdt: avoid spurious watchdog reset during initBoris BREZILLON2014-01-281-1/+9
| | | | | | | | | | | | | | | | | | | | | Use the min_heartbeat value instead of the calculated heartbeat value for the first watchdog reset to avoid spurious watchdog reset. Resetting the watchdog counter during init might lead to a watchdog fault reset because the watchdog counter has to be running for at least min_heartbeat. Resetting the watchdog counter after heartbeat might lead to a watchdog timeout reset because the watchdog counter is running for more than max_heartbeat time. Using min_heartbeat instead of heartbeat does not guarantee that the watchdog won't trigger a reset, but at least it reduces the chances to be in such a case. Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: at91sam9_wdt: fix secs_to_ticksBoris BREZILLON2014-01-281-1/+1
| | | | | | | | Fix the secs_to_ticks macro in case 0 is passed as an argument. Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: at91sam9_wdt: better watchdog supportBoris BREZILLON2014-01-281-86/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The at91sam9 watchdog timer can only be configured once, and the current implementation tries to configure it in a static way: - 2 seconds timeout - wdt restart every 500ms If the timer has already been configured with different values, it returns an error and do not create any watchdog device. This is not critical if the watchdog is disabled, but if it has been enabled with different timeout values it will lead to a SoC reset. This patch series tries to address this issue by adapting the heartbeat value according the WDT timer config: - it first tries to configure the timer as requested. - if it fails it fallbacks to the current config, adapting its heartbeat timer to the needs This patch series also move to a dynamically allocated at91wdt device instead of the static instance. It adds a new at91 wdt type: software. This new type make use of the at91 wdt interrupt to trigger a software reboot. Finally it adds several properties to the device tree bindings. Signed-off-by: Boris BREZILLON <b.brezillon@overkiz.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: sp805_wdt depends also on ARM64Naresh Bhat2014-01-281-1/+1
| | | | | | | | Add sp805_wdt depends on ARM64. Signed-off-by: Naresh Bhat <naresh.bhat@linaro.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: mach-moxart: add restart handlerJonas Jensen2014-01-281-0/+15
| | | | | | | | | mach-moxart lacks a separate register for reset; as a workaround, add a function that can be hooked to arm_pm_restart. Signed-off-by: Jonas Jensen <jonas.jensen@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: mpc8xxx_wdt convert to watchdog coreChristophe Leroy2014-01-282-73/+38
| | | | | | | | Convert mpc8xxx_wdt.c to the new watchdog API. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: sirf: Remove redundant of_match_ptr helperSachin Kamat2014-01-281-1/+1
| | | | | | | | | 'sirfsoc_wdt_of_match' is always compiled in. Hence the helper macro is not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: hpwdt patch to display informative stringThomas Mingarelli2014-01-281-3/+8
| | | | | | | | | | | This patch is being submitted to output a general string when the panic comes in that informs the user of the possible places to look for the source of the NMI. Because various systems log the message in different places this would give a single display of where to go look instead of code that acts on all these different server names or IDs. Signed-off-by: Thomas Mingarelli <thomas.mingarelli@hp.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: dw_wdt: remove build dependenciesBaruch Siach2014-01-282-3/+2
| | | | | | | | | | There is nothing ARM specific in this driver, and we intend to use it on the Xtensa architecture. Also, clk.h now includes stubs for !CONFIG_HAVE_CLK, so the driver should build anyway. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Acked-by: Jamie Iles <jamie@jamieiles.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: imx2_wdt: disable watchdog timer during low power modeAnson Huang2014-01-281-0/+4
| | | | | | | | | | | We should set watchdog timer to be disabled in low power mode, as there is no service running in background, otherwise, system will reset unexpected. Signed-off-by: Anson Huang <b20788@freescale.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: s3c2410_wdt: Report when the watchdog reset the systemDoug Anderson2014-01-281-3/+37
| | | | | | | | | | | | | | | | | A good watchdog driver is supposed to report when it was responsible for resetting the system. Implement this for the s3c2410, at least on exynos5250 and exynos5420 where we already have a pointer to the PMU registers to read the information. Note that exynos4 SoCs also provide the reset status, but providing that is left as an exercise for future changes and is not plumbed up in this patch series. Also note the exynos4 SoCs don't appear to need any PMU config, which is why this patch separates the concepts of having PMU Registers vs. needing PMU Config. Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: s3c2410_wdt: use syscon regmap interface to configure pmu registerLeela Krishna Amudala2014-01-282-9/+146
| | | | | | | | | | | Add device tree support for exynos5250 and 5420 SoCs and use syscon regmap interface to configure AUTOMATIC_WDT_RESET_DISABLE and MASK_WDT_RESET_REQUEST registers of PMU to mask/unmask enable/disable of watchdog in probe and s2r scenarios. Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com> Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: s3c2410_wdt: Handle rounding a little better for timeoutDoug Anderson2014-01-281-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The existing watchdog timeout worked OK but didn't deal with rounding in an ideal way when dividing out all of its clocks. Specifically if you had a timeout of 32 seconds and an input clock of 66666666, you'd end up setting a timeout of 31.9998 seconds and reporting a timeout of 31 seconds. Specifically DBG printouts showed: s3c2410wdt_set_heartbeat: count=16666656, timeout=32, freq=520833 s3c2410wdt_set_heartbeat: timeout=32, divisor=255, count=16666656 (0000ff4f) and the final timeout reported to the user was: ((count / divisor) * divisor) / freq (0xff4f * 255) / 520833 = 31 (truncated from 31.9998) the technically "correct" value is: (0xff4f * 255) / (66666666.0 / 128) = 31.9998 By using "DIV_ROUND_UP" we can be a little more correct. s3c2410wdt_set_heartbeat: count=16666688, timeout=32, freq=520834 s3c2410wdt_set_heartbeat: timeout=32, divisor=255, count=16666688 (0000ff50) and the final timeout reported to the user: (0xff50 * 255) / 520834 = 32 the technically "correct" value is: (0xff50 * 255) / (66666666.0 / 128) = 32.0003 We'll use a DIV_ROUND_UP to solve this, generally erroring on the side of reporting shorter values to the user and setting the watchdog to slightly longer than requested: * Round input frequency up to assume watchdog is counting faster. * Round divisions by divisor up to give us extra time. At the same time we can avoid a for loop by just doing the right math. Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: s3c2410_wdt: Only register for cpufreq on ARM_S3C24XX_CPUFREQDoug Anderson2014-01-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | On modern SoCs the watchdog timer is parented on a clock that doesn't change every time we have a cpufreq change. That means we don't need to constantly adjust the watchdog timer, so avoid registering for and dealing with cpufreq transitions unless we've actually got CONFIG_ARM_S3C24XX_CPUFREQ defined. Note that this is more than just an optimization. The s3c2410 watchdog driver actually pats the watchdog on every CPU frequency change. On modern systems these happen many times per second (even in a system where "nothing" is happening). That effectively makes any userspace watchdog program useless (the watchdog is constantly patted by the kernel). If we need ARM_S3C24XX_CPUFREQ defined on a multiplatform kernel we'll need to make sure that kernel supports common clock and change this to user common clock framework. Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: GPIO-controlled watchdogAlexander Shiyan2014-01-283-0/+263
| | | | | | | | | This patch adds a watchdog driver for devices controlled through GPIO, (Analog Devices ADM706, Maxim MAX823, National NE555 etc). Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: davinci: reuse driver for keystone archIvan Khoronzhuk2014-01-282-3/+3
| | | | | | | | | | | | | The keystone arch uses the same IP watchdog, so add "ti,keystone-wdt" compatible and correct identity. The Keystone arch is using clocks in DT and source clock for watchdog has to be specified, so add this to binding. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: davinci: add GET_TIMELEFT option supportIvan Khoronzhuk2014-01-281-0/+26
| | | | | | | | | | | Currently, the davinci watchdog can be read while counting, so we can add ability to report the remaining time before the system will reboot. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: davinci: use davinci_wdt_device structure to hold device dataIvan Khoronzhuk2014-01-281-26/+48
| | | | | | | | | | | | Some SoCs, like Keystone 2, can support more than one WDT and each watchdog device has to use it's own base address, clock source, watchdog device, so add new davinci_wdt_device structure to hold device data. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Reviewed-by: Guenter roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: davinci: change driver to use WDT coreIvan Khoronzhuk2014-01-282-112/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | To reduce code duplicate and increase code readability use WDT core code to handle WDT interface. Remove io_lock as the WDT core uses mutex to lock each wdt device. Remove wdt_state as the WDT core tracks state with its own variable. The watchdog_init_timeout() can read timeout value from timeout-sec property if the passed value is out of bounds. The heartbeat is initialized in next way. If heartbeat is not set thought module parameter, try to read it's value from WDT node timeout-sec property. If node has no one, use default value. The heartbeat is hold in wdd->timeout by WDT core, so use it in order to set timeout period. Davinci WDT can't be stopped and once it's expired - it can be rearmed only after hardware reset, that's why nowayout feature is enforced. Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: bcm281xx: Debugfs supportMarkus Mayer2014-01-282-4/+114
| | | | | | | This change introduces debugfs support for the BCM281xx watchdog driver. Signed-off-by: Markus Mayer <markus.mayer@linaro.org> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: bcm281xx: Watchdog DriverMarkus Mayer2014-01-283-0/+281
| | | | | | | | | | This commit adds support for the watchdog timer used on the BCM281xx family of SoCs. Signed-off-by: Markus Mayer <markus.mayer@linaro.org> Reviewed-by: Matt Porter <matt.porter@linaro.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: core: Make dt "timeout-sec" property work on drivers w/out min/maxDoug Anderson2014-01-281-2/+2
| | | | | | | | | | | | | | | | | | | It is valid for a watchdog driver to have 0 for a "min" and "max" timeout if the driver doesn't need the core to enforce the concepts of min and max. The s3c2410_wdt driver is one such driver. Specifically it can be hard for that driver to come up with a static "max" on all platforms without a lot more information since the input clock on S3C2410 and S3C2440 can change with DVFS. As written, watchdog_init_timeout() will not ever read "timeout-sec" on these drivers since watchdog_timeout_invalid() will _never_ return true. Change to not consider a timeout_parm of 0 as valid even if min/max aren't specified by the driver. Also handle the case when there is no min/max and no "timeout-sec" property. Signed-off-by: Doug Anderson <dianders@chromium.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: remove DEFINE_PCI_DEVICE_TABLE macroJingoo Han2014-01-289-9/+9
| | | | | | | | | Don't use DEFINE_PCI_DEVICE_TABLE macro, because this macro is not preferred. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* Merge tag 'drivers-for-linus' of ↵Linus Torvalds2014-01-231-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Pull ARM driver updates from Olof Johansson: "Updates of SoC-near drivers and other driver updates that makes more sense to take through our tree. The largest part of this is a conversion of device registration for some renesas shmobile/sh devices over to use resources. This has required coordination with the corresponding arch/sh changes, and we've agreed to merge the arch/sh changes through our tree. Added in this branch is support for Trusted Foundations secure firmware, which is what is used on many of the commercial Nvidia Tegra products that are in the market, including the Nvidia Shield. The code is local to arch/arm at this time since it's uncertain whether it will be shared with arm64 longer-term, if needed we will refactor later. A couple of new RTC drivers used on ARM boards, merged through our tree on request by the RTC maintainer. ... plus a bunch of smaller updates across the board, gpio conversions for davinci, etc" * tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (45 commits) watchdog: davinci: rename platform driver to davinci-wdt tty: serial: Limit msm_serial_hs driver to platforms that use it mmc: msm_sdcc: Limit driver to platforms that use it usb: phy: msm: Move mach dependent code to platform data clk: versatile: fixup IM-PD1 clock implementation clk: versatile: pass a name to ICST clock provider ARM: integrator: pass parent IRQ to the SIC irqchip: versatile FPGA: support cascaded interrupts from DT gpio: davinci: don't create irq_domain in case of unbanked irqs gpio: davinci: use chained_irq_enter/chained_irq_exit API gpio: davinci: add OF support gpio: davinci: remove unused variable intc_irq_num gpio: davinci: convert to use irqdomain support. gpio: introduce GPIO_DAVINCI kconfig option gpio: davinci: get rid of DAVINCI_N_GPIO gpio: davinci: use {readl|writel}_relaxed() instead of __raw_* serial: sh-sci: Add OF support serial: sh-sci: Add device tree bindings documentation serial: sh-sci: Remove platform data mapbase and irqs fields serial: sh-sci: Remove platform data scbrr_algo_id field ...
| * Merge tag 'davinci-for-v3.14/watchdog' of ↵Kevin Hilman2014-01-161-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci into next/drivers From Sekhar Nori: This patch updates the davinci watchdog platform device name from generic "watchdog" to something more specific. * tag 'davinci-for-v3.14/watchdog' of git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci: watchdog: davinci: rename platform driver to davinci-wdt Signed-off-by: Kevin Hilman <khilman@linaro.org>
| | * watchdog: davinci: rename platform driver to davinci-wdtIvan Khoronzhuk2014-01-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we switch to use the watchdog core which permits more than one active watchdog in the system, rename platform driver to "davinci-wdt" to be identifiable. Acked-by: Wim Van Sebroeck <wim@iguana.be> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com> Signed-off-by: Sekhar Nori <nsekhar@ti.com>
* | | Watchdog: pcwd_usb: remove CONFIG_USB_DEBUG usageGreg Kroah-Hartman2014-01-071-29/+11
|/ / | | | | | | | | | | | | | | | | | | | | CONFIG_USB_DEBUG is going away, and all of the other USB drivers no longer rely on "debug" module parameters for debugging lines, so move the pcwd_usb driver to use the dynamic debug infrastructure to be more in line with the rest of the kernel. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Wim Van Sebroeck <wim@iguana.be> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
* | sc1200_wdt: Fix oopsAlan2013-12-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | If loaded with isapnp = 0 the driver explodes. This is catching people out now and then. What should happen in the working case is a complete mystery and the code appears terminally confused, but we can at least make the error path work properly. Signed-off-by: Alan Cox <alan@linux.intel.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Partially-Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=53991
* | watchdog: Drop unnecessary include of miscdevice.hGuenter Roeck2013-12-1014-14/+0
|/ | | | | | | | | | After commit 487722cf2 (watchdog: Get rid of MODULE_ALIAS_MISCDEV statements) the affected drivers no longer need to include miscdevice.h. Only exception is rt2880_wdt.c which never needed it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Reviewed-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>