[PATCH v1 4/6] dma-buf/heaps: Assert held reservation lock for dma-buf mmapping

2022-11-10 Thread Dmitry Osipenko
When userspace mmaps dma-buf's fd, the dma-buf reservation lock must be held. Add locking sanity checks to the dma-buf mmaping callbacks to ensure that the locking assumptions won't regress in the future. Suggested-by: Daniel Vetter Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/heaps

[PATCH v1 6/6] fastrpc: Assert held reservation lock for dma-buf mmapping

2022-11-10 Thread Dmitry Osipenko
When userspace mmaps dma-buf's fd, the dma-buf reservation lock must be held. Add locking sanity check to the dma-buf mmaping callback to ensure that the locking assumption won't regress in the future. Suggested-by: Daniel Vetter Signed-off-by: Dmitry Osipenko --- drivers/misc/fastrpc.c | 3

[PATCH v1 2/6] drm: Assert held reservation lock for dma-buf mmapping

2022-11-10 Thread Dmitry Osipenko
When userspace mmaps dma-buf's fd, the dma-buf reservation lock must be held. Add locking sanity checks to the dma-buf mmaping callbacks of DRM drivers to ensure that the locking assumptions won't regress in future. Suggested-by: Daniel Vetter Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm

[PATCH v1 3/6] udmabuf: Assert held reservation lock for dma-buf mmapping

2022-11-10 Thread Dmitry Osipenko
When userspace mmaps dma-buf's fd, the dma-buf reservation lock must be held. Add locking sanity check to the dma-buf mmaping callback to ensure that the locking assumption won't regress in the future. Suggested-by: Daniel Vetter Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/udmabuf.c | 3

[PATCH v1 0/6] Move dma_buf_mmap_internal() to dynamic locking specification

2022-11-10 Thread Dmitry Osipenko
specification and updates drivers that support mmaping of dma-bufs to use the debug-assert of the lock. Thanks to Daniel Vetter for spotting the missed function! Dmitry Osipenko (6): dma-buf: Move dma_buf_mmap_internal() to dynamic locking specification drm: Assert held reservation lock for dma-buf

Re: [PATCH v8 4/7] drm/shmem-helper: Add memory shrinker

2022-11-09 Thread Dmitry Osipenko
Hello Thomas, On 11/9/22 13:28, Thomas Zimmermann wrote: >> +int drm_gem_shmem_set_evictable(struct drm_gem_shmem_object *shmem) >> +{ >> +    dma_resv_lock(shmem->base.resv, NULL); >> + >> +    if (shmem->madv < 0) { >> +    dma_resv_unlock(shmem->base.resv); >> +    return -ENOMEM; > >

Re: [PATCH] drm/panfrost: Split io-pgtable requests properly

2022-11-08 Thread Dmitry Osipenko
t: Update io-pgtable API") > Reported-by: Dmitry Osipenko > Signed-off-by: Robin Murphy > --- > The previous diff turned out to be not quite right, so I've not > included Dmitry's Tested-by given for that. > --- > drivers/gpu/drm/panfrost/panfrost_mmu.c | 11

Re: [PATCH] drm/panfrost: Update io-pgtable API

2022-11-08 Thread Dmitry Osipenko
On 11/7/22 19:50, Robin Murphy wrote: > On 2022-11-04 20:48, Dmitry Osipenko wrote: >> On 11/4/22 23:37, Robin Murphy wrote: >>> On 2022-11-04 20:11, Dmitry Osipenko wrote: >>>> On 8/23/22 01:01, Robin Murphy wrote: >>>>> Convert to io-pgtable's b

Re: [PATCH v7 18/21] dma-buf: Move dma_buf_mmap() to dynamic locking specification

2022-11-07 Thread Dmitry Osipenko
g. >> >> Acked-by: Sumit Semwal >> Acked-by: Christian König >> Signed-off-by: Dmitry Osipenko > Just noticed this while reading code ... this patch seems to have > missed dma_buf_mmap_internal()? > > Might be good if at least some drivers gain a dma_resv_asse

[PATCH v8 7/7] drm/panfrost: Switch to generic memory shrinker

2022-11-05 Thread Dmitry Osipenko
Replace Panfrost's custom memory shrinker with a common drm-shmem memory shrinker. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/panfrost/Makefile | 1 - drivers/gpu/drm/panfrost/panfrost_device.h| 4 - drivers/gpu/drm/panfrost/panfrost_drv.c | 19 +-- drivers

[PATCH v8 5/7] drm/gem: Add drm_gem_pin_unlocked()

2022-11-05 Thread Dmitry Osipenko
Add unlocked variants of drm_gem_un/pin() functions. These new helpers will take care of GEM dma-reservation locking for DRM drivers. VirtIO-GPU driver will use these helpers to pin shmem framebuffers, preventing them from eviction during scanout. Signed-off-by: Dmitry Osipenko --- drivers/gpu

[PATCH v8 6/7] drm/virtio: Support memory shrinking

2022-11-05 Thread Dmitry Osipenko
y if guest supports SWAP file or partition. Signed-off-by: Daniel Almeida Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/virtio/virtgpu_drv.h| 18 +++- drivers/gpu/drm/virtio/virtgpu_gem.c| 55 ++ drivers/gpu/drm/virtio/virtgpu_ioctl.c | 37 +++ drivers/gpu/drm/virtio/vir

[PATCH v8 3/7] drm/shmem-helper: Switch to reservation lock

2022-11-05 Thread Dmitry Osipenko
-by: Daniel Vetter Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_gem_shmem_helper.c| 184 +++--- drivers/gpu/drm/lima/lima_gem.c | 8 +- drivers/gpu/drm/panfrost/panfrost_drv.c | 7 +- .../gpu/drm/panfrost/panfrost_gem_shrinker.c | 6 +- drivers

[PATCH v8 4/7] drm/shmem-helper: Add memory shrinker

2022-11-05 Thread Dmitry Osipenko
drm_gem_shmem_shrinker_register(drm_device) 3. Use drm_gem_shmem_set_purgeable(shmem) and alike API functions to activate shrinking of shmem GEMs Signed-off-by: Daniel Almeida Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_gem_shmem_helper.c| 493 -- .../gpu/drm

[PATCH v8 2/7] drm/shmem-helper: Don't use vmap_use_count for dma-bufs

2022-11-05 Thread Dmitry Osipenko
DMA-buf core has its own refcounting of vmaps, use it instead of drm-shmem counting. This change prepares drm-shmem for addition of memory shrinker support where drm-shmem will use a single dma-buf reservation lock for all operations performed over dma-bufs. Signed-off-by: Dmitry Osipenko

[PATCH v8 1/7] drm/msm/gem: Prevent blocking within shrinker loop

2022-11-05 Thread Dmitry Osipenko
. If there are no remaining pages left to shrink, then there is no need to free up more pages and shrinker may break out from the loop. This problem was uncovered during shrinker/madvise IOCTL testing of virtio-gpu driver. The MSM driver is affected in the same way. Signed-off-by: Dmitry Osipenko

[PATCH v8 0/7] Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers

2022-11-05 Thread Dmitry Osipenko
-devel/20220526235040.678984-1-dmitry.osipe...@collabora.com/ Dmitry Osipenko (7): drm/msm/gem: Prevent blocking within shrinker loop drm/shmem-helper: Don't use vmap_use_count for dma-bufs drm/shmem-helper: Switch to reservation lock drm/shmem-helper: Add memory shrinker drm/gem: Add

Re: [PATCH] drm/panfrost: Update io-pgtable API

2022-11-04 Thread Dmitry Osipenko
On 11/4/22 23:37, Robin Murphy wrote: > On 2022-11-04 20:11, Dmitry Osipenko wrote: >> On 8/23/22 01:01, Robin Murphy wrote: >>> Convert to io-pgtable's bulk {map,unmap}_pages() APIs, to help the old >>> single-page interfaces eventually go away. Unmapping heap BOs

Re: [PATCH] drm/panfrost: Update io-pgtable API

2022-11-04 Thread Dmitry Osipenko
On 8/23/22 01:01, Robin Murphy wrote: > Convert to io-pgtable's bulk {map,unmap}_pages() APIs, to help the old > single-page interfaces eventually go away. Unmapping heap BOs still > wants to be done a page at a time, but everything else can get the full > benefit of the more efficient interface.

Re: [PATCH v2 2/2] drm/client: Prevent NULL dereference in drm_client_buffer_delete()

2022-11-02 Thread Dmitry Osipenko
On 11/2/22 12:15, Christian König wrote: > Am 30.10.22 um 16:44 schrieb Dmitry Osipenko: >> The drm_gem_vunmap() will crash with a NULL dereference if the passed >> object pointer is NULL. It wasn't a problem before we added the locking >> support to drm_gem_vunmap functio

[PATCH v2 1/2] dma-buf: Make locking consistent in dma_buf_detach()

2022-10-30 Thread Dmitry Osipenko
d-by: Dan Carpenter Reviewed-by: Christian König Link: https://lore.kernel.org/dri-devel/Y1fLfsccW3AS%2Fo+%2F@kili/ Fixes: 809d9c72c2f8 ("dma-buf: Move dma_buf_attach() to dynamic locking specification") Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 4 ++-- 1 file changed,

[PATCH v2 2/2] drm/client: Prevent NULL dereference in drm_client_buffer_delete()

2022-10-30 Thread Dmitry Osipenko
GEM is NULL before trying to unmap the GEM, it will happen on framebuffer creation error. Reported-by: Dan Carpenter Link: https://lore.kernel.org/dri-devel/Y1kFEGxT8MVlf32V@kili/ Fixes: 79e2cf2e7a19 ("drm/gem: Take reservation lock for vmap/vunmap operations") Signed-off-by: Dmitr

[PATCH v2 0/2] Fixes for dma-buf locking issues found by Smatch

2022-10-30 Thread Dmitry Osipenko
the dma-buf/attachment pointer check. - Dropped v1 patch that added GEM NULL-checking to drm_gem_vunmap_unlocked() and replaced it with the NULL-checking in drm_client_buffer_delete(), like was suggested by Christian König. Dmitry Osipenko (2): dma-buf: Make locking

Re: [PATCH v1 1/2] dma-buf: Make locking consistent in dma_buf_detach()

2022-10-27 Thread Dmitry Osipenko
On 10/27/22 09:13, Christian König wrote: > Am 27.10.22 um 00:46 schrieb Dmitry Osipenko: >> The dma_buf_detach() locks attach->dmabuf->resv and then unlocks >> dmabuf->resv, which could be a two different locks from a static >> code checker perspective. In p

[PATCH v1 1/2] dma-buf: Make locking consistent in dma_buf_detach()

2022-10-26 Thread Dmitry Osipenko
d-by: Dan Carpenter Link: https://lore.kernel.org/dri-devel/Y1fLfsccW3AS%2Fo+%2F@kili/ Fixes: 809d9c72c2f8 ("dma-buf: Move dma_buf_attach() to dynamic locking specification") Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

[PATCH v1 2/2] drm/gem: Check whether object is NULL in drm_gem_vunmap()

2022-10-26 Thread Dmitry Osipenko
pointers better. Reported-by: Dan Carpenter Link: https://lore.kernel.org/dri-devel/Y1kFEGxT8MVlf32V@kili/ Fixes: 79e2cf2e7a19 ("drm/gem: Take reservation lock for vmap/vunmap operations") Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_gem.c | 9 ++--- 1 file changed, 6

[PATCH v1 0/2] Fixes for dma-buf locking issues found by Smatch

2022-10-26 Thread Dmitry Osipenko
Hello, Here are the two patches fixing minor problems introduced by my "dma-buf locking convention" series. Thanks to Dan Carpenter who checked linux-next with Smatch and reported the found issues! Please review/ack, I'll apply the patches to misc-next afterwards. Thanks! Dmitry O

Re: [PATCH] drm/rockchip: dw_hdmi: filter regulator -EPROBE_DEFER error messages

2022-10-26 Thread Dmitry Osipenko
DEV_ERROR(hdmi->dev, "Unable to parse OF data\n"); > + if (ret != -EPROBE_DEFER) > + DRM_DEV_ERROR(hdmi->dev, "Unable to parse OF data\n"); > return ret; > } > Reviewed-by: Dmitry Osipenko Nit: all th

Re: [bug report] drm/gem: Add drm_gem_object_funcs

2022-10-26 Thread Dmitry Osipenko
On 10/26/22 12:59, Dan Carpenter wrote: > Hello Noralf Trønnes, > > The patch b39b5394fabc: "drm/gem: Add drm_gem_object_funcs" from Nov > 10, 2018, leads to the following Smatch static checker warning: > > drivers/gpu/drm/drm_client.c:240 drm_client_buffer_delete() > warn: variable

Re: [bug report] dma-buf: Move dma_buf_attach() to dynamic locking specification

2022-10-25 Thread Dmitry Osipenko
On 10/25/22 14:41, Dan Carpenter wrote: > Hello Dmitry Osipenko, > > The patch 809d9c72c2f8: "dma-buf: Move dma_buf_attach() to dynamic > locking specification" from Oct 17, 2022, leads to the following > Smatch static checker warning: > >

Re: [PATCH v1] drm: Switch drm_client_buffer_delete() to unlocked drm_gem_vunmap

2022-10-24 Thread Dmitry Osipenko
On 10/21/22 00:33, Dmitry Osipenko wrote: > The drm_client_buffer_delete() wasn't switched to unlocked GEM vunmapping > by accident when rest of drm_client code transitioned to the unlocked > variants of the vmapping functions. Make drm_client_buffer_delete() use > the unlocked variant

[PATCH v2] ACPI: video: Fix missing native backlight on Chromebooks

2022-10-24 Thread Dmitry Osipenko
: Add acpi_video_backlight_use_native() helper") Signed-off-by: Dmitry Osipenko --- Changelog: v2: - Added explanatory comment to the code and added check for the native backlight presence, like was requested by Hans de Goede. drivers/acpi/video_detect.c | 12 1 file changed, 12 insertions(+)

Re: [PATCH v1] ACPI: video: Fix missing native backlight on Chromebooks

2022-10-24 Thread Dmitry Osipenko
On 10/24/22 16:46, Hans de Goede wrote: > Hi, > > On 10/24/22 15:32, Dmitry Osipenko wrote: >> Chromebooks don't have backlight in ACPI table, they suppose to use >> native backlight in this case. Check presence of the CrOS embedded >> controller ACPI device and prefer

[PATCH v1] ACPI: video: Fix missing native backlight on Chromebooks

2022-10-24 Thread Dmitry Osipenko
when another backlight should be used (v2)") Signed-off-by: Dmitry Osipenko --- drivers/acpi/video_detect.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 0d9064a9804c..8ed5021de6fb 100644 --- a/drivers/acpi/video_dete

Re: [PATCH v1] drm: Switch drm_client_buffer_delete() to unlocked drm_gem_vunmap

2022-10-23 Thread Dmitry Osipenko
Hello, On 10/21/22 00:33, Dmitry Osipenko wrote: > The drm_client_buffer_delete() wasn't switched to unlocked GEM vunmapping > by accident when rest of drm_client code transitioned to the unlocked > variants of the vmapping functions. Make drm_client_buffer_delete() use > the unlo

[PATCH v1] drm: Switch drm_client_buffer_delete() to unlocked drm_gem_vunmap

2022-10-20 Thread Dmitry Osipenko
lock when framebuffer is released. Reported-by: kernel test robot Link: https://lore.kernel.org/dri-devel/890f70db-68b0-8456-ca3c-c5496ef90...@collabora.com/T/ Fixes: 79e2cf2e7a19 ("drm/gem: Take reservation lock for vmap/vunmap operations") Signed-off-by: Dmitry Osipenko --- drive

Re: [drm/gem] 79e2cf2e7a: WARNING:at_drivers/gpu/drm/drm_gem.c:#drm_gem_vunmap

2022-10-20 Thread Dmitry Osipenko
On 10/20/22 06:38, Dmitry Osipenko wrote: > On 10/20/22 06:23, kernel test robot wrote: >> Greeting, >> >> FYI, we noticed WARNING:at_drivers/gpu/drm/drm_gem.c:#drm_gem_vunmap due to >> commit (built with clang-14): >> >> commit: 79e2cf2e7a193473d

Re: [drm/gem] 79e2cf2e7a: WARNING:at_drivers/gpu/drm/drm_gem.c:#drm_gem_vunmap

2022-10-19 Thread Dmitry Osipenko
On 10/20/22 06:23, kernel test robot wrote: > Greeting, > > FYI, we noticed WARNING:at_drivers/gpu/drm/drm_gem.c:#drm_gem_vunmap due to > commit (built with clang-14): > > commit: 79e2cf2e7a193473dfb0da3b9b869682b43dc60f ("drm/gem: Take reservation > lock for vmap/vunmap operations") >

Re: [PATCH v7 00/21] Move all drivers to a common dma-buf locking convention

2022-10-18 Thread Dmitry Osipenko
On 10/18/22 14:34, Christian König wrote: > Am 18.10.22 um 01:07 schrieb Dmitry Osipenko: >> On 10/17/22 20:22, Dmitry Osipenko wrote: >>> Hello, >>> >>> This series moves all drivers to a dynamic dma-buf locking >>> specification. >>>  

Re: [PATCH v7 00/21] Move all drivers to a common dma-buf locking convention

2022-10-17 Thread Dmitry Osipenko
On 10/17/22 20:22, Dmitry Osipenko wrote: > Hello, > > This series moves all drivers to a dynamic dma-buf locking specification. > From now on all dma-buf importers are made responsible for holding > dma-buf's reservation lock around all operations performed over dma-bufs

[PATCH v7 18/21] dma-buf: Move dma_buf_mmap() to dynamic locking specification

2022-10-17 Thread Dmitry Osipenko
Move dma_buf_mmap() function to the dynamic locking specification by taking the reservation lock. Neither of the today's drivers take the reservation lock within the mmap() callback, hence it's safe to enforce the locking. Acked-by: Sumit Semwal Acked-by: Christian König Signed-off-by: Dmitry

[PATCH v7 15/21] dma-buf: Move dma_buf_vmap() to dynamic locking specification

2022-10-17 Thread Dmitry Osipenko
Move dma_buf_vmap/vunmap() functions to the dynamic locking specification by asserting that the reservation lock is held. Acked-by: Sumit Semwal Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH v7 21/21] dma-buf: Remove obsoleted internal lock

2022-10-17 Thread Dmitry Osipenko
-by: Christian König Reviewed-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 14 -- include/linux/dma-buf.h | 9 - 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index

[PATCH v7 17/21] dma-buf: Move dma_buf_map_attachment() to dynamic locking specification

2022-10-17 Thread Dmitry Osipenko
Move dma-buf attachment mapping functions to the dynamic locking specification by asserting that the reservation lock is held. Acked-by: Sumit Semwal Reviewed-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 10 ++ 1 file changed, 2 insertions(+), 8

[PATCH v7 16/21] dma-buf: Move dma_buf_attach() to dynamic locking specification

2022-10-17 Thread Dmitry Osipenko
-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 2c4381bb9478..d685a5adb122 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c

[PATCH v7 19/21] dma-buf: Document dynamic locking convention

2022-10-17 Thread Dmitry Osipenko
Add documentation for the dynamic locking convention. The documentation tells dma-buf API users when they should take the reservation lock and when not. Acked-by: Sumit Semwal Reviewed-by: Christian König Signed-off-by: Dmitry Osipenko --- Documentation/driver-api/dma-buf.rst | 6

[PATCH v7 20/21] media: videobuf2: Stop using internal dma-buf lock

2022-10-17 Thread Dmitry Osipenko
. Acked-by: Tomasz Figa Acked-by: Hans Verkuil Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11 +-- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 11 +-- drivers/media/common/videobuf2/videobuf2

[PATCH v7 13/21] media: videobuf2: Prepare to dynamic dma-buf locking specification

2022-10-17 Thread Dmitry Osipenko
Prepare V4L2 memory allocators to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Tomasz Figa Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11

[PATCH v7 11/21] misc: fastrpc: Prepare to dynamic dma-buf locking specification

2022-10-17 Thread Dmitry Osipenko
Prepare fastrpc to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Acked-by: Srinivas Kandagatla Signed-off-by: Dmitry Osipenko --- drivers/misc/fastrpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3

[PATCH v7 10/21] RDMA/umem: Prepare to dynamic dma-buf locking specification

2022-10-17 Thread Dmitry Osipenko
Prepare InfiniBand drivers to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Jason Gunthorpe Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/infiniband/core/umem_dmabuf.c | 7 --- 1 file

[PATCH v7 14/21] media: tegra-vde: Prepare to dynamic dma-buf locking specification

2022-10-17 Thread Dmitry Osipenko
Prepare Tegra video decoder driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +++--- 1 file changed

[PATCH v7 08/21] drm/tegra: Prepare to dynamic dma-buf locking specification

2022-10-17 Thread Dmitry Osipenko
Prepare Tegra DRM driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/gem.c | 17 + 1 file changed, 9 insertions(+), 8

[PATCH v7 09/21] drm/etnaviv: Prepare to dynamic dma-buf locking specification

2022-10-17 Thread Dmitry Osipenko
Prepare Etnaviv driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v7 07/21] drm/omapdrm: Prepare to dynamic dma-buf locking specification

2022-10-17 Thread Dmitry Osipenko
Prepare OMAP DRM driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v7 12/21] xen/gntdev: Prepare to dynamic dma-buf locking specification

2022-10-17 Thread Dmitry Osipenko
Prepare gntdev driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Juergen Gross Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/xen/gntdev-dmabuf.c | 8 1 file changed, 4 insertions

[PATCH v7 06/21] drm/i915: Prepare to dynamic dma-buf locking specification

2022-10-17 Thread Dmitry Osipenko
Prepare i915 driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions and handling cases where importer now holds the reservation lock. Acked-by: Christian König Reviewed-by: Michael J. Ruhl Signed-off-by: Dmitry Osipenko

[PATCH v7 05/21] drm/armada: Prepare to dynamic dma-buf locking specification

2022-10-17 Thread Dmitry Osipenko
Prepare Armada driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/armada/armada_gem.c | 8 1 file changed, 4 insertions(+), 4 deletions

[PATCH v7 04/21] drm/prime: Prepare to dynamic dma-buf locking specification

2022-10-17 Thread Dmitry Osipenko
Prepare DRM prime core to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Reviewed-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_prime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH v7 03/21] drm/gem: Take reservation lock for vmap/vunmap operations

2022-10-17 Thread Dmitry Osipenko
. This patch prepares DRM core and drivers to the common dynamic dma-buf locking convention. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_client.c | 4 ++-- drivers/gpu/drm/drm_gem.c| 24 drivers/gpu/drm

[PATCH v7 01/21] dma-buf: Add unlocked variant of vmapping functions

2022-10-17 Thread Dmitry Osipenko
Add unlocked variant of dma_buf_vmap/vunmap() that will be utilized by drivers that don't take the reservation lock explicitly. Acked-by: Sumit Semwal Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 43 +++ include

[PATCH v7 02/21] dma-buf: Add unlocked variant of attachment-mapping functions

2022-10-17 Thread Dmitry Osipenko
Add unlocked variant of dma_buf_map/unmap_attachment() that will be used by drivers that don't take the reservation lock explicitly. Acked-by: Sumit Semwal Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 53

[PATCH v7 00/21] Move all drivers to a common dma-buf locking convention

2022-10-17 Thread Dmitry Osipenko
quot;locking convention" documentation that explains which dma-buf functions and callbacks are locked/unlocked for importers and exporters, which was requested by Christian König. - Added ack from Tomasz Figa to the V4L patches that he gave to v1. Dmitry Osipenko (21): dma-buf: Add

Re: [PATCH v6 00/21] Move all drivers to a common dma-buf locking convention

2022-10-11 Thread Dmitry Osipenko
On 9/28/22 22:15, Dmitry Osipenko wrote: > Hello, > > This series moves all drivers to a dynamic dma-buf locking specification. > From now on all dma-buf importers are made responsible for holding > dma-buf's reservation lock around all operations performed over dma-bufs

Re: [PATCH v6 10/21] RDMA/umem: Prepare to dynamic dma-buf locking specification

2022-10-08 Thread Dmitry Osipenko
On 9/28/22 22:15, Dmitry Osipenko wrote: > Prepare InfiniBand drivers to the common dynamic dma-buf locking > convention by starting to use the unlocked versions of dma-buf API > functions. > > Acked-by: Christian König > Signed-off-by: Dmitry Osipenko > --- >

[PATCH v6 11/21] misc: fastrpc: Prepare to dynamic dma-buf locking specification

2022-09-28 Thread Dmitry Osipenko
Prepare fastrpc to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Acked-by: Srinivas Kandagatla Signed-off-by: Dmitry Osipenko --- drivers/misc/fastrpc.c | 6 +++--- 1 file changed, 3 insertions(+), 3

[PATCH v6 10/21] RDMA/umem: Prepare to dynamic dma-buf locking specification

2022-09-28 Thread Dmitry Osipenko
Prepare InfiniBand drivers to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/infiniband/core/umem_dmabuf.c | 7 --- 1 file changed, 4 insertions(+), 3

[PATCH v6 08/21] drm/tegra: Prepare to dynamic dma-buf locking specification

2022-09-28 Thread Dmitry Osipenko
Prepare Tegra DRM driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/tegra/gem.c | 17 + 1 file changed, 9 insertions(+), 8

[PATCH v6 18/21] dma-buf: Move dma_buf_mmap() to dynamic locking specification

2022-09-28 Thread Dmitry Osipenko
Move dma_buf_mmap() function to the dynamic locking specification by taking the reservation lock. Neither of the today's drivers take the reservation lock within the mmap() callback, hence it's safe to enforce the locking. Acked-by: Sumit Semwal Acked-by: Christian König Signed-off-by: Dmitry

[PATCH v6 16/21] dma-buf: Move dma_buf_attach() to dynamic locking specification

2022-09-28 Thread Dmitry Osipenko
-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 23656f334735..d60585bbb529 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c

[PATCH v6 19/21] dma-buf: Document dynamic locking convention

2022-09-28 Thread Dmitry Osipenko
Add documentation for the dynamic locking convention. The documentation tells dma-buf API users when they should take the reservation lock and when not. Acked-by: Sumit Semwal Reviewed-by: Christian König Signed-off-by: Dmitry Osipenko --- Documentation/driver-api/dma-buf.rst | 6

[PATCH v6 14/21] media: tegra-vde: Prepare to dynamic dma-buf locking specification

2022-09-28 Thread Dmitry Osipenko
Prepare Tegra video decoder driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +++--- 1 file changed

[PATCH v6 15/21] dma-buf: Move dma_buf_vmap() to dynamic locking specification

2022-09-28 Thread Dmitry Osipenko
Move dma_buf_vmap/vunmap() functions to the dynamic locking specification by asserting that the reservation lock is held. Acked-by: Sumit Semwal Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH v6 20/21] media: videobuf2: Stop using internal dma-buf lock

2022-09-28 Thread Dmitry Osipenko
. Acked-by: Tomasz Figa Acked-by: Hans Verkuil Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11 +-- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 11 +-- drivers/media/common/videobuf2/videobuf2

[PATCH v6 17/21] dma-buf: Move dma_buf_map_attachment() to dynamic locking specification

2022-09-28 Thread Dmitry Osipenko
Move dma-buf attachment mapping functions to the dynamic locking specification by asserting that the reservation lock is held. Acked-by: Sumit Semwal Reviewed-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 10 ++ 1 file changed, 2 insertions(+), 8

[PATCH v6 21/21] dma-buf: Remove obsoleted internal lock

2022-09-28 Thread Dmitry Osipenko
-by: Christian König Reviewed-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 14 -- include/linux/dma-buf.h | 9 - 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index

[PATCH v6 13/21] media: videobuf2: Prepare to dynamic dma-buf locking specification

2022-09-28 Thread Dmitry Osipenko
Prepare V4L2 memory allocators to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Tomasz Figa Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11

[PATCH v6 05/21] drm/armada: Prepare to dynamic dma-buf locking specification

2022-09-28 Thread Dmitry Osipenko
Prepare Armada driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/armada/armada_gem.c | 8 1 file changed, 4 insertions(+), 4 deletions

[PATCH v6 12/21] xen/gntdev: Prepare to dynamic dma-buf locking specification

2022-09-28 Thread Dmitry Osipenko
Prepare gntdev driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Juergen Gross Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/xen/gntdev-dmabuf.c | 8 1 file changed, 4 insertions

[PATCH v6 09/21] drm/etnaviv: Prepare to dynamic dma-buf locking specification

2022-09-28 Thread Dmitry Osipenko
Prepare Etnaviv driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v6 07/21] drm/omapdrm: Prepare to dynamic dma-buf locking specification

2022-09-28 Thread Dmitry Osipenko
Prepare OMAP DRM driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[PATCH v6 03/21] drm/gem: Take reservation lock for vmap/vunmap operations

2022-09-28 Thread Dmitry Osipenko
. This patch prepares DRM core and drivers to the common dynamic dma-buf locking convention. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_client.c | 4 ++-- drivers/gpu/drm/drm_gem.c| 24 drivers/gpu/drm

[PATCH v6 06/21] drm/i915: Prepare to dynamic dma-buf locking specification

2022-09-28 Thread Dmitry Osipenko
Prepare i915 driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions and handling cases where importer now holds the reservation lock. Acked-by: Christian König Reviewed-by: Michael J. Ruhl Signed-off-by: Dmitry Osipenko

[PATCH v6 01/21] dma-buf: Add unlocked variant of vmapping functions

2022-09-28 Thread Dmitry Osipenko
Add unlocked variant of dma_buf_vmap/vunmap() that will be utilized by drivers that don't take the reservation lock explicitly. Acked-by: Sumit Semwal Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 41 +++ include

[PATCH v6 04/21] drm/prime: Prepare to dynamic dma-buf locking specification

2022-09-28 Thread Dmitry Osipenko
Prepare DRM prime core to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Reviewed-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_prime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions

[PATCH v6 02/21] dma-buf: Add unlocked variant of attachment-mapping functions

2022-09-28 Thread Dmitry Osipenko
Add unlocked variant of dma_buf_map/unmap_attachment() that will be used by drivers that don't take the reservation lock explicitly. Acked-by: Sumit Semwal Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 53

[PATCH v6 00/21] Move all drivers to a common dma-buf locking convention

2022-09-28 Thread Dmitry Osipenko
without the held lock and exporter should take the lock. - Added "locking convention" documentation that explains which dma-buf functions and callbacks are locked/unlocked for importers and exporters, which was requested by Christian König. - Added ack from Tomasz Figa

Re: [PATCH v5 02/31] drm/i915: Don't register backlight when another backlight should be used (v2)

2022-09-25 Thread Dmitry Osipenko
25.08.2022 17:36, Hans de Goede пишет: > Before this commit when we want userspace to use the acpi_video backlight > device we register both the GPU's native backlight device and acpi_video's > firmware acpi_video# backlight device. This relies on userspace preferring > firmware type backlight

Re: [PATCH v5 15/21] dma-buf: Move dma_buf_vmap() to dynamic locking specification

2022-09-21 Thread Dmitry Osipenko
On 9/20/22 17:13, Sumit Semwal wrote: > Hi Dmitry, > > Thanks very much for the series. > > On Wed, 14 Sept 2022 at 00:59, Dmitry Osipenko > wrote: >> >> Move dma_buf_vmap/vunmap_unlocked() functions to the dynamic locking >> specification by asserti

Re: [PATCH v2 0/3] Refactor MediaTek DP drivers

2022-09-19 Thread Dmitry Osipenko
Hello Chun-Kuang, 18.09.2022 06:17, Chun-Kuang Hu пишет: > Hi, Dmitry: > > My tree has no mtk-dp driver yet. Would you like to pick this series? > > Regards, > Chun-Kuang. > > Bo-Chen Chen 於 2022年9月16日 週五 晚上9:38寫道: >> >> For this series, we do some clean-up and fix a build warning. >> This

Re: [PATCH -next] drm/mediatek: dp: change mtk_dp_driver to static

2022-09-19 Thread Dmitry Osipenko
Hello Chun-Kuang, 18.09.2022 06:56, Chun-Kuang Hu пишет: > Hi, Dmitry: > > My tree has no mtk dp driver yet. Would you like to pick this patch? > > Acked-by: Chun-Kuang Hu > > Dmitry Osipenko 於 2022年9月15日 週四 下午5:04寫道: Applied to drm-misc-next

Re: [PATCH -next] drm/mediatek: dp: change mtk_dp_driver to static

2022-09-15 Thread Dmitry Osipenko
@@ -2642,7 +2642,7 @@ static const struct of_device_id mtk_dp_of_match[] = { > }; > MODULE_DEVICE_TABLE(of, mtk_dp_of_match); > > -struct platform_driver mtk_dp_driver = { > +static struct platform_driver mtk_dp_driver = { > .probe = mtk_dp_probe, > .remove =

[PATCH v5 20/21] media: videobuf2: Stop using internal dma-buf lock

2022-09-13 Thread Dmitry Osipenko
. Acked-by: Tomasz Figa Acked-by: Hans Verkuil Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11 +-- drivers/media/common/videobuf2/videobuf2-dma-sg.c | 11 +-- drivers/media/common/videobuf2/videobuf2

[PATCH v5 13/21] media: videobuf2: Prepare to dynamic dma-buf locking specification

2022-09-13 Thread Dmitry Osipenko
Prepare V4L2 memory allocators to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Tomasz Figa Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/media/common/videobuf2/videobuf2-dma-contig.c | 11

[PATCH v5 21/21] dma-buf: Remove obsoleted internal lock

2022-09-13 Thread Dmitry Osipenko
-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 14 -- include/linux/dma-buf.h | 9 - 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index c359bdbdf5be..45462b988aec

[PATCH v5 18/21] dma-buf: Move dma_buf_mmap() to dynamic locking specification

2022-09-13 Thread Dmitry Osipenko
Move dma_buf_mmap() function to the dynamic locking specification by taking the reservation lock. Neither of the today's drivers take the reservation lock within the mmap() callback, hence it's safe to enforce the locking. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers

[PATCH v5 15/21] dma-buf: Move dma_buf_vmap() to dynamic locking specification

2022-09-13 Thread Dmitry Osipenko
Move dma_buf_vmap/vunmap_unlocked() functions to the dynamic locking specification by asserting that the reservation lock is held. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/dma-buf/dma-buf.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/dma-buf/dma

[PATCH v5 19/21] dma-buf: Document dynamic locking convention

2022-09-13 Thread Dmitry Osipenko
Add documentation for the dynamic locking convention. The documentation tells dma-buf API users when they should take the reservation lock and when not. Reviewed-by: Christian König Signed-off-by: Dmitry Osipenko --- Documentation/driver-api/dma-buf.rst | 6 +++ drivers/dma-buf/dma-buf.c

[PATCH v5 14/21] media: tegra-vde: Prepare to dynamic dma-buf locking specification

2022-09-13 Thread Dmitry Osipenko
Prepare Tegra video decoder driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/media/platform/nvidia/tegra-vde/dmabuf-cache.c | 6 +++--- 1 file changed

[PATCH v5 16/21] dma-buf: Move dma_buf_attach() to dynamic locking specification

2022-09-13 Thread Dmitry Osipenko
Move dma-buf attachment API functions to the dynamic locking specification by taking the reservation lock around the mapping operations. The strict locking convention prevents deadlock situations for dma-buf importers and exporters. Reviewed-by: Christian König Signed-off-by: Dmitry Osipenko

[PATCH v5 12/21] xen/gntdev: Prepare to dynamic dma-buf locking specification

2022-09-13 Thread Dmitry Osipenko
Prepare gntdev driver to the common dynamic dma-buf locking convention by starting to use the unlocked versions of dma-buf API functions. Acked-by: Juergen Gross Acked-by: Christian König Signed-off-by: Dmitry Osipenko --- drivers/xen/gntdev-dmabuf.c | 8 1 file changed, 4 insertions

<    1   2   3   4   5   6   7   8   9   10   >