video: rockchip: mpp: rkvdec2_link: disable mmu irq when reset
Signed-off-by: Chandler Chen <chandler.chen@rock-chips.com> Change-Id: I537a2caf670456a1a25894e94968b6445961ff91
This commit is contained in:
@ -440,6 +440,8 @@ mpp_iommu_probe(struct device *dev)
|
||||
info->dev = dev;
|
||||
info->pdev = pdev;
|
||||
init_rwsem(&info->rw_sem);
|
||||
info->irq = platform_get_irq(pdev, 0);
|
||||
info->got_irq = (info->irq < 0) ? false : true;
|
||||
|
||||
return info;
|
||||
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
|
||||
#include <linux/iommu.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/interrupt.h>
|
||||
|
||||
struct mpp_dma_buffer {
|
||||
/* link to dma session buffer list */
|
||||
@ -73,6 +74,8 @@ struct mpp_iommu_info {
|
||||
struct iommu_group *group;
|
||||
struct mpp_rk_iommu *iommu;
|
||||
iommu_fault_handler_t hdl;
|
||||
int irq;
|
||||
int got_irq;
|
||||
};
|
||||
|
||||
struct mpp_dma_session *
|
||||
@ -137,4 +140,16 @@ static inline int mpp_iommu_up_write(struct mpp_iommu_info *info)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void mpp_iommu_enable_irq(struct mpp_iommu_info *info)
|
||||
{
|
||||
if (info && info->got_irq)
|
||||
enable_irq(info->irq);
|
||||
}
|
||||
|
||||
static inline void mpp_iommu_disable_irq(struct mpp_iommu_info *info)
|
||||
{
|
||||
if (info && info->got_irq)
|
||||
disable_irq(info->irq);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -818,6 +818,7 @@ static int rkvdec2_link_isr(struct mpp_dev *mpp)
|
||||
mpp_debug_enter();
|
||||
|
||||
disable_irq(mpp->irq);
|
||||
mpp_iommu_disable_irq(mpp->iommu_info);
|
||||
rkvdec_link_status_update(link_dec);
|
||||
link_dec->irq_status = irq_status;
|
||||
prev_dec_num = link_dec->task_decoded;
|
||||
@ -841,6 +842,7 @@ static int rkvdec2_link_isr(struct mpp_dev *mpp)
|
||||
if (link_dec->enabled && !count && !need_reset) {
|
||||
/* process extra isr when task is processed */
|
||||
enable_irq(mpp->irq);
|
||||
mpp_iommu_enable_irq(mpp->iommu_info);
|
||||
goto done;
|
||||
}
|
||||
|
||||
@ -854,6 +856,7 @@ static int rkvdec2_link_isr(struct mpp_dev *mpp)
|
||||
goto do_reset;
|
||||
|
||||
enable_irq(mpp->irq);
|
||||
mpp_iommu_enable_irq(mpp->iommu_info);
|
||||
goto done;
|
||||
|
||||
do_reset:
|
||||
@ -863,6 +866,7 @@ do_reset:
|
||||
link_dec->task_decoded = 0;
|
||||
link_dec->task_total = 0;
|
||||
enable_irq(mpp->irq);
|
||||
mpp_iommu_enable_irq(mpp->iommu_info);
|
||||
|
||||
if (link_dec->total == link_dec->decoded)
|
||||
goto done;
|
||||
@ -1117,6 +1121,7 @@ static void rkvdec2_link_power_on(struct mpp_dev *mpp)
|
||||
|
||||
if (!link_dec->irq_enabled) {
|
||||
enable_irq(mpp->irq);
|
||||
mpp_iommu_enable_irq(mpp->iommu_info);
|
||||
link_dec->irq_enabled = 1;
|
||||
}
|
||||
|
||||
@ -1151,6 +1156,7 @@ static void rkvdec2_link_power_off(struct mpp_dev *mpp)
|
||||
|
||||
if (atomic_xchg(&link_dec->power_enabled, 0)) {
|
||||
disable_irq(mpp->irq);
|
||||
mpp_iommu_disable_irq(mpp->iommu_info);
|
||||
link_dec->irq_enabled = 0;
|
||||
|
||||
if (mpp->hw_ops->clk_off)
|
||||
@ -1486,10 +1492,12 @@ again:
|
||||
goto done;
|
||||
|
||||
disable_irq(mpp->irq);
|
||||
mpp_iommu_disable_irq(mpp->iommu_info);
|
||||
rkvdec2_link_reset(mpp);
|
||||
link_dec->task_decoded = 0;
|
||||
link_dec->task_total = 0;
|
||||
enable_irq(mpp->irq);
|
||||
mpp_iommu_enable_irq(mpp->iommu_info);
|
||||
}
|
||||
/*
|
||||
* process pending queue to find the task to accept.
|
||||
|
||||
Reference in New Issue
Block a user