]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/enic/vnic_rq.h
Merge branch 'thinkpad-acpi' into release
[linux-2.6-omap-h63xx.git] / drivers / net / enic / vnic_rq.h
index 82bfca67cc4d18cac256fa61d01fe90b013f5d1b..fd0ef66d2e9f5cfb66d1fe9e0f15858b8da056c6 100644 (file)
@@ -132,8 +132,15 @@ static inline void vnic_rq_post(struct vnic_rq *rq,
 #define VNIC_RQ_RETURN_RATE            0xf     /* keep 2^n - 1 */
 #endif
 
-       if ((buf->index & VNIC_RQ_RETURN_RATE) == 0)
+       if ((buf->index & VNIC_RQ_RETURN_RATE) == 0) {
+               /* Adding write memory barrier prevents compiler and/or CPU
+                * reordering, thus avoiding descriptor posting before
+                * descriptor is initialized. Otherwise, hardware can read
+                * stale descriptor fields.
+                */
+               wmb();
                iowrite32(buf->index, &rq->ctrl->posted_index);
+       }
 }
 
 static inline void vnic_rq_return_descs(struct vnic_rq *rq, unsigned int count)