From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Denis Vlasenko <vda@ilport.com.ua>
Cc: Arjan van de Ven <arjan@infradead.org>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] deinline sleep/delay functions
Date: Thu, 30 Jun 2005 12:21:52 +0100 [thread overview]
Message-ID: <20050630122152.B16103@flint.arm.linux.org.uk> (raw)
In-Reply-To: <200506301410.43524.vda@ilport.com.ua>; from vda@ilport.com.ua on Thu, Jun 30, 2005 at 02:10:43PM +0300
On Thu, Jun 30, 2005 at 02:10:43PM +0300, Denis Vlasenko wrote:
> On Thursday 30 June 2005 13:47, Arjan van de Ven wrote:
> > On Thu, 2005-06-30 at 13:21 +0300, Denis Vlasenko wrote:
> > > On Thursday 30 June 2005 12:19, Arjan van de Ven wrote:
> > > >
> > > > > > There are a number of compile-time checks that your patch has removed
> > > > > > which catch such things, and as such your patch is not acceptable.
> > > > > > Some architectures have a lower threshold of acceptability for the
> > > > > > maximum udelay value, so it's absolutely necessary to keep this.
> > > > >
> > > > > It removes that check from x86 - other architectures retain it.
> > > > >
> > > > >
> > > For users, _any_ value, however large, will work for
> > > any delay function.
> >
> > that's not desired though. Desired is to limit udelay() to say 2000 or
> > so. And force anything above that to go via mdelay() (just to make it
> > stand out as broken code ;)
>
> An if(usec > 2000) { printk(..); dump_stack(); } will do.
No it won't - that's a run time test which will only get caught if the
code is run. There's no guarantees of that.
> But do you really want to do this? There might be legitimate reasons
> to compute udelay's parameter with results which are sometimes large.
Yes. udelay() has overflow issues - if you pass too large a number
to udelay() you get a randomised delay because you've lost the top
bits.
The maximum delay is dependent on the architecture implementation,
and it depends on bogomips. There is no one single value for it.
Architectures have to decide this from the way that they do the
math and the expected range of bogomips.
Please - leave asm-*/delay.h alone.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next prev parent reply other threads:[~2005-06-30 11:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-30 5:52 [PATCH] deinline sleep/delay functions Denis Vlasenko
2005-06-30 8:52 ` Russell King
2005-06-30 9:11 ` Andrew Morton
2005-06-30 9:19 ` Arjan van de Ven
2005-06-30 10:21 ` Denis Vlasenko
2005-06-30 10:47 ` Arjan van de Ven
2005-06-30 11:10 ` Denis Vlasenko
2005-06-30 11:21 ` Russell King [this message]
2005-06-30 11:22 ` Arjan van de Ven
2005-06-30 11:44 ` Denis Vlasenko
2005-06-30 11:57 ` Maciej W. Rozycki
2005-06-30 12:04 ` Russell King
2005-06-30 12:20 ` Denis Vlasenko
2005-07-01 7:54 ` Vojtech Pavlik
2005-06-30 9:44 ` Russell King
2005-07-01 7:53 ` Vojtech Pavlik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050630122152.B16103@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vda@ilport.com.ua \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox