From: Josh Boyer <jwboyer@redhat.com>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: sb_edac 32-bit compile fail due to 64-bit divide
Date: Thu, 3 Nov 2011 10:43:47 -0400 [thread overview]
Message-ID: <20111103144347.GG19809@zod.bos.redhat.com> (raw)
In-Reply-To: <4EB2A5FF.1040808@redhat.com>
On Thu, Nov 03, 2011 at 12:32:31PM -0200, Mauro Carvalho Chehab wrote:
> Em 03-11-2011 12:07, Josh Boyer escreveu:
> > Hi,
> >
> > It seems the newly added EDAC driver for SandyBridge won't build on
> > 32-bit x86 because of a 64-bit divide somewhere:
> >
> > drivers/edac/sb_edac.c: In function 'get_memory_error_data':
> > drivers/edac/sb_edac.c:861:2: warning: left shift count >= width of type
> > [enabled by default]
> > <snip>
> > ERROR: "__udivdi3" [drivers/edac/sb_edac.ko] undefined!
> > make[1]: *** [__modpost] Error 1
> > make: *** [modules] Error 2
> >
> > You can find the full build log here:
> >
> > http://koji.fedoraproject.org/koji/getfile?taskID=3482579&name=build.log
> >
> > Before I go digging into where this is done and what to do about it, I
> > do want to confirm that it is supposed to work on a 32-bit kernel,
> > correct?
>
> Thanks for pointing it!
>
> Well, I didn't test it on a 32-bit kernel. It should work through.
>
> It is probably due to those debug lines:
> debugf0("CH#%d RIR#%d INTL#%d, offset %Lu.%03Lu GB (0x%016Lx), tgt: %d, reg=0x%08x\n",
> i, j, k,
> tmp_mb / 1000, tmp_mb % 1000,
> ((u64)tmp_mb) << 20L,
> (u32)RIR_RNK_TGT(reg),
> reg);
> (same kind of calculus is recurrent at the driver)
All of that should basically not exist in this build because the debugf*
macros depend on CONFIG_EDAC_DEBUG, which isn't set in this build. The
problem seems to be somewhere else.
I would guess line 1056:
addr /= sck_xch;
addr is a u64.
> Maybe the easiest way would be to write a function that would call do_div() internally,
> and output a string with something similar to:
>
> sprintf(msg, "%Lu.%03Lu GB", tmp_mb / 1000, tmp_mb % 1000);
>
> Of course, an interim fix would be to make it depend on CONFIG_64BIT or CONFIG_X86_64.
That would work I guess. It's up to you.
>
> Regards,
> Mauro
next prev parent reply other threads:[~2011-11-03 14:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-03 14:07 Josh Boyer
2011-11-03 14:32 ` Mauro Carvalho Chehab
2011-11-03 14:43 ` Josh Boyer [this message]
2011-11-03 16:31 ` Luck, Tony
2011-11-03 17:41 ` Mauro Carvalho Chehab
2011-11-03 17:48 ` Josh Boyer
2011-11-03 17:51 ` Mauro Carvalho Chehab
2011-11-03 17:20 ` Mauro Carvalho Chehab
2011-11-07 21:29 ` [PATCH] Fix sb_edac compilation with 32 bits kernels Mauro Carvalho Chehab
2011-11-07 21:37 ` Josh Boyer
2011-11-07 21:54 ` Mauro Carvalho Chehab
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=20111103144347.GG19809@zod.bos.redhat.com \
--to=jwboyer@redhat.com \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®