Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1191956imm; Wed, 8 Aug 2018 12:23:20 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyfYvPf/N/sGJuXbC76/Wm7YTkS63XhG4Kz8o3Hr1ROwVOA7Y7gTLjcoS61wZAg+q78cNbk X-Received: by 2002:a63:d613:: with SMTP id q19-v6mr3666700pgg.327.1533756200201; Wed, 08 Aug 2018 12:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533756200; cv=none; d=google.com; s=arc-20160816; b=wM3rllOQ9g3F2+RmvhROt1Ia+rl9aiTWezPCpqE2Y7gvMy22BgnQiGHGI1wHdanrCZ AOdoaV703vVCzg4KxkrKUR7ND92sBbqPU34zsX+ZmcT+4uNhaBEao0uVCsQ1xBR/mo91 K+ZwFXx47GMkkAyMvWvbeA0MeVNqrru95pHLyELH4RknQob8ZrehOWRFu8A7qU4zPlpC jzNWsLoGkCjx8iMgVdX8Gfd/a5hv/34VnAmElM/yO8IDckBXxtjjvi6gujqLXMVZGa6t vrz0xSIbn2w4YwYnewvWaU0PO5HZyem1zn5vPJxvl3KOiwWuwz04y1XKD9km0L41S42q Xe9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=H2cnZs/WzkZyS1ykPv5PUaVZlY9aMvyQvRnt7hY45c4=; b=oLzx9v0PL5nA+2OLr+2ZBLS/XUncJXVJ2q2Yf63QDTxX7ii0Vuw1FSoevv1gLoK5D2 vOrIuqb5q45AiouAbcy8olXU6hZ75uW+S+7arxfTnXdF6hU20KxWNqyS/8QfkWnFunpX OjYVJu3AnGoXBpMoYvFb7N4gp4zKK3+GG/dESMczrlUvmoYs4eqBBr2PfnQdfS+ABLrX CtSsvHCDj1kjU/NNH51neQqH9LcVcSZ2n64OfYA66zFcfpgFcieF1omMpbqx8TN7+sck odb71HjwXKwwPowIFB27V1LW0EpoyGjz+DVoDpJqGguyKOludE4qFzSljuG4bMP6VLzD SwsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l72-v6si4064031pga.617.2018.08.08.12.23.05; Wed, 08 Aug 2018 12:23:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730256AbeHHVm6 (ORCPT + 99 others); Wed, 8 Aug 2018 17:42:58 -0400 Received: from g4t3426.houston.hpe.com ([15.241.140.75]:29787 "EHLO g4t3426.houston.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727480AbeHHVm5 (ORCPT ); Wed, 8 Aug 2018 17:42:57 -0400 Received: from g9t2301.houston.hpecorp.net (g9t2301.houston.hpecorp.net [16.220.97.129]) by g4t3426.houston.hpe.com (Postfix) with ESMTP id 6EABE5D; Wed, 8 Aug 2018 19:21:51 +0000 (UTC) Received: from lxbuild.ftc.rdlabs.hpecorp.net (lxbuild.ftc.rdlabs.hpecorp.net [16.78.34.175]) by g9t2301.houston.hpecorp.net (Postfix) with ESMTP id 23AB34B; Wed, 8 Aug 2018 19:21:51 +0000 (UTC) From: Jerry Hoemann To: wim@linux-watchdog.org, linux@roeck-us.net Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org, Jerry Hoemann Subject: [PATCH v2 1/5] watchdog: hpwdt: Initialize pretimeout from module parameter. Date: Wed, 8 Aug 2018 13:13:23 -0600 Message-Id: <1533755607-71418-2-git-send-email-jerry.hoemann@hpe.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1533755607-71418-1-git-send-email-jerry.hoemann@hpe.com> References: <1533755607-71418-1-git-send-email-jerry.hoemann@hpe.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When the pretimeout is specified as a module parameter, the value should be reflected in hpwdt_dev.pretimeout. The default (on) case is correct. But, when disabling pretimeout, the value should be set to zero in hpwdt_dev. When compiling w/o CONFIG_HPWDT_NMI_DECODING defined, the pretimeout module parameter is ignored and the value internally will be 0. Signed-off-by: Jerry Hoemann --- drivers/watchdog/hpwdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 9dc62a4..fae9364 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c @@ -205,9 +205,7 @@ static int hpwdt_pretimeout(unsigned int ulReason, struct pt_regs *regs) .min_timeout = 1, .max_timeout = HPWDT_MAX_TIMER, .timeout = DEFAULT_MARGIN, -#ifdef CONFIG_HPWDT_NMI_DECODING .pretimeout = PRETIMEOUT_SEC, -#endif }; @@ -313,6 +311,8 @@ 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); + hpwdt_dev.pretimeout = pretimeout ? PRETIMEOUT_SEC : 0; + hpwdt_dev.parent = &dev->dev; retval = watchdog_register_device(&hpwdt_dev); if (retval < 0) { -- 1.8.3.1