aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorZoltan HERPAI <wigyori@uid0.hu>2016-07-21 16:13:09 +0200
committerZoltan HERPAI <wigyori@uid0.hu>2016-07-21 16:13:09 +0200
commitcd91ba788bddf420fbe2d85d75016c2f22cf8580 (patch)
treec2a6e2d8ea34ec8cb0c5ce1c077fa09b64a3ea30 /target
parent2be862b6fc3a9d1be0fec85af3133673946ad283 (diff)
downloadmaster-187ad058-cd91ba788bddf420fbe2d85d75016c2f22cf8580.tar.gz
master-187ad058-cd91ba788bddf420fbe2d85d75016c2f22cf8580.tar.bz2
master-187ad058-cd91ba788bddf420fbe2d85d75016c2f22cf8580.zip
generic/4.4: backport virtio_ring patch for reverting weak barriers patch
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Diffstat (limited to 'target')
-rw-r--r--target/linux/generic/patches-4.4/150-virtio-revert_dma_wmb_rmb_weak_barriers.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/target/linux/generic/patches-4.4/150-virtio-revert_dma_wmb_rmb_weak_barriers.patch b/target/linux/generic/patches-4.4/150-virtio-revert_dma_wmb_rmb_weak_barriers.patch
new file mode 100644
index 0000000000..0abbefa44d
--- /dev/null
+++ b/target/linux/generic/patches-4.4/150-virtio-revert_dma_wmb_rmb_weak_barriers.patch
@@ -0,0 +1,55 @@
+diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
+index 8e50888..67e06fe 100644
+--- a/include/linux/virtio_ring.h
++++ b/include/linux/virtio_ring.h
+@@ -21,20 +21,19 @@
+ * actually quite cheap.
+ */
+
++#ifdef CONFIG_SMP
+ static inline void virtio_mb(bool weak_barriers)
+ {
+-#ifdef CONFIG_SMP
+ if (weak_barriers)
+ smp_mb();
+ else
+-#endif
+ mb();
+ }
+
+ static inline void virtio_rmb(bool weak_barriers)
+ {
+ if (weak_barriers)
+- dma_rmb();
++ smp_rmb();
+ else
+ rmb();
+ }
+@@ -42,10 +41,26 @@ static inline void virtio_rmb(bool weak_barriers)
+ static inline void virtio_wmb(bool weak_barriers)
+ {
+ if (weak_barriers)
+- dma_wmb();
++ smp_wmb();
+ else
+ wmb();
+ }
++#else
++static inline void virtio_mb(bool weak_barriers)
++{
++ mb();
++}
++
++static inline void virtio_rmb(bool weak_barriers)
++{
++ rmb();
++}
++
++static inline void virtio_wmb(bool weak_barriers)
++{
++ wmb();
++}
++#endif
+
+ struct virtio_device;
+ struct virtqueue;