IB/qib: Fix a possible data corruption when receiving packets
[pandora-kernel.git] / drivers / infiniband / hw / qib / qib_iba7220.c
index 439d3c5..7ec4048 100644 (file)
@@ -2725,9 +2725,11 @@ static int qib_7220_set_loopback(struct qib_pportdata *ppd, const char *what)
 static void qib_update_7220_usrhead(struct qib_ctxtdata *rcd, u64 hd,
                                    u32 updegr, u32 egrhd, u32 npkts)
 {
-       qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
        if (updegr)
                qib_write_ureg(rcd->dd, ur_rcvegrindexhead, egrhd, rcd->ctxt);
+       mmiowb();
+       qib_write_ureg(rcd->dd, ur_rcvhdrhead, hd, rcd->ctxt);
+       mmiowb();
 }
 
 static u32 qib_7220_hdrqempty(struct qib_ctxtdata *rcd)