Commit 55e49dc4 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin

virtio_ring: switch to dma_XX barriers for rpmsg

virtio is using barriers to order memory accesses, thus
dma_wmb/rmb is a good match.

Before
[mst@tuck linux]$ size drivers/virtio/virtio_ring.o
   text    data     bss     dec     hex filename
  11392     820       0   12212    2fb4 drivers/virtio/virtio_ring.o

After
mst@tuck linux]$ size drivers/virtio/virtio_ring.o
   text    data     bss     dec     hex filename
  11284     820       0   12104    2f48 drivers/virtio/virtio_ring.o

Cc: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: linux-remoteproc@vger.kernel.org
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 29dcea88
...@@ -35,7 +35,7 @@ static inline void virtio_rmb(bool weak_barriers) ...@@ -35,7 +35,7 @@ static inline void virtio_rmb(bool weak_barriers)
if (weak_barriers) if (weak_barriers)
virt_rmb(); virt_rmb();
else else
rmb(); dma_rmb();
} }
static inline void virtio_wmb(bool weak_barriers) static inline void virtio_wmb(bool weak_barriers)
...@@ -43,7 +43,7 @@ static inline void virtio_wmb(bool weak_barriers) ...@@ -43,7 +43,7 @@ static inline void virtio_wmb(bool weak_barriers)
if (weak_barriers) if (weak_barriers)
virt_wmb(); virt_wmb();
else else
wmb(); dma_wmb();
} }
static inline void virtio_store_mb(bool weak_barriers, static inline void virtio_store_mb(bool weak_barriers,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment