linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] watchdog/hpwdt: Disable PreTimeout when Timeout is smaller
@ 2018-09-21 20:50 Jerry Hoemann
  2018-09-22  0:22 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Jerry Hoemann @ 2018-09-21 20:50 UTC (permalink / raw)
  To: wim, linux; +Cc: linux-watchdog, linux-kernel, Jerry Hoemann

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: Jerry Hoemann <jerry.hoemann@hpe.com>
---
 drivers/watchdog/hpwdt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 7af358b3e278..93562304f7aa 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -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;
-- 
2.13.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] watchdog/hpwdt: Disable PreTimeout when Timeout is smaller
  2018-09-21 20:50 [PATCH] watchdog/hpwdt: Disable PreTimeout when Timeout is smaller Jerry Hoemann
@ 2018-09-22  0:22 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2018-09-22  0:22 UTC (permalink / raw)
  To: Jerry Hoemann, wim; +Cc: linux-watchdog, linux-kernel

On 09/21/2018 01:50 PM, Jerry Hoemann wrote:
> 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: Jerry Hoemann <jerry.hoemann@hpe.com>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-22  0:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-21 20:50 [PATCH] watchdog/hpwdt: Disable PreTimeout when Timeout is smaller Jerry Hoemann
2018-09-22  0:22 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).