diff options
author | Hareesh Gundu <hareeshg@codeaurora.org> | 2017-01-02 22:23:08 +0530 |
---|---|---|
committer | Hareesh Gundu <hareeshg@codeaurora.org> | 2017-01-02 22:52:54 +0530 |
commit | 8b20da6ffc46158f941729b5b0d2afc039f05405 (patch) | |
tree | 0ebfa0f3a6e0d8fb296d0d91661e87ee42fc2694 /drivers/gpu/msm/kgsl_iommu.c | |
parent | c88fe01f9a09ec362ee89d3cafc986373f502b06 (diff) |
msm: kgsl: Remove BUG_ON from the map global
Return error instead of BUG_ON on map global failure.
This will avoid crashing the entire system.
CRs-Fixed: 1106621
Change-Id: I693dc196bb7a2e01f6a033f5fbbf7b454108108d
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
Diffstat (limited to 'drivers/gpu/msm/kgsl_iommu.c')
-rw-r--r-- | drivers/gpu/msm/kgsl_iommu.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/gpu/msm/kgsl_iommu.c b/drivers/gpu/msm/kgsl_iommu.c index bc681057250d..d997cdd2cc7e 100644 --- a/drivers/gpu/msm/kgsl_iommu.c +++ b/drivers/gpu/msm/kgsl_iommu.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -134,7 +134,7 @@ static void kgsl_iommu_unmap_globals(struct kgsl_pagetable *pagetable) } } -static void kgsl_iommu_map_globals(struct kgsl_pagetable *pagetable) +static int kgsl_iommu_map_globals(struct kgsl_pagetable *pagetable) { unsigned int i; @@ -143,9 +143,11 @@ static void kgsl_iommu_map_globals(struct kgsl_pagetable *pagetable) int ret = kgsl_mmu_map(pagetable, global_pt_entries[i].memdesc); - BUG_ON(ret); + if (ret) + return ret; } } + return 0; } static void kgsl_iommu_unmap_global_secure_pt_entry(struct kgsl_pagetable @@ -158,16 +160,16 @@ static void kgsl_iommu_unmap_global_secure_pt_entry(struct kgsl_pagetable } -static void kgsl_map_global_secure_pt_entry(struct kgsl_pagetable *pagetable) +static int kgsl_map_global_secure_pt_entry(struct kgsl_pagetable *pagetable) { - int ret; + int ret = 0; struct kgsl_memdesc *entry = kgsl_global_secure_pt_entry; if (entry != NULL) { entry->pagetable = pagetable; ret = kgsl_mmu_map(pagetable, entry); - BUG_ON(ret); } + return ret; } static void kgsl_iommu_remove_global(struct kgsl_mmu *mmu, @@ -1171,7 +1173,7 @@ static int _init_global_pt(struct kgsl_mmu *mmu, struct kgsl_pagetable *pt) goto done; } - kgsl_iommu_map_globals(pt); + ret = kgsl_iommu_map_globals(pt); done: if (ret) @@ -1227,7 +1229,7 @@ static int _init_secure_pt(struct kgsl_mmu *mmu, struct kgsl_pagetable *pt) ctx->regbase = iommu->regbase + KGSL_IOMMU_CB0_OFFSET + (cb_num << KGSL_IOMMU_CB_SHIFT); - kgsl_map_global_secure_pt_entry(pt); + ret = kgsl_map_global_secure_pt_entry(pt); done: if (ret) @@ -1288,7 +1290,7 @@ static int _init_per_process_pt(struct kgsl_mmu *mmu, struct kgsl_pagetable *pt) goto done; } - kgsl_iommu_map_globals(pt); + ret = kgsl_iommu_map_globals(pt); done: if (ret) |