summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
Commit message (Collapse)AuthorAgeFilesLines
* watchdog: gpio_wdt: Fix missing platform_set_drvdata() in gpio_wdt_probe()Wei Yongjun2016-07-271-0/+2
| | | | | | | | | | | | Add missing platform_set_drvdata() in gpio_wdt_probe(), otherwise calling platform_get_drvdata() in remove returns NULL. This is detected by Coccinelle semantic patch. Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: core: Clear WDOG_HW_RUNNING before calling the stop functionGuenter Roeck2016-07-251-2/+4
| | | | | | | | | | | | | | | | | | | | WDOG_HW_RUNNING indicates that the hardware watchdog is running while the watchdog device is closed. The flag may be set by the driver when it is instantiated to indicate that the watchdog is running, and that the watchdog core needs to send heartbeat requests to the driver until the watchdog device is opened. When the watchdog device is closed, the flag can be used by the driver's stop function to indicate to the watchdog core that it was unable to stop the watchdog, and that the watchdog core needs to send heartbeat requests. This only works if the flag is actually cleared when the watchdog is stopped. To avoid having to clear the flag in each driver's stop function, clear it in the watchdog core before calling the stop function. Reported-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Fixes: ee142889e32f ("watchdog: Introduce WDOG_HW_RUNNING flag") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: core: Fix error handling of watchdog_dev_init()Wei Yongjun2016-07-251-3/+8
| | | | | | | | | Fix the error handling paths of watchdog_dev_init(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: pic32-wdt: Fix return value check in pic32_wdt_drv_probe()Wei Yongjun2016-07-251-2/+2
| | | | | | | | | | | In case of error, the function devm_ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: pic32-dmt: Remove .owner field for driverWei Yongjun2016-07-251-1/+0
| | | | | | | | | | | Remove .owner field if calls are used which set it automatically. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: pic32-wdt: Remove .owner field for driverWei Yongjun2016-07-251-1/+0
| | | | | | | | | | | Remove .owner field if calls are used which set it automatically. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: sbsa: Drop status functionGuenter Roeck2016-07-191-10/+0
| | | | | | | | | | The watchdog status function is supposed to return WDIOF_ flags, not internal status flags. The available WDIOF_ flags are now returned by the watchdog core, so the status function in this driver is unnecessary. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: Implement status function in watchdog coreGuenter Roeck2016-07-191-7/+27
| | | | | | | | | | | | | | | | | | | | Up to now, the watchdog status function called a driver function, which was supposed to return the watchdog status. All but one driver using the watchdog core did not implement this function, and the driver implementing it did not implement it correctly (the function is supposed to return WDIOF_ flags). At the same time, at least some of the status information can be provided by the watchdog core. Provide the available status bits directly from the watchdog driver core. Call the driver status function if it exists to get the boot status, but always provide WDIOF_MAGICCLOSE and WDIOF_KEEPALIVEPING internally. This patch makes the 'status' sysfs attribute always available. This attribute is now displayed as hex number with 0x prepended to be easier to decode. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: tangox: Set max_hw_heartbeat_ms instead of max_timeoutGuenter Roeck2016-07-181-1/+1
| | | | | | | | | | | Setting max_hw_heartbeat_ms lets the watchdog core provide a virtual timeout if the timeout requested by user space is larger than the maximum hardware timeout. Also, it helps the watchdog core to provide heartbeats if the hardware watchdog is running while closed. Fixes: a3e376d26ace ("watchdog: tangox: Mark running watchdog correctly") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: change watchdog_need_worker logicRasmus Villemoes2016-07-171-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the driver indicates that the watchdog is running, the framework should feed it until userspace opens the device, regardless of whether the driver has set max_hw_heartbeat_ms. This patch only affects the case where wdd->max_hw_heartbeat_ms is zero, wdd->timeout is non-zero, the watchdog is not active and the hardware device is running (*): - If wdd->timeout is zero, watchdog_need_worker() returns false both before and after this patch, and watchdog_next_keepalive() is not called. - If watchdog_active(wdd), the return value from watchdog_need_worker is also the same as before (namely, hm && t > hm). Hence in that case, watchdog_next_keepalive() is only called if hm == max_hw_heartbeat_ms is non-zero, so the change to min_not_zero there is a no-op. - If the watchdog is not active and the device is not running, we return false from watchdog_need_worker just as before. That leaves the watchdog_hw_running(wdd) && !watchdog_active(wdd) && wdd->timeout case. Again, it's easy to see that if wdd->max_hw_heartbeat_ms is non-zero, we return true from watchdog_need_worker with and without this patch, and the logic in watchdog_next_keepalive is unchanged. Finally, if wdd->max_hw_heartbeat_ms is 0, we used to end up in the cancel_delayed_work branch, whereas with this patch we end up scheduling a ping timeout_ms/2 from now. (*) This should imply that no current kernel drivers are affected, since the only drivers which explicitly set WDOG_HW_RUNNING are imx2_wdt.c and dw_wdt.c, both of which also provide a non-zero value for max_hw_heartbeat_ms. The watchdog core also sets WDOG_HW_RUNNING, but only when the driver doesn't provide ->stop, in which case it must, according to Documentation/watchdog/watchdog-kernel-api.txt, set max_hw_heartbeat_ms. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: add support for MCP78S chipset in nv_tcoAlexey Kunitskiy2016-07-171-0/+2
| | | | | | | | | Add support for MCP78S chipset in nv_tco watchdog driver Signed-off-by: Aleksey Kunitskiy <alexey.kv@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: bcm2835_wdt: remove redundant ->set_timeout callbackRasmus Villemoes2016-07-171-7/+0
| | | | | | | | | | | | bcm2835_wdt_set_timeout does exactly what the watchdog framework does in the absence of a ->set_timeout callback (see watchdog_set_timeout in watchdog_dev.c), so remove it. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: bcm2835_wdt: constify _ops and _info structuresRasmus Villemoes2016-07-171-2/+2
| | | | | | | | | | These are never modified, so might as well be const. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: Add Meson GXBB Watchdog DriverNeil Armstrong2016-07-173-0/+281
| | | | | | | | | Add watchdog specific driver for Amlogic Meson GXBB SoC. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: qcom: configure BARK time in addition to BITE timeMatthew McClintock2016-07-171-0/+5
| | | | | | | | | | | | For certain parts and some versions of TZ, TZ will reset the chip when a BARK is triggered even though it was not configured here. So by default let's configure this BARK time as well. Signed-off-by: Matthew McClintock <mmcclint@codeaurora.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Thomas Pedersen <twp@codeaurora.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: qcom: add option for standalone watchdog not in timer blockMatthew McClintock2016-07-171-16/+48
| | | | | | | | | | | | | | | | | | | | Commit 0dfd582e026a ("watchdog: qcom: use timer devicetree binding") moved to use the watchdog as a subset timer register block. Some devices have the watchdog completely standalone with slightly different register offsets as well so let's account for the differences here. The existing "kpss-standalone" compatible string doesn't make it entirely clear exactly what the device is so rename to "kpss-wdt" to reflect watchdog timer functionality. Also update ipq4019 DTS with an SoC specific compatible. Signed-off-by: Matthew McClintock <mmcclint@codeaurora.org> Signed-off-by: Thomas Pedersen <twp@codeaurora.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: da9063_wdt: don't trigger watchdog too fastStefan Christ2016-07-171-0/+2
| | | | | | | | | | | | Triggering the watchdog faster than T_WDMIN=256ms leads to resets of the DA9063 chip. The datasheet says that the watchdog must only be triggered in the timeframe T_WDMIN to T_WDMAX. The T_WDMAX is configured in the driver. Signed-off-by: Stefan Christ <s.christ@phytec.de> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: iTCO-wdt: handle 5th variation for Apollo LakeYong, Jonathan2016-07-171-0/+2
| | | | | | | | | The Apollo Lake Watchdog has the no_reboot flag in the 4th bit. Signed-off-by: Yong, Jonathan <jonathan.yong@intel.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: pic32-dmt: Fix return value check in pic32_dmt_probe()Wei Yongjun2016-07-171-2/+2
| | | | | | | | | | | In case of error, the function devm_kzalloc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: pic32-wdt: Fix return value check in pic32_wdt_drv_probe()Wei Yongjun2016-07-171-2/+2
| | | | | | | | | | | In case of error, the function devm_kzalloc() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: ziirave_wdt: Correct I2C device id to fix module autoloading.Enric Balletbo i Serra2016-07-171-1/+1
| | | | | | | | | | | | | The I2C core removes the manufacturer prefix from the compatible field so it reports to user-space the uevent i2c:rave-wdt, but this doesn't match with the i2c_device_id (i2c:ziirave-wdt) array so the module is not autoloaded. Correct the I2C device id to match with the reported uevent and fix the module autoloading functionality. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: drop redundant 'default n' option for WATCHDOG_SYSFSVladimir Zapolskiy2016-07-171-1/+0
| | | | | | | | | | The option 'default n' and its absence are equal for kbuild, which makes explicit 'default n' redundant. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: max77620: Add support for watchdog timerLaxman Dewangan2016-07-173-0/+237
| | | | | | | | | | | | | | | Maxim PMIC MAX77620 is Power management IC which have multiple sub blocks like regulators (DCDC/LDOs), GPIO, RTC, Clock, Watchdog timer etc. Add the driver for watchdog timer under watchdog framework. The driver implements the watchdog callbacks to start, stop, ping and set timeout for watchodg framework. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: f71808e_wdt: Add F81866 supportJi-Ze Hong (Peter Hong)2016-07-171-2/+26
| | | | | | | | | | | | | | | | Adds watchdog enable support for Fintek F81866 Super-IO chip to Fintek wdt driver (f71808e_wdt) Tested and verified on iBASE MI802 Industrial PC Datasheet references: http://www.alldatasheet.com/datasheet-pdf/pdf/459085/FINTEK/F81866AD-I.html Suggested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Ji-Ze Hong (Peter Hong) <hpeter+linux_kernel@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: sirf: fix __iomem * warningsBen Dooks2016-07-171-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix the following warnings from sparse due to casting to/from an __iomem annotated variable: drivers/watchdog/sirfsoc_wdt.c:48:18: warning: incorrect type in assignment (different address spaces) drivers/watchdog/sirfsoc_wdt.c:48:18: expected void [noderef] <asn:2>*wdt_base drivers/watchdog/sirfsoc_wdt.c:48:18: got void * drivers/watchdog/sirfsoc_wdt.c:64:18: warning: incorrect type in assignment (different address spaces) drivers/watchdog/sirfsoc_wdt.c:64:18: expected void [noderef] <asn:2>*wdt_base drivers/watchdog/sirfsoc_wdt.c:64:18: got void * drivers/watchdog/sirfsoc_wdt.c:82:54: warning: incorrect type in initializer (different address spaces) drivers/watchdog/sirfsoc_wdt.c:82:54: expected void [noderef] <asn:2>*wdt_base drivers/watchdog/sirfsoc_wdt.c:82:54: got void * drivers/watchdog/sirfsoc_wdt.c:99:54: warning: incorrect type in initializer (different address spaces) drivers/watchdog/sirfsoc_wdt.c:99:54: expected void [noderef] <asn:2>*wdt_base drivers/watchdog/sirfsoc_wdt.c:99:54: got void * drivers/watchdog/sirfsoc_wdt.c:153:44: warning: incorrect type in argument 2 (different address spaces) drivers/watchdog/sirfsoc_wdt.c:153:44: expected void *data drivers/watchdog/sirfsoc_wdt.c:153:44: got void [noderef] <asn:2>*[assigned] base Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: tangox: Mark running watchdog correctlyGuenter Roeck2016-07-171-1/+1
| | | | | | | | | A running watchdog is marked with WDOG_HW_RUNNING, not with WDOG_ACTIVE. WDOG_ACTIVE indicates that the watchdog device has been opened from user space. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: sbsa: Set WDOG_HW_RUNNING, when watchdog is already running.Pratyush Anand2016-07-171-0/+2
| | | | | | | | | | | | This patch uses the new flag WDOG_HW_RUNNING in driver. According to the definition of this flag, it should be set, if watchdog is running after booting, before it's opened. Signed-off-by: Pratyush Anand <panand@redhat.com> Signed-off-by: Fu Wei <fu.wei@linaro.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: sbsa: Use max_hw_heartbeat_ms instead of max_timeoutPratyush Anand2016-07-171-2/+2
| | | | | | | | | | | Using max_hw_heartbeat_ms instead of max_timeout gives the flexibility to achieve higher user "timeout". Therefore, use this new infrastructure. Signed-off-by: Pratyush Anand <panand@redhat.com> Signed-off-by: Fu Wei <fu.wei@linaro.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: skip min and max timeout validity check when max_hw_heartbeat_ms ↵Pratyush Anand2016-07-171-1/+1
| | | | | | | | | | | | | | | | is defined When max_hw_heartbeat_ms has a none zero value, max_timeout is not used. So it's value can be 0. In such case if a driver uses min_timeout functionality, then check will always fail. This patch fixes above issue. Signed-off-by: Pratyush Anand <panand@redhat.com> Signed-off-by: Fu Wei <fu.wei@linaro.org> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: pcwd: Utilize the module_isa_driver macroWilliam Breathitt Gray2016-07-171-13/+1
| | | | | | | | | | | This driver does not do anything special in module init/exit. This patch eliminates the module init/exit boilerplate code by utilizing the module_isa_driver macro. Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: Add Aspeed watchdog driverJoel Stanley2016-07-173-0/+226
| | | | | | | | | | Provides generic watchdog features as well as reboot support for the Aspeed SoCs. Signed-off-by: Joel Stanley <joel@jms.id.au> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: softdog: improve coding styleWolfram Sang2016-07-171-3/+3
| | | | | | | Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: softdog: drop superfluous set_timeout callbackWolfram Sang2016-07-171-7/+0
| | | | | | | | | | If we leave set_timeout empty, the core will do exactly what is implemented here anyway. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: softdog: sort includes to avoid duplicatesWolfram Sang2016-07-171-5/+5
| | | | | | | Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: softdog: remove forward declarationWolfram Sang2016-07-171-5/+3
| | | | | | | Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: softdog: consistently use softdog_ prefixWolfram Sang2016-07-171-11/+10
| | | | | | | | | And move module_init/exit to the proper place while here. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: softdog: use watchdog core to init timeout valueWolfram Sang2016-07-171-12/+5
| | | | | | | | | | | | | Error string and comment say we fall back to a default, but in reality we bailed out. Refactor the code to use the core helper which then matches the described behaviour. While updating the init message anyhow, shorten it while we are here; no need for versioning there as well and the name is already given via pr_fmt. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: softdog: remove obsolete commentsWolfram Sang2016-07-171-33/+0
| | | | | | | | | | | The history is obsolete, especially since we switched to watchdog framework. The section markers also don't make sense anymore given the small size of the driver. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: Add a device managed API for watchdog_register_device()Neil Armstrong2016-07-171-0/+37
| | | | | | | | | This helps in reducing code in .remove callbacks and sometimes dropping .remove callbacks entirely. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
* watchdog: ebc-c384_wdt: Allow build for X86_64William Breathitt Gray2016-06-171-1/+1
| | | | | | | | | | | | | With the introduction of the ISA_BUS_API Kconfig option, ISA-style drivers may be built for X86_64 architectures. This patch changes the ISA Kconfig option dependency of the WinSystems EBC-C384 watchdog timer driver to ISA_BUS_API, thus allowing it to build for X86_64 as it is expected to. Cc: Wim Van Sebroeck <wim@iguana.be> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Merge git://www.linux-watchdog.org/linux-watchdogLinus Torvalds2016-05-2513-26/+284
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull watchdog updates from Wim Van Sebroeck: - add support for Fintek F81865 Super-IO chip - add support for watchdogs (RWDT and SWDT) found on RCar Gen3 based SoCs from Renesas - octeon: Handle the FROZEN hot plug notifier actions - f71808e_wdt fixes and cleanups - some small improvements in code and documentation * git://www.linux-watchdog.org/linux-watchdog: MAINTAINERS: Add file patterns for watchdog device tree bindings Documentation: Add ebc-c384_wdt watchdog-parameters.txt entry watchdog: shwdt: Use setup_timer() watchdog: cpwd: Use setup_timer() arm64: defconfig: enable Renesas Watchdog Timer watchdog: renesas-wdt: add driver watchdog: remove error message when unable to allocate watchdog device watchdog: f71808e_wdt: Fix WDTMOUT_STS register read watchdog: f71808e_wdt: Fix typo watchdog: f71808e_wdt: Add F81865 support watchdog: sp5100_tco: properly check for new register layouts watchdog: core: Fix circular locking dependency watchdog: core: fix trivial typo in a comment watchdog: hpwdt: Adjust documentation to match latest kernel module parameters. watchdog: imx2_wdt: add external reset support via dt prop watchdog: octeon: Handle the FROZEN hot plug notifier actions. watchdog: qcom: Report reboot reason
| * watchdog: shwdt: Use setup_timer()Muhammad Falak R Wani2016-05-141-3/+1
| | | | | | | | | | | | | | | | | | | | | | The function setup_timer combines the initialization of a timer with the initialization of the timer's function and data fields. The multiline code for timer initialization is now replaced with function setup_timer. Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| * watchdog: cpwd: Use setup_timer()Muhammad Falak R Wani2016-05-141-3/+1
| | | | | | | | | | | | | | | | | | | | | | The function setup_timer combines the initialization of a timer with the initialization of the timer's function and data fields. The multiline code for timer initialization is now replaced with function setup_timer. Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| * watchdog: renesas-wdt: add driverWolfram Sang2016-05-143-0/+222
| | | | | | | | | | | | | | | | | | Add support for watchdogs (RWDT and SWDT) found on RCar Gen3 based SoCs from Renesas. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| * watchdog: remove error message when unable to allocate watchdog deviceColin Ian King2016-05-141-3/+1
| | | | | | | | | | | | | | | | | | The dev_err message is superfluous because the failure is already printed by dev_kzalloc, so remove it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| * watchdog: f71808e_wdt: Fix WDTMOUT_STS register readKnud Poulsen2016-05-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tested and verified on Lanner LEC-3030 Industrial PC (with F81865) Datasheet verified for F71808, F71858, F71862, F71869, F71869A, F71882, F71889, F81865 Datasheet references: F71808A: http://www.electronicsdatasheets.com/download/534cf560e34e2406135f4658.pdf?format=pdf F71858: http://www.electronicsdatasheets.com/download/534cf55fe34e2406135f4635.pdf?format=pdf F71862: http://www.hardwaresecrets.com/datasheets/F71862_V027P.pdf F71869: http://www.clubedohardware.com.br/datasheets/366451_F71869.pdf F71869A: http://www.chipset-ic.com/datasheet/F71869AD.pdf F71882: http://www.digchip.com/datasheets/parts/datasheet/931/F71882-pdf.php F71889: http://pdf1.alldatasheet.com/datasheet-pdf/view/406312/FINTEK/F71889.html F81865: http://www.hardwaresecrets.com/datasheets/F81865_V028P.pdf http://www.alldatasheet.com/datasheet-pdf/pdf/406317/FINTEK/F81865.html Signed-off-by: Knud Poulsen <knpo@ieee.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| * watchdog: f71808e_wdt: Fix typoKnud Poulsen2016-05-141-1/+1
| | | | | | | | | | | | | | | | Spelling/ typo Signed-off-by: Knud Poulsen <knpo@ieee.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| * watchdog: f71808e_wdt: Add F81865 supportKnud Poulsen2016-05-141-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds watchdog enable support for Fintek F81865 Super-IO chip to Fintek wdt driver (f71808e_wdt) Tested and verified on Lanner LEC-3030 Industrial PC Datasheet references: http://www.hardwaresecrets.com/datasheets/F81865_V028P.pdf http://www.alldatasheet.com/datasheet-pdf/pdf/406317/FINTEK/F81865.html Signed-off-by: Knud Poulsen <knpo@ieee.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| * watchdog: sp5100_tco: properly check for new register layoutsLucas Stach2016-05-141-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commits 190aa4304de6 (Add AMD Mullins platform support) and cca118fa2a0a94 (Add AMD Carrizo platform support) enabled the driver on a lot more devices, but the following commit missed a single location in the code when checking if the SB800 register offsets should be used. This leads to the wrong register being written which in turn causes ACPI to go haywire. Fix this by introducing a helper function to check for the new register layout and use this consistently. https://bugzilla.kernel.org/show_bug.cgi?id=114201 https://bugzilla.redhat.com/show_bug.cgi?id=1329910 Fixes: bdecfcdb5461 (sp5100_tco: fix the device check for SB800 and later chipsets) Cc: stable@vger.kernel.org (4.5+) Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
| * watchdog: core: Fix circular locking dependencyGuenter Roeck2016-05-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lockdep reports the following circular locking dependency. ====================================================== INFO: possible circular locking dependency detected ] 4.6.0-rc3-00191-gfabf418 #162 Not tainted ------------------------------------------------------- systemd/1 is trying to acquire lock: ((&(&wd_data->work)->work)){+.+...}, at: [<80141650>] flush_work+0x0/0x280 but task is already holding lock: (&wd_data->lock){+.+...}, at: [<804acfa8>] watchdog_release+0x18/0x190 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (&wd_data->lock){+.+...}: [<80662310>] mutex_lock_nested+0x64/0x4a8 [<804aca4c>] watchdog_ping_work+0x18/0x4c [<80143128>] process_one_work+0x1ac/0x500 [<801434b4>] worker_thread+0x38/0x554 [<80149510>] kthread+0xf4/0x108 [<80107c10>] ret_from_fork+0x14/0x24 -> #0 ((&(&wd_data->work)->work)){+.+...}: [<8017c4e8>] lock_acquire+0x70/0x90 [<8014169c>] flush_work+0x4c/0x280 [<801440f8>] __cancel_work_timer+0x9c/0x1e0 [<804acfcc>] watchdog_release+0x3c/0x190 [<8022c5e8>] __fput+0x80/0x1c8 [<80147b28>] task_work_run+0x94/0xc8 [<8010b998>] do_work_pending+0x8c/0xb4 [<80107ba8>] slow_work_pending+0xc/0x20 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&wd_data->lock); lock((&(&wd_data->work)->work)); lock(&wd_data->lock); lock((&(&wd_data->work)->work)); *** DEADLOCK *** 1 lock held by systemd/1: stack backtrace: CPU: 2 PID: 1 Comm: systemd Not tainted 4.6.0-rc3-00191-gfabf418 #162 Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree) [<8010f5e4>] (unwind_backtrace) from [<8010c038>] (show_stack+0x10/0x14) [<8010c038>] (show_stack) from [<8039d7fc>] (dump_stack+0xa8/0xd4) [<8039d7fc>] (dump_stack) from [<80177ee0>] (print_circular_bug+0x214/0x334) [<80177ee0>] (print_circular_bug) from [<80179230>] (check_prevs_add+0x4dc/0x8e8) [<80179230>] (check_prevs_add) from [<8017b3d8>] (__lock_acquire+0xc6c/0x14ec) [<8017b3d8>] (__lock_acquire) from [<8017c4e8>] (lock_acquire+0x70/0x90) [<8017c4e8>] (lock_acquire) from [<8014169c>] (flush_work+0x4c/0x280) [<8014169c>] (flush_work) from [<801440f8>] (__cancel_work_timer+0x9c/0x1e0) [<801440f8>] (__cancel_work_timer) from [<804acfcc>] (watchdog_release+0x3c/0x190) [<804acfcc>] (watchdog_release) from [<8022c5e8>] (__fput+0x80/0x1c8) [<8022c5e8>] (__fput) from [<80147b28>] (task_work_run+0x94/0xc8) [<80147b28>] (task_work_run) from [<8010b998>] (do_work_pending+0x8c/0xb4) [<8010b998>] (do_work_pending) from [<80107ba8>] (slow_work_pending+0xc/0x20) Turns out the call to cancel_delayed_work_sync() in watchdog_release() is not necessary and can be dropped. If the worker is no longer necessary, the subsequent call to watchdog_update_worker() will cancel it. If it is already running, it won't do anything, since the worker function checks if it needs to ping the watchdog or not. Reported-by: Clemens Gruber <clemens.gruber@pqgruber.com> Tested-by: Clemens Gruber <clemens.gruber@pqgruber.com> Fixes: 11d7aba9ceb7 ("watchdog: imx2: Convert to use infrastructure triggered keepalives") Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be> Cc: stable <stable@vger.kernel.org>
OpenPOWER on IntegriCloud