Skip to content

Commit e6e31bc

Browse files
author
Joseph Szczypek
committed
watchdog/hpwdt: Support Suspend and Resume
JIRA: https://issues.redhat.com/browse/RHEL-104148 Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git commit 12b8ab4 Author: Jerry Hoemann <jerry.hoemann@hpe.com> Date: Wed Feb 14 09:49:40 2024 -0700 watchdog/hpwdt: Support Suspend and Resume Add call backs to support suspend and resume. Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20240214164941.630775-2-jerry.hoemann@hpe.com Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org> Signed-off-by: Joseph Szczypek <jszczype@redhat.com>
1 parent f008f59 commit e6e31bc

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

drivers/watchdog/hpwdt.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,36 @@ static void hpwdt_exit(struct pci_dev *dev)
378378
pci_disable_device(dev);
379379
}
380380

381+
static int hpwdt_suspend(struct device *dev)
382+
{
383+
if (watchdog_active(&hpwdt_dev))
384+
hpwdt_stop();
385+
386+
return 0;
387+
}
388+
389+
static int hpwdt_resume(struct device *dev)
390+
{
391+
if (watchdog_active(&hpwdt_dev))
392+
hpwdt_start(&hpwdt_dev);
393+
394+
return 0;
395+
}
396+
397+
static const struct dev_pm_ops hpwdt_pm_ops = {
398+
LATE_SYSTEM_SLEEP_PM_OPS(hpwdt_suspend, hpwdt_resume)
399+
};
400+
381401
static struct pci_driver hpwdt_driver = {
382402
.name = "hpwdt",
383403
.id_table = hpwdt_devices,
384404
.probe = hpwdt_init_one,
385405
.remove = hpwdt_exit,
406+
407+
.driver = {
408+
.name = "hpwdt",
409+
.pm = &hpwdt_pm_ops,
410+
}
386411
};
387412

388413
MODULE_AUTHOR("Tom Mingarelli");

0 commit comments

Comments
 (0)