From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932736AbbERUOx (ORCPT ); Mon, 18 May 2015 16:14:53 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:55841 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932404AbbERUOu (ORCPT ); Mon, 18 May 2015 16:14:50 -0400 Date: Mon, 18 May 2015 13:14:45 -0700 From: Guenter Roeck To: Arnd Bergmann Cc: Fu Wei , Suravee Suthikulpanit , Linaro ACPI Mailman List , linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Wei Fu , G Gregory , Al Stone , Hanjun Guo , Timur Tabi , Ashwin Chaugule , vgandhi@codeaurora.org, wim@iguana.be, Jon Masters , Leo Duran , Jon Corbet Subject: Re: [PATCH 4/6] Watchdog: introdouce "pretimeout" into framework Message-ID: <20150518201445.GA21230@roeck-us.net> References: <=fu.wei@linaro.org> <20150518172329.GA17202@roeck-us.net> <2729872.Fp4939suL0@wuerfel> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2729872.Fp4939suL0@wuerfel> 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 Mon, May 18, 2015 at 10:03:52PM +0200, Arnd Bergmann wrote: > On Monday 18 May 2015 10:23:30 Guenter Roeck wrote: > > > > > > integrate watchdog_init_pretimeout and watchdog_init_timeout will be a > > > little hard, > > > we may need to change this API to : > > > > > > watchdog_init_timeouts(struct watchdog_device *wdd, unsigned int timeout_parm, > > > unsigned int pretimeout_parm, struct device *dev) > > > > > > then we need to update all the watchdog drivers which use this API, > > > maybe we can do this in a individual patchset, after this pretimeout > > > patch is merged. > > > > > > Is that OK ? any thought? > > > > > That is what I would recommend. > > > > The API change is fine, but I don't think you need to change all drivers. > > Just add a small wrapper function in the header file doing the conversion: > > static inline int watchdog_init_timeout(struct watchdog_device *wdd, > unsigned int timeout_parm, struct device *dev) > { > return watchdog_init_timeouts(wdd, timeout_parm, ~0ul, dev); > } > > Then you can update the drivers that actually use the pretimeout to > use the new function at some point, and leave all other drivers calling > the wrapper function. > Excellent idea. Guenter From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: Re: [PATCH 4/6] Watchdog: introdouce "pretimeout" into framework Date: Mon, 18 May 2015 13:14:45 -0700 Message-ID: <20150518201445.GA21230@roeck-us.net> References: <=fu.wei@linaro.org> <20150518172329.GA17202@roeck-us.net> <2729872.Fp4939suL0@wuerfel> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <2729872.Fp4939suL0@wuerfel> Sender: linux-watchdog-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Arnd Bergmann Cc: Fu Wei , Suravee Suthikulpanit , Linaro ACPI Mailman List , linux-watchdog-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Wei Fu , G Gregory , Al Stone , Hanjun Guo , Timur Tabi , Ashwin Chaugule , vgandhi-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, wim-IQzOog9fTRqzQB+pC5nmwQ@public.gmane.org, Jon Masters , Leo Duran , Jon Corbet List-Id: devicetree@vger.kernel.org On Mon, May 18, 2015 at 10:03:52PM +0200, Arnd Bergmann wrote: > On Monday 18 May 2015 10:23:30 Guenter Roeck wrote: > > > > > > integrate watchdog_init_pretimeout and watchdog_init_timeout will be a > > > little hard, > > > we may need to change this API to : > > > > > > watchdog_init_timeouts(struct watchdog_device *wdd, unsigned int timeout_parm, > > > unsigned int pretimeout_parm, struct device *dev) > > > > > > then we need to update all the watchdog drivers which use this API, > > > maybe we can do this in a individual patchset, after this pretimeout > > > patch is merged. > > > > > > Is that OK ? any thought? > > > > > That is what I would recommend. > > > > The API change is fine, but I don't think you need to change all drivers. > > Just add a small wrapper function in the header file doing the conversion: > > static inline int watchdog_init_timeout(struct watchdog_device *wdd, > unsigned int timeout_parm, struct device *dev) > { > return watchdog_init_timeouts(wdd, timeout_parm, ~0ul, dev); > } > > Then you can update the drivers that actually use the pretimeout to > use the new function at some point, and leave all other drivers calling > the wrapper function. > Excellent idea. 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