diff options
author | Randy Vinson <rvinson@mvista.com> | 2010-12-06 16:02:23 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2011-01-12 05:24:38 -0500 |
commit | 6ae98ed186cbe6909105c536c24419e52af8fc66 (patch) | |
tree | 2d8d97791e1f8af3766f5599d0151ebf083a6ed7 /drivers/watchdog/booke_wdt.c | |
parent | 5d63c13415db2819590bba975dd023eaa593ddc3 (diff) |
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: Randy Vinson <rvinson@mvista.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/booke_wdt.c')
-rw-r--r-- | drivers/watchdog/booke_wdt.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c index 636e013e221e..7e7ec9c35b6a 100644 --- a/drivers/watchdog/booke_wdt.c +++ b/drivers/watchdog/booke_wdt.c | |||
@@ -85,6 +85,22 @@ static unsigned int sec_to_period(unsigned int secs) | |||
85 | return 0; | 85 | return 0; |
86 | } | 86 | } |
87 | 87 | ||
88 | static void __booke_wdt_set(void *data) | ||
89 | { | ||
90 | u32 val; | ||
91 | |||
92 | val = mfspr(SPRN_TCR); | ||
93 | val &= ~WDTP_MASK; | ||
94 | val |= WDTP(booke_wdt_period); | ||
95 | |||
96 | mtspr(SPRN_TCR, val); | ||
97 | } | ||
98 | |||
99 | static void booke_wdt_set(void) | ||
100 | { | ||
101 | on_each_cpu(__booke_wdt_set, NULL, 0); | ||
102 | } | ||
103 | |||
88 | static void __booke_wdt_ping(void *data) | 104 | static void __booke_wdt_ping(void *data) |
89 | { | 105 | { |
90 | mtspr(SPRN_TSR, TSR_ENW|TSR_WIS); | 106 | mtspr(SPRN_TSR, TSR_ENW|TSR_WIS); |
@@ -181,8 +197,7 @@ static long booke_wdt_ioctl(struct file *file, | |||
181 | #else | 197 | #else |
182 | booke_wdt_period = tmp; | 198 | booke_wdt_period = tmp; |
183 | #endif | 199 | #endif |
184 | mtspr(SPRN_TCR, (mfspr(SPRN_TCR) & ~WDTP_MASK) | | 200 | booke_wdt_set(); |
185 | WDTP(booke_wdt_period)); | ||
186 | return 0; | 201 | return 0; |
187 | case WDIOC_GETTIMEOUT: | 202 | case WDIOC_GETTIMEOUT: |
188 | return put_user(booke_wdt_period, p); | 203 | return put_user(booke_wdt_period, p); |