lkml.org 
[lkml]   [2011]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateFri, 24 Jun 2011 14:47:37 -0700
SubjectRe: [PATCH 2/2] i7core_edac: Add scrubbing support
FromTony Luck <>
On Wed, Mar 30, 2011 at 6:21 AM, Samuel Gabrielsson
<samuel.gabrielsson@gmail.com> wrote:
> +       const u32 cache_line_size = 64;
> +       const u32 freq_dclk = 800*1000000;

Is dclk always 800 MHz? If so, a #define might me nice - you use it again in
get_sdram_scrub_rate(). If not, then getting the actual frequency from some
place would be good.

> +               dw_scrub = 0x00ffffff & (cache_line_size * freq_dclk / new_bw);

Does this give the right answer? It looks like you overflow the "u32" size
of these calculations when you do 64*800000000 = 51200000000.
> +       return 0xffffffff & (cache_line_size * freq_dclk / (u64) scrubval);

Ditto on the overflow question here.

-Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-06-24 23:49    [from the cache]
©2003-2010