media: videobuf2: revert "get_userptr: buffers are always writable"
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 28 Nov 2022 08:23:56 +0000 (08:23 +0000)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 6 Dec 2022 07:14:31 +0000 (07:14 +0000)
commite2fc6edd37ba487c64f4dd09f7118b3e45b12d88
tree26266931ca718aa0229833e39b3132bb00607c38
parent1aba7930c63ea57b4918dc61dcc315f451cec21e
media: videobuf2: revert "get_userptr: buffers are always writable"

Commit 707947247e95 ("media: videobuf2-vmalloc: get_userptr: buffers are
always writable") caused problems in a corner case (passing read-only
shmem memory as a userptr). So revert this patch.

The original problem for which that commit was originally made is
something that I could not reproduce after reverting it. So just go
back to the way it was for many years, and if problems arise in
the future, then another approach should be taken to resolve it.

This patch is based on a patch from Hirokazu.

Fixes: 707947247e95 ("media: videobuf2-vmalloc: get_userptr: buffers are always writable")
Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/common/videobuf2/frame_vector.c
drivers/media/common/videobuf2/videobuf2-dma-contig.c
drivers/media/common/videobuf2/videobuf2-dma-sg.c
drivers/media/common/videobuf2/videobuf2-memops.c
drivers/media/common/videobuf2/videobuf2-vmalloc.c
include/media/frame_vector.h
include/media/videobuf2-memops.h