[IB/mthca]: Fix error CQ entry handling on mem-free HCAs
authorRoland Dreier <roland@eddore.topspincom.com>
Wed, 27 Jul 2005 21:38:49 +0000 (14:38 -0700)
committerRoland Dreier <roland@eddore.topspincom.com>
Wed, 27 Jul 2005 21:38:49 +0000 (14:38 -0700)
Fix handling of error CQ entries on mem-free HCAs: the doorbell count
is never valid so we shouldn't look at it.  This fixes problems exposed
by new HCA firmware.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/mthca/mthca_cq.c

index b5aea7b869f6c65bb9b820deb2f5566878126f16..5687c3014522567140845aaa8ac3cde98df1539b 100644 (file)
@@ -373,8 +373,12 @@ static int handle_error_cqe(struct mthca_dev *dev, struct mthca_cq *cq,
         * If we're at the end of the WQE chain, or we've used up our
         * doorbell count, free the CQE.  Otherwise just update it for
         * the next poll operation.
+        *
+        * This does not apply to mem-free HCAs: they don't use the
+        * doorbell count field, and so we should always free the CQE.
         */
-       if (!(new_wqe & cpu_to_be32(0x3f)) || (!cqe->db_cnt && dbd))
+       if (mthca_is_memfree(dev) ||
+           !(new_wqe & cpu_to_be32(0x3f)) || (!cqe->db_cnt && dbd))
                return 0;
 
        cqe->db_cnt   = cpu_to_be16(be16_to_cpu(cqe->db_cnt) - dbd);