OpenCloudOS-Kernel/drivers/media/platform
Jae Hyun Yoo 3536169f85 media: aspeed: fix clock handling logic
Video engine uses eclk and vclk for its clock sources and its reset
control is coupled with eclk so the current clock enabling sequence works
like below.

 Enable eclk
 De-assert Video Engine reset
 10ms delay
 Enable vclk

It introduces improper reset on the Video Engine hardware and eventually
the hardware generates unexpected DMA memory transfers that can corrupt
memory region in random and sporadic patterns. This issue is observed
very rarely on some specific AST2500 SoCs but it causes a critical
kernel panic with making a various shape of signature so it's extremely
hard to debug. Moreover, the issue is observed even when the video
engine is not actively used because udevd turns on the video engine
hardware for a short time to make a query in every boot.

To fix this issue, this commit changes the clock handling logic to make
the reset de-assertion triggered after enabling both eclk and vclk. Also,
it adds clk_unprepare call for a case when probe fails.

clk: ast2600: fix reset settings for eclk and vclk
Video engine reset setting should be coupled with eclk to match it
with the setting for previous Aspeed SoCs which is defined in
clk-aspeed.c since all Aspeed SoCs are sharing a single video engine
driver. Also, reset bit 6 is defined as 'Video Engine' reset in
datasheet so it should be de-asserted when eclk is enabled. This
commit fixes the setting.

Fixes: d2b4387f3b ("media: platform: Add Aspeed Video Engine driver")
Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@linux.intel.com>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Eddie James <eajames@linux.ibm.com>
Fixes: d3d04f6c33 ("clk: Add support for AST2600 SoC")
Reviewed-by: Joel Stanley <joel@jms.id.au>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-03-11 11:59:45 +01:00
..
allegro-dvt media: allegro: add support for HEVC encoding 2021-01-27 16:15:04 +01:00
am437x media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API 2021-02-06 09:18:53 +01:00
atmel media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API 2021-02-06 09:18:53 +01:00
cadence media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API 2021-02-06 09:18:53 +01:00
coda media: coda: Convert the driver to DT-only 2020-12-03 07:37:59 +01:00
davinci media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API 2021-02-06 09:18:53 +01:00
exynos-gsc media: Add V4L2_TYPE_IS_CAPTURE helper 2020-07-19 08:13:24 +02:00
exynos4-is media: fix incorrect kernel doc usages 2021-03-11 11:59:44 +01:00
marvell-ccic media: marvell-ccic: power up the device on mclk enable 2021-02-06 09:31:03 +01:00
meson/ge2d media: meson/ge2d: set ret to -ENOMEM 2021-01-27 08:32:16 +01:00
mtk-jpeg media: platform: add missing put_device() call in mtk_jpeg_probe() and mtk_jpeg_remove() 2020-11-16 10:31:16 +01:00
mtk-mdp media: mtk-mdp: Do not zero reserved fields 2021-01-27 13:18:29 +01:00
mtk-vcodec media: fix incorrect kernel doc usages 2021-03-11 11:59:44 +01:00
mtk-vpu media: fix incorrect kernel doc usages 2021-03-11 11:59:44 +01:00
omap media: videobuf2: Move frame_vector into media subsystem 2021-01-12 14:15:31 +01:00
omap3isp media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API 2021-02-06 09:18:53 +01:00
qcom media: qcom: camss: Fix overflows in clock rate calculations 2021-03-11 11:59:43 +01:00
rcar-vin media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API 2021-02-06 09:18:53 +01:00
rockchip media: rkisp1: rsz: crash fix when setting src format 2021-03-11 11:59:45 +01:00
s3c-camif media: s3c-camif: use semicolons rather than commas to separate statements 2020-11-16 10:31:06 +01:00
s5p-g2d media: s5p-g2d: Fix a memory leak in an error handling path in 'g2d_probe()' 2020-07-19 08:14:00 +02:00
s5p-jpeg media: s5p-jpeg: handle error condition in s5p_jpeg_probe 2020-12-03 07:45:49 +01:00
s5p-mfc media: Rename stateful codec control macros 2020-12-03 12:27:32 +01:00
sti media: platform: sti: make a const arrays static, makes object smaller 2021-03-11 11:59:42 +01:00
stm32 media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API 2021-02-06 09:18:53 +01:00
sunxi media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API 2021-02-06 09:18:53 +01:00
ti-vpe media: ti-vpe: Simplify bool comparison 2021-03-11 11:59:44 +01:00
vsp1 media: fix incorrect kernel doc usages 2021-03-11 11:59:44 +01:00
xilinx media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API 2021-02-06 09:18:53 +01:00
Kconfig media: mtk: fix mtk-smi dependency 2021-03-11 11:59:43 +01:00
Makefile media: allegro: move driver out of staging 2021-01-04 13:19:40 +01:00
aspeed-video.c media: aspeed: fix clock handling logic 2021-03-11 11:59:45 +01:00
fsl-viu.c media: use getter/setter functions 2021-03-11 11:59:42 +01:00
imx-pxp.c media: media/platform: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:54:14 +01:00
imx-pxp.h media: imx-pxp: add i.MX Pixel Pipeline driver 2018-09-11 13:32:17 -04:00
m2m-deinterlace.c media: media/platform: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:54:14 +01:00
mx2_emmaprp.c media: mx2_emmaprp: Fix memleak in emmaprp_probe 2020-09-26 10:15:39 +02:00
pxa_camera.c media: use getter/setter functions 2021-03-11 11:59:42 +01:00
rcar-fcp.c media: platform: fcp: Fix a reference count leak. 2020-09-27 10:52:52 +02:00
rcar_drif.c media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API 2021-02-06 09:18:53 +01:00
rcar_fdp1.c media: fdp1: Do not zero reserved fields 2021-01-27 13:18:45 +01:00
rcar_jpu.c media: jpu: Do not zero reserved fields 2021-01-27 13:19:03 +01:00
renesas-ceu.c Devicetree updates for v5.12: 2021-02-22 10:05:12 -08:00
sh_vou.c media: sh_vou: Drop bogus __refdata annotation 2021-01-12 18:16:09 +01:00
via-camera.c Power management updates for 5.7-rc1 2020-03-30 15:05:01 -07:00
via-camera.h media: fix usage of whitespaces and on indentation 2018-01-04 13:12:01 -05:00
video-mux.c media: v4l2-async: Improve v4l2_async_notifier_add_*_subdev() API 2021-02-06 09:18:53 +01:00