From: Kyle McMartin <kmcmartin-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
hnguyen-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org,
raisch-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH] ib_ehca: fix compile failure on ppc64
Date: Tue, 28 Feb 2012 10:15:46 -0500 [thread overview]
Message-ID: <20120228151545.GF29211@redacted.bos.redhat.com> (raw)
In-Reply-To: <CAL1RGDXjF-Y-UABiondu6y9k9HRoxgE9oVAbp-BJ4x+iuRjiWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Mon, Feb 27, 2012 at 09:18:35PM -0800, Roland Dreier wrote:
> On Mon, Feb 27, 2012 at 2:02 PM, Kyle McMartin <kmcmartin-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> > static u64 ehca_get_max_hwpage_size(struct ehca_shca *shca)
> > {
> > - return 1UL << ilog2(shca->hca_cap_mr_pgsize);
> > + u32 pgsize = shca->hca_cap_mr_pgsize;
> > + return 1UL << ilog2(pgsize);
> > }
>
> How about using rounddown_pow_of_two(shca->hca_cap_mr_pgsize)?
> Does that build? Because that seems to me to be a cleaner way of
> expressing this anyway...
>
Yeah, that works too, good catch, I should have noticed that sooner.
> Something about that ilog2() implementation seems to trigger gcc
> bugs, I seem to remember some other bogus compile failure on
> sparc involving it as well...
>
I suspect it's the 64 deep trinary operators ;-) (It seems to trip up on
the __builtin_constant_p and hit the second ____ilog2_NaN) It's a pretty
weird .config dependent bug, I'm very confused by it.
Suggested-by: Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>
Signed-off-by: Kyle McMartin <kmcmarti-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
--- a/drivers/infiniband/hw/ehca/ehca_mrmw.c
+++ b/drivers/infiniband/hw/ehca/ehca_mrmw.c
@@ -112,7 +112,7 @@ static u32 ehca_encode_hwpage_size(u32 pgsize)
static u64 ehca_get_max_hwpage_size(struct ehca_shca *shca)
{
- return 1UL << ilog2(shca->hca_cap_mr_pgsize);
+ return rounddown_pow_of_two(shca->hca_cap_mr_pgsize);
}
static struct ehca_mr *ehca_mr_new(void)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-02-28 15:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-27 22:02 [PATCH] ib_ehca: fix compile failure on ppc64 Kyle McMartin
[not found] ` <20120227220255.GE29211-nxOev/eQj6CGu0OVIAPS5KfLeoKvNuZc@public.gmane.org>
2012-02-28 5:18 ` Roland Dreier
[not found] ` <CAL1RGDXjF-Y-UABiondu6y9k9HRoxgE9oVAbp-BJ4x+iuRjiWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-02-28 15:15 ` Kyle McMartin [this message]
[not found] ` <20120228151545.GF29211-nxOev/eQj6CGu0OVIAPS5KfLeoKvNuZc@public.gmane.org>
2012-03-19 10:05 ` Hoang-Nam Nguyen
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=20120228151545.GF29211@redacted.bos.redhat.com \
--to=kmcmartin-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=hnguyen-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=raisch-tA70FqPdS9bQT0dZR+AlfA@public.gmane.org \
--cc=roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org \
/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