Re: [PATCH 2/2] i7core_edac: Add scrubbing support

From: Nils Carlson
Date: Fri Jul 22 2011 - 10:48:36 EST


Hi, thanks for the comments. Unfortunately Samuel moved on to other stuff
so I'll try to fix these.

On Fri, 24 Jun 2011, Tony Luck wrote:

> On Wed, Mar 30, 2011 at 6:21 AM, Samuel Gabrielsson
> <samuel.gabrielsson@xxxxxxxxx> 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.

Does anybody know a good reliable way to get the frequency from within the
kernel? dmidecode works, but any easier ways would be nice. Happy for any
help.


> > +               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.
>

Will check. Thanks for the catch.

/Nils


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