From 8cc161a8e13cac022beade78c95a1c866ca351e7 Mon Sep 17 00:00:00 2001 From: Yandong Lin Date: Wed, 26 Apr 2023 21:02:42 +0800 Subject: [PATCH] video: rockchip: mpp: stop vepu2 before reset In some platform, can not do pmu_idle_request before cru reset. Resetting without pmu_idle_request while the hw is running will result in a bus err. So stop hw first before cru reset to prevent the issue. Signed-off-by: Yandong Lin Change-Id: I62ace147a0d72adb774fed989b34c7bf22af48ac --- drivers/video/rockchip/mpp/mpp_vepu2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/video/rockchip/mpp/mpp_vepu2.c b/drivers/video/rockchip/mpp/mpp_vepu2.c index f736ff2150c5..12aef5ebe75b 100644 --- a/drivers/video/rockchip/mpp/mpp_vepu2.c +++ b/drivers/video/rockchip/mpp/mpp_vepu2.c @@ -863,6 +863,8 @@ static int vepu_reset(struct mpp_dev *mpp) struct vepu_dev *enc = to_vepu_dev(mpp); struct vepu_ccu *ccu = enc->ccu; + mpp_write(mpp, VEPU2_REG_ENC_EN, 0); + udelay(5); if (enc->rst_a && enc->rst_h) { /* Don't skip this or iommu won't work after reset */ mpp_pmu_idle_request(mpp, true);