| To: | David Daney <ddaney@caviumnetworks.com> |
|---|---|
| Subject: | Re: [PATCH] MIPS: Don't overflow cevt-r4k.c calculations at high clock rates. |
| From: | Thomas Gleixner <tglx@linutronix.de> |
| Date: | Wed, 19 May 2010 12:23:53 +0200 (CEST) |
| Cc: | linux-mips@linux-mips.org, ralf@linux-mips.org |
| In-reply-to: | <1274220676-4562-1-git-send-email-ddaney@caviumnetworks.com> |
| Original-recipient: | rfc822;linux-mips@linux-mips.org |
| References: | <1274220676-4562-1-git-send-email-ddaney@caviumnetworks.com> |
| Sender: | linux-mips-bounce@linux-mips.org |
| User-agent: | Alpine 2.00 (LFD 1167 2008-08-23) |
On Tue, 18 May 2010, David Daney wrote:
> The 'mult' element of struct clock_event_device must never be wider
> than 32-bits. If it were, it would get truncated when used by
> clockevent_delta2ns() when this calls do_div().
>
> We meet the requirement by ensuring that the relationship:
>
> (mips_hpt_frequency >> (32 - shift)) < NSEC_PER_SEC
>
> Always holds.
clocks_calc_mult_shift() is your friend :)
Thanks,
tglx
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH] MIPS: Don't overflow cevt-r4k.c calculations at high clock rates., Sergei Shtylyov |
|---|---|
| Next by Date: | Re: [PATCH] MIPS: Don't overflow cevt-r4k.c calculations at high clock rates., Thomas Gleixner |
| Previous by Thread: | Re: [PATCH] MIPS: Don't overflow cevt-r4k.c calculations at high clock rates., Sergei Shtylyov |
| Next by Thread: | Re: [PATCH] MIPS: Don't overflow cevt-r4k.c calculations at high clock rates., Thomas Gleixner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |