summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaz Fukuoka <kfukuoka@nvidia.com>2011-05-25 18:21:32 -0700
committerRohan Somvanshi <rsomvanshi@nvidia.com>2011-06-14 04:27:31 -0700
commitb3419b5dfe6433ea16f58a76b39e0f83023d32c0 (patch)
tree0c1a94a2ecd6e61f024410789f741af074c46a6d
parentb3c905c825c16cfff9fe43681f616aa4a0314a8d (diff)
media: tegra: avp: Clear interrupt registers when AVP starts
There was no code to clear interrupt registers for AVP. First run of AVP was OK because those registers start from reset value. But because those registers were not cleared, when the second time AVP was started, some interrupts were enabled too early. That caused interrupts coming before handlers were ready. This change also removes the workaroud for the bug. bug 827353 bug 826234 Change-Id: I21876a4d2a8d729def9f43a0f8879e1de3e84dde Reviewed-on: http://git-master/r/33083 Reviewed-on: http://git-master/r/35355 Tested-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Kaz Fukuoka <kfukuoka@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/include/mach/legacy_irq.h1
-rw-r--r--arch/arm/mach-tegra/legacy_irq.c11
-rw-r--r--drivers/media/video/tegra/avp/avp.c4
3 files changed, 16 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/include/mach/legacy_irq.h b/arch/arm/mach-tegra/include/mach/legacy_irq.h
index 3a2bfab9e54f..82d1a226fa1c 100644
--- a/arch/arm/mach-tegra/include/mach/legacy_irq.h
+++ b/arch/arm/mach-tegra/include/mach/legacy_irq.h
@@ -31,6 +31,7 @@ int tegra_legacy_irq_set_wake(int irq, int enable);
void tegra_legacy_irq_set_lp1_wake_mask(void);
void tegra_legacy_irq_restore_mask(void);
void tegra_init_legacy_irq(void);
+void tegra_init_legacy_irq_cop(void);
void tegra_legacy_irq_suspend(void);
void tegra_legacy_irq_resume(void);
#endif
diff --git a/arch/arm/mach-tegra/legacy_irq.c b/arch/arm/mach-tegra/legacy_irq.c
index 5a6197bacbb1..a768f3e8d45b 100644
--- a/arch/arm/mach-tegra/legacy_irq.c
+++ b/arch/arm/mach-tegra/legacy_irq.c
@@ -174,6 +174,17 @@ void tegra_init_legacy_irq(void)
}
}
+void tegra_init_legacy_irq_cop(void)
+{
+ int i;
+
+ for (i = 0; i < NUM_ICTLRS; i++) {
+ void __iomem *ictlr = ictlr_reg_base[i];
+ writel(~0, ictlr + ICTLR_COP_IER_CLR);
+ writel(0, ictlr + ICTLR_COP_IEP_CLASS);
+ }
+}
+
#ifdef CONFIG_PM
static u32 cop_ier[NUM_ICTLRS];
static u32 cpu_ier[NUM_ICTLRS];
diff --git a/drivers/media/video/tegra/avp/avp.c b/drivers/media/video/tegra/avp/avp.c
index 384fd5af3890..af0a9853f445 100644
--- a/drivers/media/video/tegra/avp/avp.c
+++ b/drivers/media/video/tegra/avp/avp.c
@@ -41,6 +41,7 @@
#include <mach/io.h>
#include <mach/iomap.h>
#include <mach/nvmap.h>
+#include <mach/legacy_irq.h>
#include "../../../../video/tegra/nvmap/nvmap.h"
@@ -953,6 +954,8 @@ static int avp_init(struct tegra_avp_info *avp, const char *fw_file)
wmb();
release_firmware(avp_fw);
+ tegra_init_legacy_irq_cop();
+
ret = avp_reset(avp, AVP_KERNEL_VIRT_BASE);
if (ret) {
pr_err("%s: cannot reset the AVP.. aborting..\n", __func__);
@@ -1347,6 +1350,7 @@ int tegra_avp_release(struct tegra_avp_info *avp)
{
int ret = 0;
+ pr_debug("%s: close\n", __func__);
mutex_lock(&avp->open_lock);
if (!avp->refcount) {
pr_err("%s: releasing while in invalid state\n", __func__);