From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755704AbbEUPcc (ORCPT ); Thu, 21 May 2015 11:32:32 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:40423 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751925AbbEUPc3 (ORCPT ); Thu, 21 May 2015 11:32:29 -0400 Date: Thu, 21 May 2015 08:32:25 -0700 From: Guenter Roeck To: fu.wei@linaro.org Cc: Suravee.Suthikulpanit@amd.com, linaro-acpi@lists.linaro.org, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, tekkamanninja@gmail.com, graeme.gregory@linaro.org, al.stone@linaro.org, hanjun.guo@linaro.org, timur@codeaurora.org, ashwin.chaugule@linaro.org, arnd@arndb.de, vgandhi@codeaurora.org, wim@iguana.be, jcm@redhat.com, leo.duran@amd.com, corbet@lwn.net, mark.rutland@arm.com Subject: Re: [PATCH v2 5/7] Watchdog: introduce "pretimeout" into framework Message-ID: <20150521153225.GA17441@roeck-us.net> References: <=fu.wei@linaro.org> <1432197156-16947-1-git-send-email-fu.wei@linaro.org> <1432197156-16947-6-git-send-email-fu.wei@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432197156-16947-6-git-send-email-fu.wei@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 21, 2015 at 04:32:34PM +0800, fu.wei@linaro.org wrote: > From: Fu Wei > > Also update Documentation/watchdog/watchdog-kernel-api.txt to > introduce: > (1)the new elements in the watchdog_device and watchdog_ops struct; > (2)the new API "watchdog_init_timeouts". > > Reasons: > (1)kernel already has two watchdog drivers are using "pretimeout": > drivers/char/ipmi/ipmi_watchdog.c > drivers/watchdog/kempld_wdt.c(but the definition is different) > (2)some other dirvers are going to use this: ARM SBSA Generic Watchdog > > Signed-off-by: Fu Wei > --- [ ... ] > > +/* Use the following function to check if a pretimeout value is invalid */ > +static inline bool watchdog_pretimeout_invalid(struct watchdog_device *wdd, > + unsigned int t) > +{ > + return ((wdd->max_pretimeout != 0) && > + (t < wdd->min_pretimeout || t > wdd->max_pretimeout)); > +} Should this function also enforce "t < wdd->timeout", and should watchdog_timeout_invalid() enforce "t > wdd->pretimeout" ? Thanks, Guenter From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: Re: [PATCH v2 5/7] Watchdog: introduce "pretimeout" into framework Date: Thu, 21 May 2015 08:32:25 -0700 Message-ID: <20150521153225.GA17441@roeck-us.net> References: <=fu.wei@linaro.org> <1432197156-16947-1-git-send-email-fu.wei@linaro.org> <1432197156-16947-6-git-send-email-fu.wei@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1432197156-16947-6-git-send-email-fu.wei-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Sender: linux-watchdog-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: fu.wei-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org Cc: Suravee.Suthikulpanit-5C7GfCeVMHo@public.gmane.org, linaro-acpi-cunTk1MwBs8s++Sfvej+rw@public.gmane.org, linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, tekkamanninja-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, graeme.gregory-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, al.stone-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, hanjun.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, timur-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, ashwin.chaugule-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, vgandhi-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org, jcm-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, leo.duran-5C7GfCeVMHo@public.gmane.org, corbet-T1hC0tSOHrs@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org List-Id: devicetree@vger.kernel.org On Thu, May 21, 2015 at 04:32:34PM +0800, fu.wei-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org wrote: > From: Fu Wei > > Also update Documentation/watchdog/watchdog-kernel-api.txt to > introduce: > (1)the new elements in the watchdog_device and watchdog_ops struct; > (2)the new API "watchdog_init_timeouts". > > Reasons: > (1)kernel already has two watchdog drivers are using "pretimeout": > drivers/char/ipmi/ipmi_watchdog.c > drivers/watchdog/kempld_wdt.c(but the definition is different) > (2)some other dirvers are going to use this: ARM SBSA Generic Watchdog > > Signed-off-by: Fu Wei > --- [ ... ] > > +/* Use the following function to check if a pretimeout value is invalid */ > +static inline bool watchdog_pretimeout_invalid(struct watchdog_device *wdd, > + unsigned int t) > +{ > + return ((wdd->max_pretimeout != 0) && > + (t < wdd->min_pretimeout || t > wdd->max_pretimeout)); > +} Should this function also enforce "t < wdd->timeout", and should watchdog_timeout_invalid() enforce "t > wdd->pretimeout" ? Thanks, Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html