Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10d790d1 authored by Jerry Hoemann's avatar Jerry Hoemann Committed by Wim Van Sebroeck
Browse files

watchdog: hpwdt: Disable PreTimeout when Timeout is smaller



During module install, disable pretimeout if the requested timeout
value is not greater than the minimal pretimeout value that is
supported by hardware.

This makes the module load handling of pretimeout consistent
with the ioctl handling of pretimeout.

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 57cbf0e3
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -311,6 +311,10 @@ static int hpwdt_init_one(struct pci_dev *dev,
	if (watchdog_init_timeout(&hpwdt_dev, soft_margin, NULL))
		dev_warn(&dev->dev, "Invalid soft_margin: %d.\n", soft_margin);

	if (pretimeout && hpwdt_dev.timeout <= PRETIMEOUT_SEC) {
		dev_warn(&dev->dev, "timeout <= pretimeout. Setting pretimeout to zero\n");
		pretimeout = 0;
	}
	hpwdt_dev.pretimeout = pretimeout ? PRETIMEOUT_SEC : 0;

	hpwdt_dev.parent = &dev->dev;