Skip to content

Commit d6be1cb

Browse files
committed
Merge: [RHEL 9.8 PATCH] update hpwdt driver to latest upstream
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7319 JIRA: https://issues.redhat.com/browse/RHEL-104148 Upstream Status: linux.git Tested: This set of changes was tested by HPE at HPE using their test procedure for hpwdt. It was also sanity booted on some HPE systems at Red Hat. This change set updates the hpwdt driver to latest upstream for JIRA RHEL-104148 [HPE 9.8 Feature] updated hpwdt driver. It adds support for suspend/resume, and does some cleanup. Signed-off-by: Joseph Szczypek <jszczype@redhat.com> Approved-by: David Arcari <darcari@redhat.com> Approved-by: Tony Camuso <tcamuso@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Patrick Talbert <ptalbert@redhat.com>
2 parents d796319 + e6e31bc commit d6be1cb

File tree

1 file changed

+26
-8
lines changed

1 file changed

+26
-8
lines changed

drivers/watchdog/hpwdt.c

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#define DEFAULT_MARGIN 30
3434
#define PRETIMEOUT_SEC 9
3535

36-
static bool ilo5;
3736
static unsigned int soft_margin = DEFAULT_MARGIN; /* in seconds */
3837
static bool nowayout = WATCHDOG_NOWAYOUT;
3938
static bool pretimeout = IS_ENABLED(CONFIG_HPWDT_NMI_DECODING);
@@ -178,10 +177,7 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs)
178177
"3. OA Forward Progress Log\n"
179178
"4. iLO Event Log";
180179

181-
if (ilo5 && ulReason == NMI_UNKNOWN && !mynmi)
182-
return NMI_DONE;
183-
184-
if (ilo5 && !pretimeout && !mynmi)
180+
if (ulReason == NMI_UNKNOWN && !mynmi)
185181
return NMI_DONE;
186182

187183
if (kdumptimeout < 0)
@@ -363,9 +359,6 @@ static int hpwdt_init_one(struct pci_dev *dev,
363359
pretimeout ? "on" : "off");
364360
dev_info(&dev->dev, "kdumptimeout: %d.\n", kdumptimeout);
365361

366-
if (dev->subsystem_vendor == PCI_VENDOR_ID_HP_3PAR)
367-
ilo5 = true;
368-
369362
return 0;
370363

371364
error_wd_register:
@@ -385,11 +378,36 @@ static void hpwdt_exit(struct pci_dev *dev)
385378
pci_disable_device(dev);
386379
}
387380

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+
388401
static struct pci_driver hpwdt_driver = {
389402
.name = "hpwdt",
390403
.id_table = hpwdt_devices,
391404
.probe = hpwdt_init_one,
392405
.remove = hpwdt_exit,
406+
407+
.driver = {
408+
.name = "hpwdt",
409+
.pm = &hpwdt_pm_ops,
410+
}
393411
};
394412

395413
MODULE_AUTHOR("Tom Mingarelli");

0 commit comments

Comments
 (0)