brcm47xx: watchdog: deactivate NOWAYOUT.
In the old configuration the SoC issued a reboot if the watchdog was killed also if it was kill with TERM and not KILL. This will fix #11724. SVN-Revision: 34324
This commit is contained in:
parent
c62d86ecb8
commit
264873b3c5
6 changed files with 34 additions and 28 deletions
|
@ -145,5 +145,4 @@ CONFIG_USB_ARCH_HAS_XHCI=y
|
||||||
# CONFIG_USB_HCD_SSB is not set
|
# CONFIG_USB_HCD_SSB is not set
|
||||||
CONFIG_USB_SUPPORT=y
|
CONFIG_USB_SUPPORT=y
|
||||||
CONFIG_WATCHDOG_CORE=y
|
CONFIG_WATCHDOG_CORE=y
|
||||||
CONFIG_WATCHDOG_NOWAYOUT=y
|
|
||||||
CONFIG_ZONE_DMA_FLAG=0
|
CONFIG_ZONE_DMA_FLAG=0
|
||||||
|
|
|
@ -26,16 +26,23 @@
|
||||||
#include <linux/watchdog.h>
|
#include <linux/watchdog.h>
|
||||||
#include <linux/timer.h>
|
#include <linux/timer.h>
|
||||||
#include <linux/jiffies.h>
|
#include <linux/jiffies.h>
|
||||||
@@ -48,8 +45,6 @@ MODULE_PARM_DESC(nowayout,
|
@@ -41,15 +38,11 @@ module_param(wdt_time, int, 0);
|
||||||
|
MODULE_PARM_DESC(wdt_time, "Watchdog time in seconds. (default="
|
||||||
|
__MODULE_STRING(WDT_DEFAULT_TIME) ")");
|
||||||
|
|
||||||
|
-#ifdef CONFIG_WATCHDOG_NOWAYOUT
|
||||||
|
module_param(nowayout, bool, 0);
|
||||||
|
MODULE_PARM_DESC(nowayout,
|
||||||
|
"Watchdog cannot be stopped once started (default="
|
||||||
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
|
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
|
||||||
#endif
|
-#endif
|
||||||
|
|
||||||
-static unsigned long bcm47xx_wdt_busy;
|
-static unsigned long bcm47xx_wdt_busy;
|
||||||
-static char expect_release;
|
-static char expect_release;
|
||||||
static struct timer_list wdt_timer;
|
static struct timer_list wdt_timer;
|
||||||
static atomic_t ticks;
|
static atomic_t ticks;
|
||||||
|
|
||||||
@@ -97,29 +92,31 @@ static void bcm47xx_timer_tick(unsigned
|
@@ -97,29 +90,31 @@ static void bcm47xx_timer_tick(unsigned
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +82,7 @@
|
||||||
{
|
{
|
||||||
if ((new_time <= 0) || (new_time > WDT_MAX_TIME))
|
if ((new_time <= 0) || (new_time > WDT_MAX_TIME))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -128,51 +125,6 @@ static int bcm47xx_wdt_settimeout(int ne
|
@@ -128,51 +123,6 @@ static int bcm47xx_wdt_settimeout(int ne
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +134,7 @@
|
||||||
static const struct watchdog_info bcm47xx_wdt_info = {
|
static const struct watchdog_info bcm47xx_wdt_info = {
|
||||||
.identity = DRV_NAME,
|
.identity = DRV_NAME,
|
||||||
.options = WDIOF_SETTIMEOUT |
|
.options = WDIOF_SETTIMEOUT |
|
||||||
@@ -180,80 +132,25 @@ static const struct watchdog_info bcm47x
|
@@ -180,80 +130,25 @@ static const struct watchdog_info bcm47x
|
||||||
WDIOF_MAGICCLOSE,
|
WDIOF_MAGICCLOSE,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -217,7 +224,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct notifier_block bcm47xx_wdt_notifier = {
|
static struct notifier_block bcm47xx_wdt_notifier = {
|
||||||
@@ -274,12 +171,13 @@ static int __init bcm47xx_wdt_init(void)
|
@@ -274,12 +169,13 @@ static int __init bcm47xx_wdt_init(void)
|
||||||
pr_info("wdt_time value must be 0 < wdt_time < %d, using %d\n",
|
pr_info("wdt_time value must be 0 < wdt_time < %d, using %d\n",
|
||||||
(WDT_MAX_TIME + 1), wdt_time);
|
(WDT_MAX_TIME + 1), wdt_time);
|
||||||
}
|
}
|
||||||
|
@ -232,7 +239,7 @@
|
||||||
if (ret) {
|
if (ret) {
|
||||||
unregister_reboot_notifier(&bcm47xx_wdt_notifier);
|
unregister_reboot_notifier(&bcm47xx_wdt_notifier);
|
||||||
return ret;
|
return ret;
|
||||||
@@ -292,10 +190,8 @@ static int __init bcm47xx_wdt_init(void)
|
@@ -292,10 +188,8 @@ static int __init bcm47xx_wdt_init(void)
|
||||||
|
|
||||||
static void __exit bcm47xx_wdt_exit(void)
|
static void __exit bcm47xx_wdt_exit(void)
|
||||||
{
|
{
|
||||||
|
@ -245,7 +252,7 @@
|
||||||
|
|
||||||
unregister_reboot_notifier(&bcm47xx_wdt_notifier);
|
unregister_reboot_notifier(&bcm47xx_wdt_notifier);
|
||||||
}
|
}
|
||||||
@@ -306,4 +202,3 @@ module_exit(bcm47xx_wdt_exit);
|
@@ -306,4 +200,3 @@ module_exit(bcm47xx_wdt_exit);
|
||||||
MODULE_AUTHOR("Aleksandar Radovanovic");
|
MODULE_AUTHOR("Aleksandar Radovanovic");
|
||||||
MODULE_DESCRIPTION("Watchdog driver for Broadcom BCM47xx");
|
MODULE_DESCRIPTION("Watchdog driver for Broadcom BCM47xx");
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
|
|
||||||
#define DRV_NAME "bcm47xx_wdt"
|
#define DRV_NAME "bcm47xx_wdt"
|
||||||
|
|
||||||
@@ -45,48 +46,19 @@ MODULE_PARM_DESC(nowayout,
|
@@ -43,48 +44,19 @@ MODULE_PARM_DESC(nowayout,
|
||||||
|
"Watchdog cannot be stopped once started (default="
|
||||||
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
|
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
|
||||||
#endif
|
|
||||||
|
|
||||||
-static struct timer_list wdt_timer;
|
-static struct timer_list wdt_timer;
|
||||||
-static atomic_t ticks;
|
-static atomic_t ticks;
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
} else {
|
} else {
|
||||||
pr_crit("Watchdog will fire soon!!!\n");
|
pr_crit("Watchdog will fire soon!!!\n");
|
||||||
}
|
}
|
||||||
@@ -94,23 +66,29 @@ static void bcm47xx_timer_tick(unsigned
|
@@ -92,23 +64,29 @@ static void bcm47xx_timer_tick(unsigned
|
||||||
|
|
||||||
static int bcm47xx_wdt_keepalive(struct watchdog_device *wdd)
|
static int bcm47xx_wdt_keepalive(struct watchdog_device *wdd)
|
||||||
{
|
{
|
||||||
|
@ -122,7 +122,7 @@
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -118,10 +96,13 @@ static int bcm47xx_wdt_stop(struct watch
|
@@ -116,10 +94,13 @@ static int bcm47xx_wdt_stop(struct watch
|
||||||
static int bcm47xx_wdt_set_timeout(struct watchdog_device *wdd,
|
static int bcm47xx_wdt_set_timeout(struct watchdog_device *wdd,
|
||||||
unsigned int new_time)
|
unsigned int new_time)
|
||||||
{
|
{
|
||||||
|
@ -138,7 +138,7 @@
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,8 +116,11 @@ static const struct watchdog_info bcm47x
|
@@ -133,8 +114,11 @@ static const struct watchdog_info bcm47x
|
||||||
static int bcm47xx_wdt_notify_sys(struct notifier_block *this,
|
static int bcm47xx_wdt_notify_sys(struct notifier_block *this,
|
||||||
unsigned long code, void *unused)
|
unsigned long code, void *unused)
|
||||||
{
|
{
|
||||||
|
@ -151,7 +151,7 @@
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,57 +132,72 @@ static struct watchdog_ops bcm47xx_wdt_o
|
@@ -146,57 +130,72 @@ static struct watchdog_ops bcm47xx_wdt_o
|
||||||
.set_timeout = bcm47xx_wdt_set_timeout,
|
.set_timeout = bcm47xx_wdt_set_timeout,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
--- a/drivers/watchdog/bcm47xx_wdt.c
|
--- a/drivers/watchdog/bcm47xx_wdt.c
|
||||||
+++ b/drivers/watchdog/bcm47xx_wdt.c
|
+++ b/drivers/watchdog/bcm47xx_wdt.c
|
||||||
@@ -46,12 +46,13 @@ MODULE_PARM_DESC(nowayout,
|
@@ -44,12 +44,13 @@ MODULE_PARM_DESC(nowayout,
|
||||||
|
"Watchdog cannot be stopped once started (default="
|
||||||
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
|
__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
|
||||||
#endif
|
|
||||||
|
|
||||||
+
|
+
|
||||||
static inline struct bcm47xx_wdt *bcm47xx_wdt_get(struct watchdog_device *wdd)
|
static inline struct bcm47xx_wdt *bcm47xx_wdt_get(struct watchdog_device *wdd)
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
{
|
{
|
||||||
struct bcm47xx_wdt *wdt = (struct bcm47xx_wdt *)data;
|
struct bcm47xx_wdt *wdt = (struct bcm47xx_wdt *)data;
|
||||||
u32 next_tick = min(wdt->wdd.timeout * 1000, wdt->max_timer_ms);
|
u32 next_tick = min(wdt->wdd.timeout * 1000, wdt->max_timer_ms);
|
||||||
@@ -64,7 +65,7 @@ static void bcm47xx_timer_tick(unsigned
|
@@ -62,7 +63,7 @@ static void bcm47xx_timer_tick(unsigned
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@
|
||||||
{
|
{
|
||||||
struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd);
|
struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd);
|
||||||
|
|
||||||
@@ -73,17 +74,17 @@ static int bcm47xx_wdt_keepalive(struct
|
@@ -71,17 +72,17 @@ static int bcm47xx_wdt_keepalive(struct
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
{
|
{
|
||||||
struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd);
|
struct bcm47xx_wdt *wdt = bcm47xx_wdt_get(wdd);
|
||||||
|
|
||||||
@@ -93,8 +94,8 @@ static int bcm47xx_wdt_stop(struct watch
|
@@ -91,8 +92,8 @@ static int bcm47xx_wdt_stop(struct watch
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
{
|
{
|
||||||
if (new_time < 1 || new_time > WDT_MAX_TIME) {
|
if (new_time < 1 || new_time > WDT_MAX_TIME) {
|
||||||
pr_warn("timeout value must be 1<=x<=%d, using %d\n",
|
pr_warn("timeout value must be 1<=x<=%d, using %d\n",
|
||||||
@@ -124,12 +125,12 @@ static int bcm47xx_wdt_notify_sys(struct
|
@@ -122,12 +123,12 @@ static int bcm47xx_wdt_notify_sys(struct
|
||||||
return NOTIFY_DONE;
|
return NOTIFY_DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
static int __devinit bcm47xx_wdt_probe(struct platform_device *pdev)
|
static int __devinit bcm47xx_wdt_probe(struct platform_device *pdev)
|
||||||
@@ -140,10 +141,10 @@ static int __devinit bcm47xx_wdt_probe(s
|
@@ -138,10 +139,10 @@ static int __devinit bcm47xx_wdt_probe(s
|
||||||
if (!wdt)
|
if (!wdt)
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
|
|
||||||
|
|
|
@ -17,8 +17,8 @@
|
||||||
+MODULE_PARM_DESC(timeout, "Watchdog time in seconds. (default="
|
+MODULE_PARM_DESC(timeout, "Watchdog time in seconds. (default="
|
||||||
__MODULE_STRING(WDT_DEFAULT_TIME) ")");
|
__MODULE_STRING(WDT_DEFAULT_TIME) ")");
|
||||||
|
|
||||||
#ifdef CONFIG_WATCHDOG_NOWAYOUT
|
module_param(nowayout, bool, 0);
|
||||||
@@ -97,9 +97,9 @@ static int bcm47xx_wdt_soft_stop(struct
|
@@ -95,9 +95,9 @@ static int bcm47xx_wdt_soft_stop(struct
|
||||||
static int bcm47xx_wdt_soft_set_timeout(struct watchdog_device *wdd,
|
static int bcm47xx_wdt_soft_set_timeout(struct watchdog_device *wdd,
|
||||||
unsigned int new_time)
|
unsigned int new_time)
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ static int __devinit bcm47xx_wdt_probe(s
|
@@ -161,7 +161,7 @@ static int __devinit bcm47xx_wdt_probe(s
|
||||||
goto err_notifier;
|
goto err_notifier;
|
||||||
|
|
||||||
pr_info("BCM47xx Watchdog Timer enabled (%d seconds%s)\n",
|
pr_info("BCM47xx Watchdog Timer enabled (%d seconds%s)\n",
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
static int timeout = WDT_DEFAULT_TIME;
|
static int timeout = WDT_DEFAULT_TIME;
|
||||||
static bool nowayout = WATCHDOG_NOWAYOUT;
|
static bool nowayout = WATCHDOG_NOWAYOUT;
|
||||||
@@ -52,6 +53,53 @@ static inline struct bcm47xx_wdt *bcm47x
|
@@ -50,6 +51,53 @@ static inline struct bcm47xx_wdt *bcm47x
|
||||||
return container_of(wdd, struct bcm47xx_wdt, wdd);
|
return container_of(wdd, struct bcm47xx_wdt, wdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@
|
||||||
static void bcm47xx_wdt_soft_timer_tick(unsigned long data)
|
static void bcm47xx_wdt_soft_timer_tick(unsigned long data)
|
||||||
{
|
{
|
||||||
struct bcm47xx_wdt *wdt = (struct bcm47xx_wdt *)data;
|
struct bcm47xx_wdt *wdt = (struct bcm47xx_wdt *)data;
|
||||||
@@ -136,15 +184,22 @@ static struct watchdog_ops bcm47xx_wdt_s
|
@@ -134,15 +182,22 @@ static struct watchdog_ops bcm47xx_wdt_s
|
||||||
static int __devinit bcm47xx_wdt_probe(struct platform_device *pdev)
|
static int __devinit bcm47xx_wdt_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
wdt->wdd.info = &bcm47xx_wdt_info;
|
wdt->wdd.info = &bcm47xx_wdt_info;
|
||||||
wdt->wdd.timeout = WDT_DEFAULT_TIME;
|
wdt->wdd.timeout = WDT_DEFAULT_TIME;
|
||||||
ret = wdt->wdd.ops->set_timeout(&wdt->wdd, timeout);
|
ret = wdt->wdd.ops->set_timeout(&wdt->wdd, timeout);
|
||||||
@@ -162,14 +217,16 @@ static int __devinit bcm47xx_wdt_probe(s
|
@@ -160,14 +215,16 @@ static int __devinit bcm47xx_wdt_probe(s
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_notifier;
|
goto err_notifier;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue