summaryrefslogtreecommitdiffstats
path: root/drivers/virtio/virtio_ring.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-03-18 18:22:37 +0100
committerTakashi Iwai <tiwai@suse.de>2012-03-18 18:22:37 +0100
commitcb3f2adc03ab055b19c677a6283523861fafebdd (patch)
tree59cfb6800f0635a4aec16c8e0da619f27e51ee79 /drivers/virtio/virtio_ring.c
parent44c76a960a62fcc46cbcaa0a22a34e666a729329 (diff)
parent828006de1bddf83b6ecf03ec459c15f7c7c22db7 (diff)
downloadop-kernel-dev-cb3f2adc03ab055b19c677a6283523861fafebdd.zip
op-kernel-dev-cb3f2adc03ab055b19c677a6283523861fafebdd.tar.gz
Merge branch 'topic/asoc' into for-linus
Diffstat (limited to 'drivers/virtio/virtio_ring.c')
-rw-r--r--drivers/virtio/virtio_ring.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 79e1b29..5aa43c3 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -35,7 +35,7 @@
#define virtio_rmb(vq) \
do { if ((vq)->weak_barriers) smp_rmb(); else rmb(); } while(0)
#define virtio_wmb(vq) \
- do { if ((vq)->weak_barriers) smp_rmb(); else rmb(); } while(0)
+ do { if ((vq)->weak_barriers) smp_wmb(); else wmb(); } while(0)
#else
/* We must force memory ordering even if guest is UP since host could be
* running on another CPU, but SMP barriers are defined to barrier() in that
@@ -308,9 +308,9 @@ bool virtqueue_kick_prepare(struct virtqueue *_vq)
bool needs_kick;
START_USE(vq);
- /* Descriptors and available array need to be set before we expose the
- * new available array entries. */
- virtio_wmb(vq);
+ /* We need to expose available array entries before checking avail
+ * event. */
+ virtio_mb(vq);
old = vq->vring.avail->idx - vq->num_added;
new = vq->vring.avail->idx;
OpenPOWER on IntegriCloud