From: Stephen Boyd <sboyd@codeaurora.org>
To: Mattias Wallin <mattias.wallin@stericsson.com>
Cc: Russell King <linux@arm.linux.org.uk>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Saravana Kannan <skannan@codeaurora.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCHv5 1/3] ARM: Translate delay.S into (mostly) C
Date: Wed, 06 Apr 2011 10:34:16 -0700 [thread overview]
Message-ID: <4D9CA418.2030107@codeaurora.org> (raw)
In-Reply-To: <4D9C2910.6020309@stericsson.com>
On 04/06/2011 01:49 AM, Mattias Wallin wrote:
> On 04/06/2011 01:56 AM, Stephen Boyd wrote:
>> +void __udelay(unsigned long usecs)
>> +{
>> + __const_udelay(usecs * ((2199023*HZ)>>11));
>
> This will overflow if HZ=1000.
> If I remember correct I fixed it like this:
> __const_udelay(usecs * ((2199023UL*HZ)>>11));
>
Thanks. I see that my compiler spits out a warning when HZ is 1000.
I'll squash this in before sending to the tracker. Care to send a Tested-by?
----->8-----8<-----
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c
index f664002..e7229bf 100644
--- a/arch/arm/lib/delay.c
+++ b/arch/arm/lib/delay.c
@@ -80,6 +80,6 @@ EXPORT_SYMBOL(__const_udelay);
*/
void __udelay(unsigned long usecs)
{
- __const_udelay(usecs * ((2199023*HZ)>>11));
+ __const_udelay(usecs * ((2199023UL*HZ)>>11));
}
EXPORT_SYMBOL(__udelay);
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv5 1/3] ARM: Translate delay.S into (mostly) C
Date: Wed, 06 Apr 2011 10:34:16 -0700 [thread overview]
Message-ID: <4D9CA418.2030107@codeaurora.org> (raw)
In-Reply-To: <4D9C2910.6020309@stericsson.com>
On 04/06/2011 01:49 AM, Mattias Wallin wrote:
> On 04/06/2011 01:56 AM, Stephen Boyd wrote:
>> +void __udelay(unsigned long usecs)
>> +{
>> + __const_udelay(usecs * ((2199023*HZ)>>11));
>
> This will overflow if HZ=1000.
> If I remember correct I fixed it like this:
> __const_udelay(usecs * ((2199023UL*HZ)>>11));
>
Thanks. I see that my compiler spits out a warning when HZ is 1000.
I'll squash this in before sending to the tracker. Care to send a Tested-by?
----->8-----8<-----
diff --git a/arch/arm/lib/delay.c b/arch/arm/lib/delay.c
index f664002..e7229bf 100644
--- a/arch/arm/lib/delay.c
+++ b/arch/arm/lib/delay.c
@@ -80,6 +80,6 @@ EXPORT_SYMBOL(__const_udelay);
*/
void __udelay(unsigned long usecs)
{
- __const_udelay(usecs * ((2199023*HZ)>>11));
+ __const_udelay(usecs * ((2199023UL*HZ)>>11));
}
EXPORT_SYMBOL(__udelay);
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
next prev parent reply other threads:[~2011-04-06 17:34 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-05 23:56 [PATCHv5 0/3] Constant udelay() for SMP and non-SMP systems Stephen Boyd
2011-04-05 23:56 ` Stephen Boyd
2011-04-05 23:56 ` [PATCHv5 1/3] ARM: Translate delay.S into (mostly) C Stephen Boyd
2011-04-05 23:56 ` Stephen Boyd
2011-04-06 8:49 ` Mattias Wallin
2011-04-06 8:49 ` Mattias Wallin
2011-04-06 17:34 ` Stephen Boyd [this message]
2011-04-06 17:34 ` Stephen Boyd
2011-04-07 1:27 ` Saravana Kannan
2011-04-07 1:27 ` Saravana Kannan
2011-04-07 7:27 ` Mattias Wallin
2011-04-07 7:27 ` Mattias Wallin
2011-04-07 7:27 ` Mattias Wallin
2011-04-07 7:29 ` Mattias Wallin
2011-04-07 7:29 ` Mattias Wallin
2011-04-05 23:56 ` [PATCHv5 2/3] ARM: Allow machines to override __delay() Stephen Boyd
2011-04-05 23:56 ` Stephen Boyd
2011-04-07 7:30 ` Mattias Wallin
2011-04-07 7:30 ` Mattias Wallin
2011-04-07 7:30 ` Mattias Wallin
2011-04-05 23:56 ` [PATCHv5 3/3] ARM: Implement a timer based __delay() loop Stephen Boyd
2011-04-05 23:56 ` Stephen Boyd
2011-04-07 7:30 ` Mattias Wallin
2011-04-07 7:30 ` Mattias Wallin
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=4D9CA418.2030107@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=akpm@linux-foundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mattias.wallin@stericsson.com \
--cc=skannan@codeaurora.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.