From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alessandro Rubini Date: Thu, 6 Aug 2009 15:31:10 +0200 Subject: [U-Boot] PATCH mtd CFI flash: timeout calculation underflow if imprecise 1kHz timer: fix In-Reply-To: <20090806132213.2672E832E416@gemini.denx.de> References: <20090806132213.2672E832E416@gemini.denx.de> <4A7AD624.9030902@imagos.it> Message-ID: <20090806133110.GA26906@mail.gnudd.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de >> + tout = tout * CONFIG_SYS_HZ / 1000 + 1; > 2) There should be a Signed-off-by: from Alessandro, too. Signed-off-by: Alessandro Rubini > 5) Omit the "+1". It seems bogus to me. Since the timeout is an error condition, It's better to have it longer than shorter. Since integer division truncates towards 0, I'd better give my hardware more time before signalling an error (an unlikely situation), rather than timing out on an operation that would complete in the expected time. This happens with low HZ values, which I know are discouraged nowadays. Not a big issue, anyway, I'm fine either way. /alessandro