From: Wolfgang Denk Date: Tue, 20 May 2008 16:23:58 +0200 Subject: [U-Boot-Users] [PATCH] Make sleep shell command is reliable for all architectures In-Reply-To: Your message of "Tue, 20 May 2008 09:57:26 EDT." <20080520140054.9565865407@mcmullan-linux.hq.netapp.com> Message-ID: <20080520142358.5B6CD247A5@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <20080520140054.9565865407@mcmullan-linux.hq.netapp.com> you wrote: > On some architectures (MIPS is a good example), the timebase > rolls over every few seconds. This patch alters the 'sleep' Well, even if this happens, it should not cause get_timer() to show such problems. get_timer() returns an "unsigned long" and is counting in milliseconds, so a wrap-around should take about 50 days. > shell command to use a total counter of the udelay(100) > sleeps instead of an end time marker to determine the end > of the sleep, making the 'sleep' command capable of sleeping > for any number of seconds on all architectures. I tend to reject this patch because I think we should fix the cause of the problems rather than the symptoms - there are more areas in the code that rely on sane behaviour of the get_timer() functione. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The goal of science is to build better mousetraps. The goal of nature is to build better mice.