tree e12240b90a87a22edf0846e1939254d6ae085737
parent 9e566d8bd61f939b7f5d7d969f5b178571471cf9
author Roland Dreier <[EMAIL PROTECTED]> Thu, 28 Jul 2005 04:38:49 -0700
committer Roland Dreier <[EMAIL PROTECTED]> Thu, 28 Jul 2005 04:38:49 -0700

[IB/mthca]: Fix error CQ entry handling on mem-free HCAs

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 <[EMAIL PROTECTED]>

 drivers/infiniband/hw/mthca/mthca_cq.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c 
b/drivers/infiniband/hw/mthca/mthca_cq.c
--- a/drivers/infiniband/hw/mthca/mthca_cq.c
+++ b/drivers/infiniband/hw/mthca/mthca_cq.c
@@ -373,8 +373,12 @@ static int handle_error_cqe(struct mthca
         * 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);
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to