summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
diff options
context:
space:
mode:
authorVijayakumar <vsubbu@nvidia.com>2014-10-08 10:37:37 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:41 -0400
commitf56d50ddac2ea70c7d50f22b9cd74408b1042da3 (patch)
tree3c59c2560c42ad34909884cab800327fa6053f47 /drivers/gpu/nvgpu/gm20b/acr_gm20b.c
parentb318d4c407dda213961255fe3bcff8a2705d0abc (diff)
gpu:nvgpu:gm20b: disable irqs when hs pmu executes
bug 200040021 polling halt irq to check for hs bin completion keep irqs disabled to avoid executing irq handler Change-Id: Ic245d89580444dcbf1cf5ec34bfe0f8b0c5bbc0f Signed-off-by: Vijayakumar <vsubbu@nvidia.com> Reviewed-on: http://git-master/r/554659 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/acr_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/acr_gm20b.c47
1 files changed, 42 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
index b717272c..acfcf41b 100644
--- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
@@ -63,6 +63,11 @@ get_ucode_details pmu_acr_supp_ucode_list[] = {
63/*Once is LS mode, cpuctl_alias is only accessible*/ 63/*Once is LS mode, cpuctl_alias is only accessible*/
64void start_gm20b_pmu(struct gk20a *g) 64void start_gm20b_pmu(struct gk20a *g)
65{ 65{
66 /*disable irqs for hs falcon booting as we will poll for halt*/
67 mutex_lock(&g->pmu.isr_mutex);
68 pmu_enable_irq(&g->pmu, true);
69 g->pmu.isr_enabled = true;
70 mutex_unlock(&g->pmu.isr_mutex);
66 gk20a_writel(g, pwr_falcon_cpuctl_alias_r(), 71 gk20a_writel(g, pwr_falcon_cpuctl_alias_r(),
67 pwr_falcon_cpuctl_startcpu_f(1)); 72 pwr_falcon_cpuctl_startcpu_f(1));
68} 73}
@@ -1116,6 +1121,11 @@ int gm20b_init_pmu_setup_hw1(struct gk20a *g, struct flcn_bl_dmem_desc *desc,
1116 pmu_copy_to_dmem(pmu, g->acr.pmu_args, 1121 pmu_copy_to_dmem(pmu, g->acr.pmu_args,
1117 (u8 *)(g->ops.pmu_ver.get_pmu_cmdline_args_ptr(pmu)), 1122 (u8 *)(g->ops.pmu_ver.get_pmu_cmdline_args_ptr(pmu)),
1118 g->ops.pmu_ver.get_pmu_cmdline_args_size(pmu), 0); 1123 g->ops.pmu_ver.get_pmu_cmdline_args_size(pmu), 0);
1124 /*disable irqs for hs falcon booting as we will poll for halt*/
1125 mutex_lock(&pmu->isr_mutex);
1126 pmu_enable_irq(pmu, false);
1127 pmu->isr_enabled = false;
1128 mutex_unlock(&pmu->isr_mutex);
1119 err = bl_bootstrap(pmu, desc, bl_sz); 1129 err = bl_bootstrap(pmu, desc, bl_sz);
1120 if (err) 1130 if (err)
1121 return err; 1131 return err;
@@ -1216,8 +1226,9 @@ int pmu_exec_gen_bl(struct gk20a *g, void *desc, u8 b_wait_for_halt)
1216 * to PMU halt 1226 * to PMU halt
1217 */ 1227 */
1218 1228
1219 gk20a_writel(g, pwr_falcon_irqsclr_r(), 1229 if (clear_halt_interrupt_status(g, GPU_TIMEOUT_DEFAULT))
1220 gk20a_readl(g, pwr_falcon_irqsclr_r()) & (~(0x10))); 1230 goto err_unmap_bl;
1231
1221 gm20b_dbg_pmu("err reg :%x\n", readl(mc + 1232 gm20b_dbg_pmu("err reg :%x\n", readl(mc +
1222 MC_ERR_GENERALIZED_CARVEOUT_STATUS_0)); 1233 MC_ERR_GENERALIZED_CARVEOUT_STATUS_0));
1223 gm20b_dbg_pmu("phys sec reg %x\n", gk20a_readl(g, 1234 gm20b_dbg_pmu("phys sec reg %x\n", gk20a_readl(g,
@@ -1228,10 +1239,11 @@ int pmu_exec_gen_bl(struct gk20a *g, void *desc, u8 b_wait_for_halt)
1228 /* Poll for HALT */ 1239 /* Poll for HALT */
1229 if (b_wait_for_halt) { 1240 if (b_wait_for_halt) {
1230 err = pmu_wait_for_halt(g, GPU_TIMEOUT_DEFAULT); 1241 err = pmu_wait_for_halt(g, GPU_TIMEOUT_DEFAULT);
1231 if (err == 0) 1242 if (err == 0) {
1232 /* Clear the HALT interrupt */ 1243 /* Clear the HALT interrupt */
1233 gk20a_writel(g, pwr_falcon_irqsclr_r(), 1244 if (clear_halt_interrupt_status(g, GPU_TIMEOUT_DEFAULT))
1234 gk20a_readl(g, pwr_falcon_irqsclr_r()) & (~(0x10))); 1245 goto err_unmap_bl;
1246 }
1235 else 1247 else
1236 goto err_unmap_bl; 1248 goto err_unmap_bl;
1237 } 1249 }
@@ -1281,3 +1293,28 @@ int pmu_wait_for_halt(struct gk20a *g, unsigned int timeout)
1281 return -EBUSY; 1293 return -EBUSY;
1282 return 0; 1294 return 0;
1283} 1295}
1296
1297/*!
1298* Wait for PMU halt interrupt status to be cleared
1299* @param[in] g GPU object pointer
1300* @param[in] timeout_us Timeout in Us for PMU to halt
1301* @return '0' if PMU halt irq status is clear
1302*/
1303int clear_halt_interrupt_status(struct gk20a *g, unsigned int timeout)
1304{
1305 u32 data = 0;
1306 while (timeout != 0) {
1307 gk20a_writel(g, pwr_falcon_irqsclr_r(),
1308 gk20a_readl(g, pwr_falcon_irqsclr_r()) | (0x10));
1309 data = gk20a_readl(g, (pwr_falcon_irqstat_r()));
1310 if ((data & pwr_falcon_irqstat_halt_true_f()) !=
1311 pwr_falcon_irqstat_halt_true_f())
1312 /*halt irq is clear*/
1313 break;
1314 timeout--;
1315 udelay(1);
1316 }
1317 if (timeout == 0)
1318 return -EBUSY;
1319 return 0;
1320}