Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a999a488 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Remove BUG_ON from the map global"

parents 443502cc 8b20da6f
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
/* 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)