aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-04-10[media] cx231xx-cards: fix NULL-deref at probeJohan Hovold1-5/+40
Make sure to check the number of endpoints to avoid dereferencing a NULL-pointer or accessing memory beyond the endpoint array should a malicious device lack the expected endpoints. Fixes: e0d3bafd0258 ("V4L/DVB (10954): Add cx231xx USB driver") Cc: stable <[email protected]> # 2.6.30 Cc: Sri Deevi <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-10[media] usbvision: fix NULL-deref at probeJohan Hovold1-1/+8
Make sure to check the number of endpoints to avoid dereferencing a NULL-pointer or accessing memory beyond the endpoint array should a malicious device lack the expected endpoints. Fixes: 2a9f8b5d25be ("V4L/DVB (5206): Usbvision: set alternate interface modification") Cc: stable <[email protected]> # 2.6.21 Cc: Thierry MERLE <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-10[media] dib0700: fix NULL-deref at probeJohan Hovold1-0/+3
Make sure to check the number of endpoints to avoid dereferencing a NULL-pointer should a malicious device lack endpoints. Fixes: c4018fa2e4c0 ("[media] dib0700: fix RC support on Hauppauge Nova-TD") Cc: stable <[email protected]> # 3.16 Cc: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-10[media] vidioc-enumin/output.rst: improve documentationHans Verkuil2-12/+14
The V4L2_INPUT_TYPE_CAMERA and V4L2_OUTPUT_TYPE_ANALOG descriptions were hopelessly out of date. Fix this, and also fix a few style issues in these documents. Finally add the missing documentation for V4L2_OUTPUT_TYPE_ANALOGVGAOVERLAY (only used by the zoran driver). Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-10[media] v4l2-compat-ioctl32: VIDIOC_S_EDID should return all fields on errorHans Verkuil1-1/+4
Most ioctls do not have to write back the contents of the argument if an error is returned. But VIDIOC_S_EDID is an exception together with the EXT_CTRLS ioctls (already handled correctly). Add this exception to v4l2-compat-ioctl32. This fixes a compliance error when using compat32 and trying to set a new EDID with more blocks than the hardware supports. In that case the driver will return -E2BIG and set edid.blocks to the actual maximum number of blocks. This field was never copied back to userspace due to this bug. Signed-off-by: Hans Verkuil <[email protected]> Acked-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-10[media] video.rst: a sensor is also considered to be a physical inputHans Verkuil1-3/+4
Add the line "Camera sensors are also considered to be a video input." In practice all non-MC drivers for sensors support the input ioctls, and the compliance test actually tests for the presence of these ioctls. So clarify the documentation by explicitly mentioning sensors. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-10[media] vcodec: mediatek: mark pm functions as __maybe_unusedArnd Bergmann1-8/+4
When CONFIG_PM is disabled, we get a couple of unused functions: drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c:927:13: error: 'mtk_jpeg_clk_off' defined but not used [-Werror=unused-function] static void mtk_jpeg_clk_off(struct mtk_jpeg_dev *jpeg) ^~~~~~~~~~~~~~~~ drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c:916:13: error: 'mtk_jpeg_clk_on' defined but not used [-Werror=unused-function] static void mtk_jpeg_clk_on(struct mtk_jpeg_dev *jpeg) Rather than adding more error-prone #ifdefs around those, this patch removes the existing #ifdef checks and marks the PM functions as __maybe_unused to let gcc do the right thing. Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Rick Chang <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-g2d: Fix error handlingChristophe JAILLET1-1/+1
According to the surrounding goto, it is likely that 'unprep_clk_gate' was expected here. Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Don't allocate codec buffers from pre-allocated regionMarek Szyprowski3-2/+34
Further investigation revealed that codec buffers also don't need to be allocated at higher addresses than firmware base for MFC v6+ hardware. Those buffers can be quite large and its size depends on the selected format and framesize. This patch changes the way the codec buffers are allocated - driver will use generic allocator for them instead of the pre-allocated buffer for firmware and contexts. Signed-off-by: Marek Szyprowski <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Fix unbalanced call to clock managementMarek Szyprowski1-0/+1
Clock should be turned off after calling s5p_mfc_init_hw() from the watchdog worker, like it is already done in the s5p_mfc_open() which also calls this function. Fixes: af93574678108 ("[media] MFC: Add MFC 5.1 V4L2 driver") Signed-off-by: Marek Szyprowski <[email protected]> Cc: [email protected] # v3.7+ Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Rename BANK1/2 to BANK_L/R to better match documentationMarek Szyprowski7-61/+62
Documentation for MFC hardware still uses 'left' and 'right' names for the memory channel/banks, so replace BANK1/2 defines with more appropriate BANK_L/R names. Suggested-by: Shuah Khan <[email protected]> Signed-off-by: Marek Szyprowski <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Use preallocated block allocator always for MFC v6+Marek Szyprowski2-4/+7
It turned out that all versions of MFC v6+ hardware doesn't have a strict requirement for ALL buffers to be allocated on higher addresses than the firmware base like it was documented for MFC v5. This requirement is true only for the device and per-context buffers. All video data buffers can be allocated anywhere for all MFC v6+ versions. Basing on this fact, the special DMA configuration based on two reserved memory regions is not really needed for MFC v6+ devices, because the memory requirements for the firmware, device and per-context buffers can be fulfilled by the simple probe-time pre-allocated block allocator introduced in previous patch. This patch enables support for such pre-allocated block based allocator always for MFC v6+ devices. Due to the limitations of the memory management subsystem the largest supported size of the pre-allocated buffer when no CMA (Contiguous Memory Allocator) is enabled is 4 MiB. This patch also removes the requirement to provide two reserved memory regions for MFC v6+ devices in device tree. Now the driver is fully functional without them. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Remove special configuration of IOMMU domainMarek Szyprowski2-67/+14
The main reason for using special configuration of IOMMU domain was the problem with MFC firmware, which failed to operate properly when placed at 0 DMA address. Instead of adding custom code for configuring each variant of IOMMU domain and architecture specific glue code, simply use what arch code provides and if the DMA base address equals zero, skip first 128 KiB to keep required alignment. This patch also make the driver operational on ARM64 architecture, because it no longer depends on ARM specific DMA-mapping and IOMMU glue code functions. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Add support for probe-time preallocated block based allocatorMarek Szyprowski3-25/+79
Current MFC driver depends on the fact that when IOMMU is available, the DMA-mapping framework and its IOMMU glue will use first-fit allocator. This was true for ARM architecture, but its not for ARM64 arch. However, in case of MFC v6+ hardware and latest firmware, it turned out that there is no strict requirement for ALL buffers to be allocated on higher addresses than the firmware base. This requirement is true only for the device and per-context buffers. All video data buffers can be allocated anywhere for all MFC v6+ versions. Such relaxed requirements for the memory buffers can be easily fulfilled by allocating firmware, device and per-context buffers from the probe-time preallocated larger buffer. This patch adds support for it. This way the driver finally works fine on ARM64 architecture. The size of the preallocated buffer is 8 MiB, what is enough for three instances H264 decoders or encoders (other codecs have smaller memory requirements). If one needs more for particular use case, one can use "mem" module parameter to force larger (or smaller) buffer (for example by adding "s5p_mfc.mem=16M" to kernel command line). [[email protected]: fix two checkpatch warnings: don't initialize static to NULL; don't use S_foo permisions] Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Split variant DMA memory configuration into separate functionsMarek Szyprowski1-41/+61
Move code for DMA memory configuration with IOMMU into separate function to make it easier to compare what is being done in each case. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Reduce firmware buffer size for MFC v6+ variantsMarek Szyprowski3-3/+3
Firmware for MFC v6+ variants is not larger than 400 KiB, so there is no need to allocate a full 1 MiB buffer for it. Reduce it to 512 KiB to keep proper alignment of allocated buffer. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Allocate firmware with internal private buffer alloc functionMarek Szyprowski1-9/+5
Once firmware buffer has been converted to use s5p_mfc_priv_buf structure, it is possible to allocate it with existing s5p_mfc_alloc_priv_buf() function. This change will help to reduce code variants in the next patches. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Move firmware allocation to DMA configure functionMarek Szyprowski2-44/+49
To complete DMA memory configuration for MFC device, allocation of the firmware buffer is needed, because some parameters are dependant on its base address. Till now, this has been handled in the s5p_mfc_alloc_firmware() function. This patch moves that logic to s5p_mfc_configure_dma_memory() to keep DMA memory related operations in a single place. This way s5p_mfc_alloc_firmware() is simplified and does what it name says. The other consequence of this change is moving s5p_mfc_alloc_firmware() call from the s5p_mfc_probe() function to the s5p_mfc_configure_dma_memory(). Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Put firmware to private buffer structureMarek Szyprowski3-21/+20
Use s5p_mfc_priv_buf structure for keeping the firmware image. This will help handling of firmware buffer allocation in the next patches. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Move setting DMA max segment size to DMA configure functionMarek Szyprowski1-8/+13
Setting DMA max segment size to 32 bit mask is a part of DMA memory configuration, so move those calls to s5p_mfc_configure_dma_memory() function. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Simplify alloc/release private buffer functionsMarek Szyprowski5-38/+37
Change parameters for s5p_mfc_alloc_priv_buf() and s5p_mfc_release_priv_buf() functions. Instead of DMA device pointer and a base, provide common MFC device structure and memory bank context identifier. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Replace bank1/bank2 entries with an arrayMarek Szyprowski4-38/+43
Internal MFC driver device structure contains two entries for keeping addresses of the DMA memory banks. Replace them with the dma_base[] array and use defines for accessing particular banks. This will help to simplify code in the next patches. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Replace mem_dev_* entries with an arrayMarek Szyprowski7-61/+69
Internal MFC driver device structure contains two pointers to devices used for DMA memory allocation: mem_dev_l and mem_dev_r. Replace them with the mem_dev[] array and use defines for accessing particular banks. This will help to simplify code in the next patches. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Use generic of_device_get_match_data helperMarek Szyprowski2-17/+4
Replace custom code with generic helper to retrieve driver data. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Javier Martinez Canillas <[email protected]> Reviewed-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Remove unused structures and dead codeMarek Szyprowski3-35/+0
Remove unused structures, definitions and functions that are no longer called from the driver code. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Javier Martinez Canillas <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Tested-by: Smitha T Murthy <[email protected]> Reviewed-by: Smitha T Murthy <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Fix race between interrupt routine and device functionsMarek Szyprowski1-8/+4
Interrupt routine must wake process waiting for given interrupt AFTER updating driver's internal structures and contexts. Doing it in-between is a serious bug. This patch moves all calls to the wake() function to the end of the interrupt processing block to avoid potential and real races, especially on multi-core platforms. This also fixes following issue reported from clock core (clocks were disabled in interrupt after being unprepared from the other place in the driver, the stack trace however points to the different place than s5p_mfc driver because of the race): WARNING: CPU: 1 PID: 18 at drivers/clk/clk.c:544 clk_core_unprepare+0xc8/0x108 Modules linked in: CPU: 1 PID: 18 Comm: kworker/1:0 Not tainted 4.10.0-next-20170223-00070-g04e18bc99ab9-dirty #2154 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) Workqueue: pm pm_runtime_work [<c010d8b0>] (unwind_backtrace) from [<c010a534>] (show_stack+0x10/0x14) [<c010a534>] (show_stack) from [<c033292c>] (dump_stack+0x74/0x94) [<c033292c>] (dump_stack) from [<c011cef4>] (__warn+0xd4/0x100) [<c011cef4>] (__warn) from [<c011cf40>] (warn_slowpath_null+0x20/0x28) [<c011cf40>] (warn_slowpath_null) from [<c0387a84>] (clk_core_unprepare+0xc8/0x108) [<c0387a84>] (clk_core_unprepare) from [<c0389d84>] (clk_unprepare+0x24/0x2c) [<c0389d84>] (clk_unprepare) from [<c03d4660>] (exynos_sysmmu_suspend+0x48/0x60) [<c03d4660>] (exynos_sysmmu_suspend) from [<c042b9b0>] (pm_generic_runtime_suspend+0x2c/0x38) [<c042b9b0>] (pm_generic_runtime_suspend) from [<c0437580>] (genpd_runtime_suspend+0x94/0x220) [<c0437580>] (genpd_runtime_suspend) from [<c042e240>] (__rpm_callback+0x134/0x208) [<c042e240>] (__rpm_callback) from [<c042e334>] (rpm_callback+0x20/0x80) [<c042e334>] (rpm_callback) from [<c042d3b8>] (rpm_suspend+0xdc/0x458) [<c042d3b8>] (rpm_suspend) from [<c042ea24>] (pm_runtime_work+0x80/0x90) [<c042ea24>] (pm_runtime_work) from [<c01322c4>] (process_one_work+0x120/0x318) [<c01322c4>] (process_one_work) from [<c0132520>] (worker_thread+0x2c/0x4ac) [<c0132520>] (worker_thread) from [<c0137ab0>] (kthread+0xfc/0x134) [<c0137ab0>] (kthread) from [<c0107978>] (ret_from_fork+0x14/0x3c) ---[ end trace 1ead49a7bb83f0d8 ]--- Fixes: af93574678108 ("[media] MFC: Add MFC 5.1 V4L2 driver") Signed-off-by: Marek Szyprowski <[email protected]> CC: [email protected] # v4.5+ Reviewed-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Print buf pointer in hex constistentlyShuah Khan1-1/+1
Fix s5p_mfc_set_dec_frame_buffer_v6() to print buffer pointer in hex to be consistent with the rest of the messages in the routine. Signed-off-by: Shuah Khan <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p_mfc: Remove unneeded io_modes initialization in s5p_mfc_open()Shuah Khan1-1/+0
Remove unneeded io_modes initialization in s5p_mfc_open(). It gets done right below in vdev == dev->vfd_dec conditional. Signed-off-by: Shuah Khan <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] s5p-mfc: Fix initialization of internal structuresMarek Szyprowski1-9/+8
Initialize members of the internal device and context structures as early as possible to avoid access to uninitialized objects on initialization failures. If loading firmware or creating of the hardware instance fails, driver will access device or context queue in error handling path, which might not be initialized yet, what causes kernel panic. Fix this by moving initialization of all static members as early as possible. Signed-off-by: Marek Szyprowski <[email protected]> Acked-by: Andrzej Hajda <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Javier Martinez Canillas <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] tveeprom: get rid of documentation of an unused parameterMauro Carvalho Chehab1-1/+0
Changeset 446aba663b82 ("[media] tveeprom: get rid of unused arg on tveeprom_hauppauge_analog()") removed the now unused I2C adapter struct from struct tveeprom. Remove the corresponding kernel-doc tag. Fixes: 446aba663b82 ("[media] tveeprom: get rid of unused arg on tveeprom_hauppauge_analog()") Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] dvb_frontend: add kernel-doc tag for a missing parameterMauro Carvalho Chehab1-0/+1
Changeset 1f862a68df24 ("[media] dvb_frontend: move kref to struct dvb_frontend") added a kref to the struct dvb_frontend, but it didn't document it. Fixes: 1f862a68df24 ("[media] dvb_frontend: move kref to struct dvb_frontend") Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] vb2: convert vb2_vmarea_handler refcount from atomic_t to refcount_tElena Reshetova5-19/+23
Use refcount_t to manage the refcount to the memory type specific buffer videobuf2 buffer implementations. refcount_t is better suitable for the purpose than atomic_t. Signed-off-by: Elena Reshetova <[email protected]> Signed-off-by: Hans Liljestrand <[email protected]> Signed-off-by: Kees Cook <[email protected]> Signed-off-by: David Windsor <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] cx88: convert struct cx88_core.refcount from atomic_t to refcount_tElena Reshetova3-4/+5
refcount_t is better suitable for counting references than atomic_t. Signed-off-by: Elena Reshetova <[email protected]> Signed-off-by: Hans Liljestrand <[email protected]> Signed-off-by: Kees Cook <[email protected]> Signed-off-by: David Windsor <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] cec-core.rst: document the new cec_get_drvdata() helperHans Verkuil1-0/+5
Document the new cec_get_drvdata() helper function. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] vivid: fix g_edid implementationHans Verkuil1-2/+2
The VIDIOC_G_EDID implementation in vivid didn't take edid->start_block into account when copying the EDID data. Make sure that the internal EDID is updated with the correct CEC physical address. Currently the returned EDID is updated, but that will only work well if edid->start_block is 0. Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] platform: vivid: Use cec_get_drvdata()Jose Abreu1-2/+2
Use helper function to get driver private data from CEC adapter. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] usb: pulse8-cec: Use cec_get_drvdata()Jose Abreu1-3/+3
Use helper function to get driver private data from CEC adapter. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] i2c: adv7842: Use cec_get_drvdata()Jose Abreu1-3/+3
Use helper function to get driver private data from CEC adapter. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] i2c: adv7604: Use cec_get_drvdata()Jose Abreu1-3/+3
Use helper function to get driver private data from CEC adapter. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] i2c: adv7511: Use cec_get_drvdata()Jose Abreu1-3/+3
Use helper function to get driver private data from CEC adapter. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] staging: s5p-cec: Use cec_get_drvdata()Jose Abreu1-3/+3
Use helper function to get driver private data from CEC adapter. Signed-off-by: Jose Abreu <[email protected]> Cc: Kamil Debski <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] staging: st-cec: Use cec_get_drvdata()Jose Abreu1-3/+3
Use helper function to get driver private data from CEC adapter. Signed-off-by: Jose Abreu <[email protected]> Cc: Benjamin Gaignard <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] cec: Add cec_get_drvdata()Jose Abreu1-0/+5
Add a helper function to get driver private data from CEC adapter. This helps the readability a little bit and allows to change the 'priv' field name to something else without needing to touch all drivers. Signed-off-by: Jose Abreu <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] ivtv: use for_each_sgGeliang Tang1-1/+1
Use for_each_sg() instead of open-coding it. Signed-off-by: Geliang Tang <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] vb2: Fix queue_setup() callback descriptionAnton Leontiev1-6/+6
Correct meaning of the last sensence by swapping it with previous. Fix two small typos. Signed-off-by: Anton Leontiev <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] usb: au0828: remove redundant codeColin Ian King1-7/+0
The check for ret being non-zero is false as ret is always zero, hence we have redundant dead code that can be removed. Detected with CoverityScan, CID#112968 ("Constant' variable guards dead code (DEADCODE)'") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] vcodec: mediatek: Remove double parenthesesMatthias Kaehlcke1-2/+2
The extra pairs of parentheses are not needed and cause clang warnings like this: drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c:158:32: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality] if ((inst->work_bufs[i].size == 0)) ~~~~~~~~~~~~~~~~~~~~~~~~^~~~ drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c:158:32: note: remove extraneous parentheses around the comparison to silence this warning if ((inst->work_bufs[i].size == 0)) ~ ^ ~ drivers/media/platform/mtk-vcodec/venc/venc_vp8_if.c:158:32: note: use '=' to turn this equality comparison into an assignment if ((inst->work_bufs[i].size == 0)) ^~ = Signed-off-by: Matthias Kaehlcke <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] doc: kapi: fix typoBaruch Siach1-1/+1
Signed-off-by: Baruch Siach <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] media: mtk-jpeg: fix continuous log "Context is NULL"Minghsiu Tsai1-12/+2
The symptom is continuous log "mtk-jpeg 18004000.jpegdec: Context is NULL" in kernel log. It is because the error handling in irq doesn't clear interrupt. The calling flow like as below when issue happen mtk_jpeg_device_run() mtk_jpeg_job_abort() v4l2_m2m_job_finish() -> m2m_dev->curr_ctx = NULL; mtk_jpeg_dec_irq() v4l2_m2m_get_curr_priv() -> m2m_dev->curr_ctx == NULL -> return NULL log "Context is NULL" There is race condition between job_abort() and irq. In order to simplify code, don't want to add extra flag to maintain state, empty job_abort() and clear interrupt before v4l2_m2m_get_curr_priv() in irq. Signed-off-by: Minghsiu Tsai <[email protected]> Acked-by: Rick Chang <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2017-04-05[media] gspca: konica: add missing endpoint sanity checkJohan Hovold1-0/+3
Make sure to check the number of endpoints to avoid accessing memory beyond the endpoint array should a device lack the expected endpoints. Note that, as far as I can tell, the gspca framework has already made sure there is at least one endpoint in the current alternate setting so there should be no risk for a NULL-pointer dereference here. Fixes: b517af722860 ("V4L/DVB: gspca_konica: New gspca subdriver for konica chipset using cams") Cc: stable <[email protected]> # 2.6.37 Cc: Hans de Goede <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>