mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 11:26:02 +09:00
video: rockchip: mpp: rkvenc issue for iommu irq repeat
when iommu pagefault, mark_irq to disable iommu interrupt, then handle the fault, and unmark_irq to enable hardware. Change-Id: Id40868bfab67ac27e12c181d83a8e70a09a1e498 Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
This commit is contained in:
@@ -1563,14 +1563,16 @@ int mpp_task_dump_reg(struct mpp_dev *mpp,
|
||||
return -EIO;
|
||||
|
||||
mpp_err("--- dump register ---\n");
|
||||
if (task->reg) {
|
||||
s = task->hw_info->reg_start;
|
||||
e = task->hw_info->reg_end;
|
||||
for (i = s; i <= e; i++) {
|
||||
u32 reg = i * sizeof(u32);
|
||||
if (mpp_debug_unlikely(DEBUG_DUMP_ERR_REG)) {
|
||||
if (task->reg) {
|
||||
s = task->hw_info->reg_start;
|
||||
e = task->hw_info->reg_end;
|
||||
for (i = s; i <= e; i++) {
|
||||
u32 reg = i * sizeof(u32);
|
||||
|
||||
mpp_err("reg[%03d]: %04x: 0x%08x\n",
|
||||
i, reg, task->reg[i]);
|
||||
mpp_err("reg[%03d]: %04x: 0x%08x\n",
|
||||
i, reg, task->reg[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1063,6 +1063,7 @@ static void rkvenc_iommu_handle_work(struct work_struct *work_s)
|
||||
struct mpp_dev *mpp = &enc->mpp;
|
||||
unsigned long page_iova = 0;
|
||||
|
||||
mpp_debug_enter();
|
||||
|
||||
/* avoid another page fault occur after page fault */
|
||||
down_write(&mpp->iommu_info->rw_sem);
|
||||
@@ -1081,7 +1082,10 @@ static void rkvenc_iommu_handle_work(struct work_struct *work_s)
|
||||
else
|
||||
enc->aux_iova = page_iova;
|
||||
|
||||
rk_iommu_unmask_irq(mpp->dev);
|
||||
up_write(&mpp->iommu_info->rw_sem);
|
||||
|
||||
mpp_debug_leave();
|
||||
}
|
||||
|
||||
static int rkvenc_iommu_fault_handle(struct iommu_domain *iommu,
|
||||
@@ -1095,6 +1099,7 @@ static int rkvenc_iommu_fault_handle(struct iommu_domain *iommu,
|
||||
mpp_debug(DEBUG_IOMMU, "IOMMU_GET_BUS_ID(status)=%d\n", IOMMU_GET_BUS_ID(status));
|
||||
if (IOMMU_GET_BUS_ID(status)) {
|
||||
enc->fault_iova = iova;
|
||||
rk_iommu_mask_irq(mpp->dev);
|
||||
queue_work(enc->iommu_wq, &enc->iommu_work);
|
||||
}
|
||||
mpp_debug_leave();
|
||||
|
||||
Reference in New Issue
Block a user