gpu: nvgpu: fix boot time process crash

In poweron sequence the mc interrupts are being enabled before
initializing ecc support. That means ecc handler can be triggered
if there is ecc error occur and can cause Segmentation Fault.

To fix this issue adding a check in tu104_fbpa_handle_ecc_intr()

Bug 2540926

Change-Id: I277a8946d797bfcaac353d27f4eadf0c7ebbadfa
Signed-off-by: Prateek Sethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2125568
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Prateek Sethi
2019-05-26 21:54:54 +05:30
committed by mobile promotions
parent a1248d87fe
commit bf5f86b354

View File

@@ -52,6 +52,11 @@ static void tu104_fbpa_handle_ecc_intr(struct gk20a *g,
status = gk20a_readl(g, offset + fbpa_0_ecc_status_r(subp_id));
if (!g->ecc.initialized) {
nvgpu_info(g, "ecc support is not initialized");
goto out;
}
if ((status & fbpa_0_ecc_status_sec_counter_overflow_pending_f()) != 0U) {
nvgpu_err(g, "fbpa %u subp %u ecc sec counter overflow",
fbpa_id, subp_id);
@@ -76,6 +81,7 @@ static void tu104_fbpa_handle_ecc_intr(struct gk20a *g,
g->ecc.fbpa.fbpa_ecc_ded_err_count[cnt_idx].counter += ded_cnt;
}
out:
gk20a_writel(g, offset + fbpa_0_ecc_status_r(subp_id), status);
}