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

Commit 721a66e6 authored by Rajesh Kemisetti's avatar Rajesh Kemisetti Committed by David Keitel
Browse files

msm: kgsl: Declare platform_bus_type as secure for ARM driver



ARM driver supports only one bus for all context banks.

In some cases, hypervisor may not be available and GPU SMMU
uses ARM driver. This will make all context banks are on
non secure bus and kgsl_mmu_bus_secured() returns -EPERM.

Make platform_bus_type as secure for ARM driver.

Change-Id: I11a637ca2b1ef29cc42c9811cad009312a2879cd
Signed-off-by: default avatarRajesh Kemisetti <rajeshk@codeaurora.org>
parent ad6f4862
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
/* Copyright (c) 2002,2007-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-2016, 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
@@ -334,12 +334,20 @@ kgsl_mmu_pagetable_get_contextidr(struct kgsl_pagetable *pagetable)

#ifdef CONFIG_QCOM_IOMMU
#include <linux/qcom_iommu.h>
#ifndef CONFIG_ARM_SMMU
static inline bool kgsl_mmu_bus_secured(struct device *dev)
{
	struct bus_type *bus = msm_iommu_get_bus(dev);

	return (bus == &msm_iommu_sec_bus_type) ? true : false;
}
#else
static inline bool kgsl_mmu_bus_secured(struct device *dev)
{
	/* ARM driver contains all context banks on single bus */
	return true;
}
#endif /* CONFIG_ARM_SMMU */
static inline struct bus_type *kgsl_mmu_get_bus(struct device *dev)
{
	return msm_iommu_get_bus(dev);
@@ -351,7 +359,8 @@ static inline struct device *kgsl_mmu_get_ctx(const char *name)
#else
static inline bool kgsl_mmu_bus_secured(struct device *dev)
{
	return false;
	/*ARM driver contains all context banks on single bus */
	return true;
}

static inline struct bus_type *kgsl_mmu_get_bus(struct device *dev)