Commit bb721d6b authored by Jerry Hoemann's avatar Jerry Hoemann Committed by Wim Van Sebroeck

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: default avatarJerry Hoemann <jerry.hoemann@hpe.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent c22d8e38
...@@ -55,6 +55,11 @@ static const struct pci_device_id hpwdt_blacklist[] = { ...@@ -55,6 +55,11 @@ static const struct pci_device_id hpwdt_blacklist[] = {
/* /*
* Watchdog operations * Watchdog operations
*/ */
static int hpwdt_hw_is_running(void)
{
return ioread8(hpwdt_timer_con) & 0x01;
}
static int hpwdt_start(struct watchdog_device *wdd) static int hpwdt_start(struct watchdog_device *wdd)
{ {
int control = 0x81 | (pretimeout ? 0x4 : 0); int control = 0x81 | (pretimeout ? 0x4 : 0);
...@@ -298,8 +303,11 @@ static int hpwdt_init_one(struct pci_dev *dev, ...@@ -298,8 +303,11 @@ static int hpwdt_init_one(struct pci_dev *dev,
hpwdt_timer_reg = pci_mem_addr + 0x70; hpwdt_timer_reg = pci_mem_addr + 0x70;
hpwdt_timer_con = pci_mem_addr + 0x72; hpwdt_timer_con = pci_mem_addr + 0x72;
/* Make sure that timer is disabled until /dev/watchdog is opened */ /* Have the core update running timer until user space is ready */
hpwdt_stop(); 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 */ /* Initialize NMI Decoding functionality */
retval = hpwdt_init_nmi_decoding(dev); retval = hpwdt_init_nmi_decoding(dev);
......
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