Commit:     6bdd61d876e6eacea5c59230b6b2d988b22793e6
Parent:     839fcaba355abaffb7b44f0f4504093acb0b11cf
Author:     David Howells <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 5 16:21:08 2007 -0800
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Sat Feb 10 08:00:49 2007 -0800

    IB/mthca: Work around gcc bug on sparc64
    For some reason gcc-3.4.5 on sparc64 does:
     WARNING: "____ilog2_NaN" [drivers/infiniband/hw/mthca/ib_mthca.ko] 
    Points to note:
     (1) The asm volatile flush/flushw are just markers for viewing what comes 
         in the assembly; removing them has no effect on the result.
     (2) Changing almost anything else in dwh__mthca_arbel_init_srq_context() or
         dwh__mthca_alloc_srq() causes the problem to go away.
    The compiler command line issued by the kernel build is:
 -fno-strict-aliasing -fno-common -Os -m64 -mno-fpu -mcpu=ultrasparc 
-mcmodel=medlow -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wa,--undeclared-regs -pg 
-fno-omit-frame-pointer -fno-optimize-sibling-calls 
-fasynchronous-unwind-tables -g  -c -o 
    This can be reduced to this whilst still retaining the problem:
 -m64 -c -o drivers/infiniband/hw/mthca/mthca_srq.o 
drivers/infiniband/hw/mthca/mthca_srq.c -Os
    Removing -Os or changing it to -O or -O0 thru -O6 gets rid of the problem.
    This patch to the kernel code fixes the problem:
    Cc: "David S. Miller" <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
 drivers/infiniband/hw/mthca/mthca_srq.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c 
index 10684da..61974b0 100644
--- a/drivers/infiniband/hw/mthca/mthca_srq.c
+++ b/drivers/infiniband/hw/mthca/mthca_srq.c
@@ -116,11 +116,16 @@ static void mthca_arbel_init_srq_context(struct mthca_dev 
                                         struct mthca_srq *srq,
                                         struct mthca_arbel_srq_context 
-       int logsize;
+       int logsize, max;
        memset(context, 0, sizeof *context);
-       logsize = ilog2(srq->max);
+       /*
+        * Put max in a temporary variable to work around gcc bug
+        * triggered by ilog2() on sparc64.
+        */
+       max = srq->max;
+       logsize = ilog2(max);
        context->state_logsize_srqn = cpu_to_be32(logsize << 24 | srq->srqn);
        context->lkey = cpu_to_be32(srq->mr.ibmr.lkey);
        context->db_index = cpu_to_be32(srq->db_index);
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to