2006-08-22 15:09:14

by Denys Vlasenko

[permalink] [raw]
Subject: [PATCH 1/3] s/#include <asm/delay.h>/#include <linux/delay.h>/

On Tuesday 22 August 2006 15:45, Denis Vlasenko wrote:
> Currently, magic in include/linux/delay.h
> inlines mdelay and ssleep, and various arches
> do the same to udelay.
>
> This is pointless. We are going to perform a delay of 1000+
> CPU cycles anyway, no need to optimize away a few cycles.
>
> This patchset converts calls to these functions
> into true functuon calls, with no additional
> math done or hidden arguments pushed to stack
> at the callsite.

A few arch files won't see the definition of udelay()
in asm/delay.h anymore. Prevent that from biting us later.

Signed-off-by: Denis Vlasenko <[email protected]>
--
vda


Attachments:
(No filename) (643.00 B)
delay_new7.1.patch (16.29 kB)
Download all attachments

2006-08-22 15:09:37

by Denys Vlasenko

[permalink] [raw]
Subject: [PATCH 3/3] add generic udelay(), mdelay() and ssleep()

On Tuesday 22 August 2006 15:51, Denis Vlasenko wrote:
> > A few arch files won't see the definition of udelay()
> > in asm/delay.h anymore. Prevent that from biting us later.
>
> We are going to kill MAX_UDELAY_MS, so replace it
> in common code with 1. Also fix a buglet on the way:
> mpc83xx_spi->nsecs > MAX_UDELAY_MS * 1000
> was comparing nanoseconds to microseconds.

This patch does the following:
* make it so than asm/delay.h does not define udelay(),
only __udelay(), to be used in generic udelay()
* add generic udelay() which calls __udelay() repeatedly,
as needed. Protect against overflow in udelay() argument.
* similarly for mdelay() and ssleep()
* __const_udelay for all arches is removed or renamed to
__const_delay (it did not do microsecond delays anyway)
if still used by arch ndelay() function/macro
* remove EXPORT_SYMBOL(__udelay). It is not used in modules
anymore
* remove MAX_UDELAY_MS

We specifically do not touch ndelay() in thess patches.
It is not changed.

Signed-off-by: Denis Vlasenko <[email protected]>
--
vda


Attachments:
(No filename) (1.04 kB)
delay_new7.3.patch (32.97 kB)
Download all attachments

2006-08-22 15:09:15

by Denys Vlasenko

[permalink] [raw]
Subject: [PATCH 2/3] remove references to MAX_UDELAY_MS; fix comment

On Tuesday 22 August 2006 15:48, Denis Vlasenko wrote:
> A few arch files won't see the definition of udelay()
> in asm/delay.h anymore. Prevent that from biting us later.

We are going to kill MAX_UDELAY_MS, so replace it
in common code with 1. Also fix a buglet on the way:
mpc83xx_spi->nsecs > MAX_UDELAY_MS * 1000
was comparing nanoseconds to microseconds.

Signed-off-by: Denis Vlasenko <[email protected]>
--
vda


Attachments:
(No filename) (426.00 B)
delay_new7.2.patch (2.35 kB)
Download all attachments

2006-08-22 16:55:45

by Russell King

[permalink] [raw]
Subject: Re: [PATCH 3/3] add generic udelay(), mdelay() and ssleep()

On Tue, Aug 22, 2006 at 04:22:43PM +0200, Denis Vlasenko wrote:
> On Tuesday 22 August 2006 15:51, Denis Vlasenko wrote:
> > > A few arch files won't see the definition of udelay()
> > > in asm/delay.h anymore. Prevent that from biting us later.
> >
> > We are going to kill MAX_UDELAY_MS, so replace it
> > in common code with 1. Also fix a buglet on the way:
> > mpc83xx_spi->nsecs > MAX_UDELAY_MS * 1000
> > was comparing nanoseconds to microseconds.
>
> This patch does the following:
> * make it so than asm/delay.h does not define udelay(),
> only __udelay(), to be used in generic udelay()
> * add generic udelay() which calls __udelay() repeatedly,
> as needed. Protect against overflow in udelay() argument.
> * similarly for mdelay() and ssleep()
> * __const_udelay for all arches is removed or renamed to
> __const_delay (it did not do microsecond delays anyway)
> if still used by arch ndelay() function/macro
> * remove EXPORT_SYMBOL(__udelay). It is not used in modules
> anymore
> * remove MAX_UDELAY_MS
>
> We specifically do not touch ndelay() in thess patches.
> It is not changed.

Please keep a "const" version in ARM. Thanks.

--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core