Commit 6ae98ed1 authored by Randy Vinson's avatar Randy Vinson Committed by Wim Van Sebroeck

watchdog: Propagate Book E WDT period changes to all cores

When the watchdog period is changed, it needs to be propagated to all cores
in addition to the core that performed the change.
Signed-off-by: default avatarRandy Vinson <rvinson@mvista.com>
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 5d63c134
...@@ -85,6 +85,22 @@ static unsigned int sec_to_period(unsigned int secs) ...@@ -85,6 +85,22 @@ static unsigned int sec_to_period(unsigned int secs)
return 0; return 0;
} }
static void __booke_wdt_set(void *data)
{
u32 val;
val = mfspr(SPRN_TCR);
val &= ~WDTP_MASK;
val |= WDTP(booke_wdt_period);
mtspr(SPRN_TCR, val);
}
static void booke_wdt_set(void)
{
on_each_cpu(__booke_wdt_set, NULL, 0);
}
static void __booke_wdt_ping(void *data) static void __booke_wdt_ping(void *data)
{ {
mtspr(SPRN_TSR, TSR_ENW|TSR_WIS); mtspr(SPRN_TSR, TSR_ENW|TSR_WIS);
...@@ -181,8 +197,7 @@ static long booke_wdt_ioctl(struct file *file, ...@@ -181,8 +197,7 @@ static long booke_wdt_ioctl(struct file *file,
#else #else
booke_wdt_period = tmp; booke_wdt_period = tmp;
#endif #endif
mtspr(SPRN_TCR, (mfspr(SPRN_TCR) & ~WDTP_MASK) | booke_wdt_set();
WDTP(booke_wdt_period));
return 0; return 0;
case WDIOC_GETTIMEOUT: case WDIOC_GETTIMEOUT:
return put_user(booke_wdt_period, p); return put_user(booke_wdt_period, p);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment