summaryrefslogtreecommitdiff
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorJerry Hoemann <jerry.hoemann@hpe.com>2019-05-17 14:59:40 -0600
committerWim Van Sebroeck <wim@linux-watchdog.org>2019-07-08 16:10:09 +0200
commitbb721d6b9eed631eed5d22bb8dfbb0c0717a67aa (patch)
tree01e5e3efb55d1bfe4e6a0b2b8e4cbe39f8d808b8 /drivers/watchdog
parentc22d8e38e475c3a9fcc5923f98ac8cfdee8b1ad7 (diff)
watchdog/hpwdt: Have core ping watchdog.
Instead of stopping the hw timer during probe, have the core update the timer if the timer is already running. Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.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@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/hpwdt.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 6ad6ce53ed52..937c726e8e7f 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -55,6 +55,11 @@ static const struct pci_device_id hpwdt_blacklist[] = {
/*
* Watchdog operations
*/
+static int hpwdt_hw_is_running(void)
+{
+ return ioread8(hpwdt_timer_con) & 0x01;
+}
+
static int hpwdt_start(struct watchdog_device *wdd)
{
int control = 0x81 | (pretimeout ? 0x4 : 0);
@@ -298,8 +303,11 @@ static int hpwdt_init_one(struct pci_dev *dev,
hpwdt_timer_reg = pci_mem_addr + 0x70;
hpwdt_timer_con = pci_mem_addr + 0x72;
- /* Make sure that timer is disabled until /dev/watchdog is opened */
- hpwdt_stop();
+ /* Have the core update running timer until user space is ready */
+ if (hpwdt_hw_is_running()) {
+ dev_info(&dev->dev, "timer is running\n");
+ set_bit(WDOG_HW_RUNNING, &hpwdt_dev.status);
+ }
/* Initialize NMI Decoding functionality */
retval = hpwdt_init_nmi_decoding(dev);