video: rockchip: mpp: fix bus err for px30 dec/enc

When encoding and decoding in parallel, iommu switch failed cause bus
err.
rk_iommu ff442800.iommu: BUS_ERROR occurred at 0x0000000000000000

Rootcause:
Get a invalid dte addr when px30_workaround_combo_init, because of iommu
not enable status.
solution:
read a valid dte addr when iommu enable status.

Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: I4b84c650a6e132928a6dc91a26985abd8c273cfe
This commit is contained in:
Yandong Lin
2023-03-17 11:12:19 +08:00
committed by Tao Huang
parent b3fc1c6b9b
commit d2fa6b5151

View File

@@ -19,6 +19,7 @@
#include "../mpp_common.h"
#include "../mpp_iommu.h"
#include "mpp_hack_px30.h"
#include <soc/rockchip/rockchip_iommu.h>
#define RK_MMU_DTE_ADDR 0x00 /* Directory table address */
#define RK_MMU_STATUS 0x04
@@ -177,7 +178,17 @@ int px30_workaround_combo_init(struct mpp_dev *mpp)
iommu->grf_val = mpp->grf_info->val & MPP_GRF_VAL_MASK;
if (mpp->hw_ops->clk_on)
mpp->hw_ops->clk_on(mpp);
iommu->dte_addr = mpp_iommu_get_dte_addr(iommu);
/*
* ensure that iommu is enable, so that read valid dte value
*/
if (rockchip_iommu_is_enabled(mpp->dev))
iommu->dte_addr = mpp_iommu_get_dte_addr(iommu);
else {
rockchip_iommu_enable(mpp->dev);
iommu->dte_addr = mpp_iommu_get_dte_addr(iommu);
rockchip_iommu_disable(mpp->dev);
}
dev_err(mpp->dev, "%s dte_addr %08x\n", __func__, iommu->dte_addr);
if (mpp->hw_ops->clk_off)
mpp->hw_ops->clk_off(mpp);
INIT_LIST_HEAD(&iommu->link);