From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751442AbdJXDUQ (ORCPT ); Mon, 23 Oct 2017 23:20:16 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:55739 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751275AbdJXDUN (ORCPT ); Mon, 23 Oct 2017 23:20:13 -0400 X-Google-Smtp-Source: ABhQp+RJbpxqZ2bFxilBY5XKOE0g+uRwBrhOSDAeQfpjUkKBCZg9yhMWlD4RW0M+ZEndY5WIrfNBBQ== Subject: Re: [PATCH v2 3/3] watchdog: hpwdt: add ioctl WDIOC_GETPRETIMEOUT To: Jerry Hoemann , wim@iguana.be Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org References: <8683001075d79d84212c94b6f361c9fb34062012.1508797127.git.jerry.hoemann@hpe.com> From: Guenter Roeck Message-ID: <94180768-5f46-a110-8fcf-19213ce69dd7@roeck-us.net> Date: Mon, 23 Oct 2017 20:20:09 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <8683001075d79d84212c94b6f361c9fb34062012.1508797127.git.jerry.hoemann@hpe.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/23/2017 03:46 PM, Jerry Hoemann wrote: > Add support for WDIOC_GETPRETIMEOUT ioctl so that user applications > can determine when the NMI should arrive. > > Signed-off-by: Jerry Hoemann I'll leave this for Wim to decide. My take is that we should not add functionality to old-style drivers and convert those drivers to use the watchdog core instead. Thanks, Guenter > --- > drivers/watchdog/hpwdt.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c > index e616583..b64ce43 100644 > --- a/drivers/watchdog/hpwdt.c > +++ b/drivers/watchdog/hpwdt.c > @@ -50,6 +50,7 @@ > static bool nowayout = WATCHDOG_NOWAYOUT; > static char expect_release; > static unsigned long hpwdt_is_open; > +static const int pretimeout = 9; > > static void __iomem *pci_mem_addr; /* the PCI-memory address */ > static unsigned long __iomem *hpwdt_nmistat; > @@ -631,6 +632,12 @@ static long hpwdt_ioctl(struct file *file, unsigned int cmd, > } > break; > > + case WDIOC_GETPRETIMEOUT: > + ret = copy_to_user(argp, &pretimeout, sizeof(pretimeout)); > + if (ret) > + ret = -EFAULT; > + break; > + > case WDIOC_SETTIMEOUT: > ret = get_user(new_margin, p); > if (ret) >