Re: linux-next: Tree for Aug 26 (i7core_edac)

From: Sedat Dilek
Date: Fri Aug 26 2011 - 10:16:16 EST


On Fri, Aug 26, 2011 at 10:07 AM, Randy Dunlap <rdunlap@xxxxxxxxxxxx> wrote:
>
> On Thu, August 25, 2011 10:00 pm, Stephen Rothwell wrote:
>> Hi all,
>>
>> The powerpc allyesconfig build still fails today.
>>
>> Changes since 20110825:
>
>
> on i386:
>
> ERROR: "__udivdi3" [drivers/edac/i7core_edac.ko] undefined!
>
> in both get_sdram_scrub_rate()
> and set_sdram_scrub_rate()
>
> --
> ~Randy
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-next" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at Âhttp://vger.kernel.org/majordomo-info.html
>

Hi Randy,

can you test with the patch attached, please?

( UNTESTED, just followed patches like "[PATCH] p54: Use do_div for
64-bit division to fix 32-bit kernels" or "[PATCH v1] carl9170: Use
do_div for 64-bit division to fix 32-bit kernels" )

Regards,
- Sedat -
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 7cb68de..4d4f3a5 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -37,6 +37,7 @@
#include <linux/smp.h>
#include <asm/mce.h>
#include <asm/processor.h>
+#include <asm/div64.h>

#include "edac_core.h"

@@ -2102,7 +2103,8 @@ static int set_sdram_scrub_rate(struct mem_ctl_info *mci, u32 new_bw)
* program the corresponding register value.
*/
scrub_interval = (unsigned long long)freq_dclk_mhz *
- cache_line_size * 1000000 / new_bw;
+ cache_line_size * 1000000);
+ do_div(scrub_interval, new_bw);

if (!scrub_interval || scrub_interval > SCRUBINTERVAL_MASK)
return -EINVAL;
@@ -2153,7 +2155,8 @@ static int get_sdram_scrub_rate(struct mem_ctl_info *mci)

/* Calculate scrub rate value into byte/sec bandwidth */
scrub_rate = (unsigned long long)freq_dclk_mhz *
- 1000000 * cache_line_size / scrubval;
+ 1000000 * cache_line_size);
+ do_div(scrub_rate, scrubval);
return (int)scrub_rate;
}