summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 20:56:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 20:56:58 -0500
commit2bcc673101268dc50e52b83226c5bbf38391e16d (patch)
tree0cdaf6affa8b05d436c2e8b80ff23e8c7f03a30a /drivers/watchdog
parent670310dfbae0eefe7318ff6a61e29e67a7a7bbce (diff)
parentb24591e2fcf852ad7ad2ccf745c8220bf378d312 (diff)
Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull timer updates from Thomas Gleixner: "Yet another big pile of changes: - More year 2038 work from Arnd slowly reaching the point where we need to think about the syscalls themself. - A new timer function which allows to conditionally (re)arm a timer only when it's either not running or the new expiry time is sooner than the armed expiry time. This allows to use a single timer for multiple timeout requirements w/o caring about the first expiry time at the call site. - A new NMI safe accessor to clock real time for the printk timestamp work. Can be used by tracing, perf as well if required. - A large number of timer setup conversions from Kees which got collected here because either maintainers requested so or they simply got ignored. As Kees pointed out already there are a few trivial merge conflicts and some redundant commits which was unavoidable due to the size of this conversion effort. - Avoid a redundant iteration in the timer wheel softirq processing. - Provide a mechanism to treat RTC implementations depending on their hardware properties, i.e. don't inflict the write at the 0.5 seconds boundary which originates from the PC CMOS RTC to all RTCs. No functional change as drivers need to be updated separately. - The usual small updates to core code clocksource drivers. Nothing really exciting" * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (111 commits) timers: Add a function to start/reduce a timer pstore: Use ktime_get_real_fast_ns() instead of __getnstimeofday() timer: Prepare to change all DEFINE_TIMER() callbacks netfilter: ipvs: Convert timers to use timer_setup() scsi: qla2xxx: Convert timers to use timer_setup() block/aoe: discover_timer: Convert timers to use timer_setup() ide: Convert timers to use timer_setup() drbd: Convert timers to use timer_setup() mailbox: Convert timers to use timer_setup() crypto: Convert timers to use timer_setup() drivers/pcmcia: omap1: Fix error in automated timer conversion ARM: footbridge: Fix typo in timer conversion drivers/sgi-xp: Convert timers to use timer_setup() drivers/pcmcia: Convert timers to use timer_setup() drivers/memstick: Convert timers to use timer_setup() drivers/macintosh: Convert timers to use timer_setup() hwrng/xgene-rng: Convert timers to use timer_setup() auxdisplay: Convert timers to use timer_setup() sparc/led: Convert timers to use timer_setup() mips: ip22/32: Convert timers to use timer_setup() ...
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/alim7101_wdt.c4
-rw-r--r--drivers/watchdog/cpwd.c8
-rw-r--r--drivers/watchdog/lpc18xx_wdt.c13
-rw-r--r--drivers/watchdog/machzwd.c2
-rw-r--r--drivers/watchdog/mixcomwd.c2
-rw-r--r--drivers/watchdog/sbc60xxwdt.c2
-rw-r--r--drivers/watchdog/sc520_wdt.c2
-rw-r--r--drivers/watchdog/via_wdt.c2
-rw-r--r--drivers/watchdog/w83877f_wdt.c2
9 files changed, 19 insertions, 18 deletions
diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c
index 665e0e7dfe1e..18e896eeca62 100644
--- a/drivers/watchdog/alim7101_wdt.c
+++ b/drivers/watchdog/alim7101_wdt.c
@@ -71,7 +71,7 @@ MODULE_PARM_DESC(use_gpio,
71 "Use the gpio watchdog (required by old cobalt boards)."); 71 "Use the gpio watchdog (required by old cobalt boards).");
72 72
73static void wdt_timer_ping(unsigned long); 73static void wdt_timer_ping(unsigned long);
74static DEFINE_TIMER(timer, wdt_timer_ping, 0, 1); 74static DEFINE_TIMER(timer, wdt_timer_ping);
75static unsigned long next_heartbeat; 75static unsigned long next_heartbeat;
76static unsigned long wdt_is_open; 76static unsigned long wdt_is_open;
77static char wdt_expect_close; 77static char wdt_expect_close;
@@ -87,7 +87,7 @@ MODULE_PARM_DESC(nowayout,
87 * Whack the dog 87 * Whack the dog
88 */ 88 */
89 89
90static void wdt_timer_ping(unsigned long data) 90static void wdt_timer_ping(unsigned long unused)
91{ 91{
92 /* If we got a heartbeat pulse within the WDT_US_INTERVAL 92 /* If we got a heartbeat pulse within the WDT_US_INTERVAL
93 * we agree to ping the WDT 93 * we agree to ping the WDT
diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c
index 3d43775548e5..aee0b25cf10d 100644
--- a/drivers/watchdog/cpwd.c
+++ b/drivers/watchdog/cpwd.c
@@ -230,9 +230,9 @@ static void cpwd_resetbrokentimer(struct cpwd *p, int index)
230 * interrupts within the PLD so me must continually 230 * interrupts within the PLD so me must continually
231 * reset the timers ad infinitum. 231 * reset the timers ad infinitum.
232 */ 232 */
233static void cpwd_brokentimer(unsigned long data) 233static void cpwd_brokentimer(struct timer_list *unused)
234{ 234{
235 struct cpwd *p = (struct cpwd *) data; 235 struct cpwd *p = cpwd_device;
236 int id, tripped = 0; 236 int id, tripped = 0;
237 237
238 /* kill a running timer instance, in case we 238 /* kill a running timer instance, in case we
@@ -275,7 +275,7 @@ static void cpwd_stoptimer(struct cpwd *p, int index)
275 275
276 if (p->broken) { 276 if (p->broken) {
277 p->devs[index].runstatus |= WD_STAT_BSTOP; 277 p->devs[index].runstatus |= WD_STAT_BSTOP;
278 cpwd_brokentimer((unsigned long) p); 278 cpwd_brokentimer(NULL);
279 } 279 }
280 } 280 }
281} 281}
@@ -608,7 +608,7 @@ static int cpwd_probe(struct platform_device *op)
608 } 608 }
609 609
610 if (p->broken) { 610 if (p->broken) {
611 setup_timer(&cpwd_timer, cpwd_brokentimer, (unsigned long)p); 611 timer_setup(&cpwd_timer, cpwd_brokentimer, 0);
612 cpwd_timer.expires = WD_BTIMEOUT; 612 cpwd_timer.expires = WD_BTIMEOUT;
613 613
614 pr_info("PLD defect workaround enabled for model %s\n", 614 pr_info("PLD defect workaround enabled for model %s\n",
diff --git a/drivers/watchdog/lpc18xx_wdt.c b/drivers/watchdog/lpc18xx_wdt.c
index 3b8bb59adf02..b4221f43cd94 100644
--- a/drivers/watchdog/lpc18xx_wdt.c
+++ b/drivers/watchdog/lpc18xx_wdt.c
@@ -78,10 +78,10 @@ static int lpc18xx_wdt_feed(struct watchdog_device *wdt_dev)
78 return 0; 78 return 0;
79} 79}
80 80
81static void lpc18xx_wdt_timer_feed(unsigned long data) 81static void lpc18xx_wdt_timer_feed(struct timer_list *t)
82{ 82{
83 struct watchdog_device *wdt_dev = (struct watchdog_device *)data; 83 struct lpc18xx_wdt_dev *lpc18xx_wdt = from_timer(lpc18xx_wdt, t, timer);
84 struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev); 84 struct watchdog_device *wdt_dev = &lpc18xx_wdt->wdt_dev;
85 85
86 lpc18xx_wdt_feed(wdt_dev); 86 lpc18xx_wdt_feed(wdt_dev);
87 87
@@ -96,7 +96,9 @@ static void lpc18xx_wdt_timer_feed(unsigned long data)
96 */ 96 */
97static int lpc18xx_wdt_stop(struct watchdog_device *wdt_dev) 97static int lpc18xx_wdt_stop(struct watchdog_device *wdt_dev)
98{ 98{
99 lpc18xx_wdt_timer_feed((unsigned long)wdt_dev); 99 struct lpc18xx_wdt_dev *lpc18xx_wdt = watchdog_get_drvdata(wdt_dev);
100
101 lpc18xx_wdt_timer_feed(&lpc18xx_wdt->timer);
100 102
101 return 0; 103 return 0;
102} 104}
@@ -267,8 +269,7 @@ static int lpc18xx_wdt_probe(struct platform_device *pdev)
267 269
268 __lpc18xx_wdt_set_timeout(lpc18xx_wdt); 270 __lpc18xx_wdt_set_timeout(lpc18xx_wdt);
269 271
270 setup_timer(&lpc18xx_wdt->timer, lpc18xx_wdt_timer_feed, 272 timer_setup(&lpc18xx_wdt->timer, lpc18xx_wdt_timer_feed, 0);
271 (unsigned long)&lpc18xx_wdt->wdt_dev);
272 273
273 watchdog_set_nowayout(&lpc18xx_wdt->wdt_dev, nowayout); 274 watchdog_set_nowayout(&lpc18xx_wdt->wdt_dev, nowayout);
274 watchdog_set_restart_priority(&lpc18xx_wdt->wdt_dev, 128); 275 watchdog_set_restart_priority(&lpc18xx_wdt->wdt_dev, 128);
diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c
index 9826b59ef734..8a616a57bb90 100644
--- a/drivers/watchdog/machzwd.c
+++ b/drivers/watchdog/machzwd.c
@@ -127,7 +127,7 @@ static int zf_action = GEN_RESET;
127static unsigned long zf_is_open; 127static unsigned long zf_is_open;
128static char zf_expect_close; 128static char zf_expect_close;
129static DEFINE_SPINLOCK(zf_port_lock); 129static DEFINE_SPINLOCK(zf_port_lock);
130static DEFINE_TIMER(zf_timer, zf_ping, 0, 0); 130static DEFINE_TIMER(zf_timer, zf_ping);
131static unsigned long next_heartbeat; 131static unsigned long next_heartbeat;
132 132
133 133
diff --git a/drivers/watchdog/mixcomwd.c b/drivers/watchdog/mixcomwd.c
index be86ea359eee..c9e38096ea91 100644
--- a/drivers/watchdog/mixcomwd.c
+++ b/drivers/watchdog/mixcomwd.c
@@ -105,7 +105,7 @@ static unsigned long mixcomwd_opened; /* long req'd for setbit --RR */
105 105
106static int watchdog_port; 106static int watchdog_port;
107static int mixcomwd_timer_alive; 107static int mixcomwd_timer_alive;
108static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun, 0, 0); 108static DEFINE_TIMER(mixcomwd_timer, mixcomwd_timerfun);
109static char expect_close; 109static char expect_close;
110 110
111static bool nowayout = WATCHDOG_NOWAYOUT; 111static bool nowayout = WATCHDOG_NOWAYOUT;
diff --git a/drivers/watchdog/sbc60xxwdt.c b/drivers/watchdog/sbc60xxwdt.c
index 2eef58a0cf05..8d589939bc84 100644
--- a/drivers/watchdog/sbc60xxwdt.c
+++ b/drivers/watchdog/sbc60xxwdt.c
@@ -113,7 +113,7 @@ MODULE_PARM_DESC(nowayout,
113 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 113 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
114 114
115static void wdt_timer_ping(unsigned long); 115static void wdt_timer_ping(unsigned long);
116static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0); 116static DEFINE_TIMER(timer, wdt_timer_ping);
117static unsigned long next_heartbeat; 117static unsigned long next_heartbeat;
118static unsigned long wdt_is_open; 118static unsigned long wdt_is_open;
119static char wdt_expect_close; 119static char wdt_expect_close;
diff --git a/drivers/watchdog/sc520_wdt.c b/drivers/watchdog/sc520_wdt.c
index 1cfd3f6a13d5..3e9bbaa37bf4 100644
--- a/drivers/watchdog/sc520_wdt.c
+++ b/drivers/watchdog/sc520_wdt.c
@@ -124,7 +124,7 @@ MODULE_PARM_DESC(nowayout,
124static __u16 __iomem *wdtmrctl; 124static __u16 __iomem *wdtmrctl;
125 125
126static void wdt_timer_ping(unsigned long); 126static void wdt_timer_ping(unsigned long);
127static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0); 127static DEFINE_TIMER(timer, wdt_timer_ping);
128static unsigned long next_heartbeat; 128static unsigned long next_heartbeat;
129static unsigned long wdt_is_open; 129static unsigned long wdt_is_open;
130static char wdt_expect_close; 130static char wdt_expect_close;
diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c
index 5f9cbc37520d..ad3c3be13b40 100644
--- a/drivers/watchdog/via_wdt.c
+++ b/drivers/watchdog/via_wdt.c
@@ -68,7 +68,7 @@ static struct resource wdt_res;
68static void __iomem *wdt_mem; 68static void __iomem *wdt_mem;
69static unsigned int mmio; 69static unsigned int mmio;
70static void wdt_timer_tick(unsigned long data); 70static void wdt_timer_tick(unsigned long data);
71static DEFINE_TIMER(timer, wdt_timer_tick, 0, 0); 71static DEFINE_TIMER(timer, wdt_timer_tick);
72 /* The timer that pings the watchdog */ 72 /* The timer that pings the watchdog */
73static unsigned long next_heartbeat; /* the next_heartbeat for the timer */ 73static unsigned long next_heartbeat; /* the next_heartbeat for the timer */
74 74
diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c
index f0483c75ed32..ba6b680af100 100644
--- a/drivers/watchdog/w83877f_wdt.c
+++ b/drivers/watchdog/w83877f_wdt.c
@@ -98,7 +98,7 @@ MODULE_PARM_DESC(nowayout,
98 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 98 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
99 99
100static void wdt_timer_ping(unsigned long); 100static void wdt_timer_ping(unsigned long);
101static DEFINE_TIMER(timer, wdt_timer_ping, 0, 0); 101static DEFINE_TIMER(timer, wdt_timer_ping);
102static unsigned long next_heartbeat; 102static unsigned long next_heartbeat;
103static unsigned long wdt_is_open; 103static unsigned long wdt_is_open;
104static char wdt_expect_close; 104static char wdt_expect_close;