]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.18-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Feb 2019 14:06:38 +0000 (15:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Feb 2019 14:06:38 +0000 (15:06 +0100)
added patches:
drm-vmwgfx-fix-setting-of-dma-masks.patch
drm-vmwgfx-return-error-code-from-vmw_execbuf_copy_fence_user.patch

queue-3.18/drm-vmwgfx-fix-setting-of-dma-masks.patch [new file with mode: 0644]
queue-3.18/drm-vmwgfx-return-error-code-from-vmw_execbuf_copy_fence_user.patch [new file with mode: 0644]
queue-3.18/series

diff --git a/queue-3.18/drm-vmwgfx-fix-setting-of-dma-masks.patch b/queue-3.18/drm-vmwgfx-fix-setting-of-dma-masks.patch
new file mode 100644 (file)
index 0000000..e28b091
--- /dev/null
@@ -0,0 +1,44 @@
+From 4cbfa1e6c09e98450aab3240e5119b0ab2c9795b Mon Sep 17 00:00:00 2001
+From: Thomas Hellstrom <thellstrom@vmware.com>
+Date: Mon, 28 Jan 2019 10:31:33 +0100
+Subject: drm/vmwgfx: Fix setting of dma masks
+
+From: Thomas Hellstrom <thellstrom@vmware.com>
+
+commit 4cbfa1e6c09e98450aab3240e5119b0ab2c9795b upstream.
+
+Previously we set only the dma mask and not the coherent mask. Fix that.
+Also, for clarity, make sure both are initially set to 64 bits.
+
+Cc: <stable@vger.kernel.org>
+Fixes: 0d00c488f3de: ("drm/vmwgfx: Fix the driver for large dma addresses")
+Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
+Reviewed-by: Deepak Rawat <drawat@vmware.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |    9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+@@ -562,13 +562,16 @@ out_fixup:
+ static int vmw_dma_masks(struct vmw_private *dev_priv)
+ {
+       struct drm_device *dev = dev_priv->dev;
++      int ret = 0;
+-      if (intel_iommu_enabled &&
++      ret = dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(64));
++      if (dev_priv->map_mode != vmw_dma_phys &&
+           (sizeof(unsigned long) == 4 || vmw_restrict_dma_mask)) {
+               DRM_INFO("Restricting DMA addresses to 44 bits.\n");
+-              return dma_set_mask(dev->dev, DMA_BIT_MASK(44));
++              return dma_set_mask_and_coherent(dev->dev, DMA_BIT_MASK(44));
+       }
+-      return 0;
++
++      return ret;
+ }
+ #else
+ static int vmw_dma_masks(struct vmw_private *dev_priv)
diff --git a/queue-3.18/drm-vmwgfx-return-error-code-from-vmw_execbuf_copy_fence_user.patch b/queue-3.18/drm-vmwgfx-return-error-code-from-vmw_execbuf_copy_fence_user.patch
new file mode 100644 (file)
index 0000000..56e8fdb
--- /dev/null
@@ -0,0 +1,38 @@
+From 728354c005c36eaf44b6e5552372b67e60d17f56 Mon Sep 17 00:00:00 2001
+From: Thomas Hellstrom <thellstrom@vmware.com>
+Date: Thu, 31 Jan 2019 10:55:37 +0100
+Subject: drm/vmwgfx: Return error code from vmw_execbuf_copy_fence_user
+
+From: Thomas Hellstrom <thellstrom@vmware.com>
+
+commit 728354c005c36eaf44b6e5552372b67e60d17f56 upstream.
+
+The function was unconditionally returning 0, and a caller would have to
+rely on the returned fence pointer being NULL to detect errors. However,
+the function vmw_execbuf_copy_fence_user() would expect a non-zero error
+code in that case and would BUG otherwise.
+
+So make sure we return a proper non-zero error code if the fence pointer
+returned is NULL.
+
+Cc: <stable@vger.kernel.org>
+Fixes: ae2a104058e2: ("vmwgfx: Implement fence objects")
+Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
+Reviewed-by: Deepak Rawat <drawat@vmware.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
++++ b/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c
+@@ -2346,7 +2346,7 @@ int vmw_execbuf_fence_commands(struct dr
+               *p_fence = NULL;
+       }
+-      return 0;
++      return ret;
+ }
+ /**
index a256c882d1e55565b56e67a176e3146f2914e5b4..3eb91e2d6b6579aa6cd95ba605e967f1f9fd43ef 100644 (file)
@@ -80,3 +80,5 @@ debugfs-fix-debugfs_rename-parameter-checking.patch
 mips-octeon-don-t-set-octeon_dma_bar_type-if-pci-is-disabled.patch
 arm-iop32x-n2100-fix-pci-irq-mapping.patch
 drm-modes-prevent-division-by-zero-htotal.patch
+drm-vmwgfx-fix-setting-of-dma-masks.patch
+drm-vmwgfx-return-error-code-from-vmw_execbuf_copy_fence_user.patch