From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933112AbcEKN6V (ORCPT ); Wed, 11 May 2016 09:58:21 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:32938 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932573AbcEKN6P (ORCPT ); Wed, 11 May 2016 09:58:15 -0400 Date: Wed, 11 May 2016 09:58:02 -0400 From: William Breathitt Gray To: Guenter Roeck Cc: wim@iguana.be, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] watchdog: ebc-c384_wdt: Simplify ebc_c384_wdt_start timeout computation Message-ID: <20160511135802.GA624@sophia> References: <20160511130551.GA16032@sophia> <20160511134327.GA8192@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160511134327.GA8192@roeck-us.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 11, 2016 at 06:43:27AM -0700, Guenter Roeck wrote: >On Wed, May 11, 2016 at 09:05:51AM -0400, William Breathitt Gray wrote: >> The ebc_c384_wdt_set_timeout function already rounds up timeout values >> greater than 255 to a multiple of 60, so there is no need to round again >> in the ebc_c384_wdt_start function; a timeout value greater than 255 in >> ebc_c384_wdt_start will divide cleanly by 60. >> >... except if the timeout is set with the module parameter, which is now >rounded down, which would be a problem since it would time out earlier than >expected (a timeout of 299 seconds, set with the module parameter, would >time out after 240 seconds). So you would have to do some calculations >on the timeout value set with the module parameter to ensure that it is >set to a correct value. > >Guenter Oops, I overlooked that scenario. Please ignore this patch as your are correct that a timeout set via module parameter would not necessarily be a multiple of 60; timeout in the start callback should indeed be rounded. William Breathitt Gray