From: Dmitry Osipenko Date: Mon, 29 May 2023 22:39:32 +0000 (+0300) Subject: udmabuf: Don't assert held reservation lock for dma-buf mmapping X-Git-Tag: v6.6.17~3937^2~23^2~151 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=42850c9aadfe56fa640b4b77bee4b3c3dab0d583;p=platform%2Fkernel%2Flinux-rpi.git udmabuf: Don't assert held reservation lock for dma-buf mmapping Don't assert held dma-buf reservation lock on memory mapping of exported buffer. We're going to change dma-buf mmap() locking policy such that exporters will have to handle the lock. The previous locking policy caused deadlock problem for DRM drivers in a case of self-imported dma-bufs once these drivers are moved to use reservation lock universally. The problem is solved by moving the lock down to exporters. This patch prepares udmabuf for the locking policy update. Reviewed-by: Emil Velikov Signed-off-by: Dmitry Osipenko Link: https://patchwork.freedesktop.org/patch/msgid/20230529223935.2672495-4-dmitry.osipenko@collabora.com --- diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c index 01f2e86..06729cd 100644 --- a/drivers/dma-buf/udmabuf.c +++ b/drivers/dma-buf/udmabuf.c @@ -52,8 +52,6 @@ static int mmap_udmabuf(struct dma_buf *buf, struct vm_area_struct *vma) { struct udmabuf *ubuf = buf->priv; - dma_resv_assert_held(buf->resv); - if ((vma->vm_flags & (VM_SHARED | VM_MAYSHARE)) == 0) return -EINVAL;