mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
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:
@@ -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 */
|
||||
@@ -154,4 +155,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
|
||||
|
||||
@@ -835,6 +835,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;
|
||||
@@ -858,6 +859,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;
|
||||
}
|
||||
|
||||
@@ -871,6 +873,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:
|
||||
@@ -880,6 +883,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;
|
||||
@@ -1136,6 +1140,7 @@ static int 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;
|
||||
}
|
||||
|
||||
@@ -1155,6 +1160,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)
|
||||
@@ -1463,10 +1469,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