linux_dsm_epyc7002/drivers/media
Tomi Valkeinen 3dc4365ba8 media: ti-vpe: cal: fix DMA memory corruption
When the CAL driver stops streaming, it will shut everything down
without waiting for the current frame to finish. This leaves the CAL DMA
in a slightly undefined state, and when CAL DMA is enabled when the
stream is started the next time, the old DMA transfer will continue.

It is not clear if the old DMA transfer continues with the exact
settings of the original transfer, or is it a mix of old and new
settings, but in any case the end result is memory corruption as the
destination memory address is no longer valid.

I could not find any way to ensure that any old DMA transfer would be
discarded, except perhaps full CAL reset. But we cannot do a full reset
when one port is getting enabled, as that would reset both ports.

This patch tries to make sure that the DMA transfer is finished properly
when the stream is being stopped. I say "tries", as, as mentioned above,
I don't see a way to force the DMA transfer to finish. I believe this
fixes the corruptions for normal cases, but if for some reason the DMA
of the final frame would stall a lot, resulting in timeout in the code
waiting for the DMA to finish, we'll again end up with unfinished DMA
transfer. However, I don't know what could cause such a timeout.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Reviewed-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-14 12:45:43 +02:00
..
cec media: Kconfig: move CEC-specific options to cec/Kconfig 2020-04-14 10:29:05 +02:00
common media: dvb-usb: auto-select CYPRESS_FIRMWARE 2020-04-14 10:29:04 +02:00
dvb-core media: Kconfig: move DVB-specific options to dvb-core/Kconfig 2020-04-14 10:29:05 +02:00
dvb-frontends media: docs: move driver-specific info to driver-api 2020-04-14 10:36:18 +02:00
firewire media: Kconfig: mode firewire comment to firewire/Kconfig 2020-04-14 10:29:04 +02:00
i2c media: ov5640: fix use of destroyed mutex 2020-04-14 12:18:37 +02:00
mc media: Kconfig: move media controller core select to main Kconfig 2020-04-14 10:29:06 +02:00
mmc media: Kconfig: move comment to siano include 2020-04-14 10:29:04 +02:00
pci media: pci: saa7134: convert to use i2c_new_client_device() 2020-04-14 11:29:10 +02:00
platform media: ti-vpe: cal: fix DMA memory corruption 2020-04-14 12:45:43 +02:00
radio media: docs: move driver-specific info to driver-api 2020-04-14 10:36:18 +02:00
rc media: rc: Use scnprintf() for avoiding potential buffer overflow 2020-03-20 16:27:42 +01:00
spi media: Kconfig files: use select for V4L2 subdevs and MC 2020-04-14 10:29:05 +02:00
test_drivers media: vimc: fix kernel-doc markups 2020-04-14 12:14:43 +02:00
tuners media: tuners: Use the correct style for SPDX License Identifier 2019-10-24 18:57:55 -03:00
usb media: usb: pvrusb2: convert to use i2c_new_client_device() 2020-04-14 11:32:04 +02:00
v4l2-core media: add v4l2 JPEG helpers 2020-04-14 11:47:47 +02:00
Kconfig Revert "media: Kconfig: better support hybrid TV devices" 2020-04-14 11:00:30 +02:00
Makefile media: move drivers/media/media-* to drivers/media/mc/mc-* 2019-05-28 12:15:46 -04:00