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

Commit 6a186592 authored by Olav Haugan's avatar Olav Haugan
Browse files

iommu: msm: Refactor remote spinlock defconfig



Refactor the remote spinlock defconfig to allow it to be used with
subsystems other than GPU. This will enhance the usability of this
feature and minimize the chance of errors when enabling this feature.

CRs-fixed: 517873
Change-Id: I609cd77ece4e8d2e15e1a24d87a23be05a61b60f
Signed-off-by: default avatarOlav Haugan <ohaugan@codeaurora.org>
parent d6e87cbf
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -280,7 +280,7 @@ static inline struct iommu_access_ops *msm_get_iommu_access_ops(void)
}
#endif

#ifdef CONFIG_MSM_IOMMU_GPU_SYNC
#ifdef CONFIG_MSM_IOMMU_SYNC
void msm_iommu_remote_p0_spin_lock(void);
void msm_iommu_remote_p0_spin_unlock(void);

@@ -293,19 +293,6 @@ void msm_iommu_remote_p0_spin_unlock(void);
#define msm_iommu_remote_spin_unlock()
#endif

/* Allows kgsl iommu driver to acquire lock */
#define msm_iommu_lock() \
	do { \
		msm_iommu_mutex_lock(); \
		msm_iommu_remote_spin_lock(); \
	} while (0)

#define msm_iommu_unlock() \
	do { \
		msm_iommu_remote_spin_unlock(); \
		msm_iommu_mutex_unlock(); \
	} while (0)

#ifdef CONFIG_MSM_IOMMU
/*
 * Look up an IOMMU context device by its context name. NULL if none found.
+13 −1
Original line number Diff line number Diff line
@@ -49,10 +49,22 @@ config MSM_IOMMU_V1

	  If unsure, say N here.

# MSM IOMMU sync lock support
config MSM_IOMMU_SYNC
	bool "MSM IOMMU Sync Lock Support"
	depends on (ARCH_MSM8X60 || ARCH_MSM8960 || ARCH_APQ8064 || ARCH_MSM8930 || ARCH_MSM8610) && MSM_IOMMU_V0
	help
	  Say Y here if you want the IOMMU to grab a remote spinlock to ensure
	  synchronization between IOMMU accesses by CPU and other exectution
	  environments in the SoC.

	  If unsure, say N here.

# MSM IOMMU CPU-GPU sync programming support
config MSM_IOMMU_GPU_SYNC
	bool "MSM IOMMU CPU-GPU Sync Support"
	depends on (ARCH_MSM8X60 || ARCH_MSM8960 || ARCH_APQ8064 || ARCH_MSM8930) && MSM_IOMMU_V0 && MSM_REMOTE_SPINLOCK_SFPB
	depends on (ARCH_MSM8X60 || ARCH_MSM8960 || ARCH_APQ8064 || ARCH_MSM8930) && MSM_IOMMU_V0
	select  MSM_IOMMU_SYNC
	help
	  Say Y here if you want to synchronize access to IOMMU configuration
	  port between CPU and GPU. CPU will grab a remote spinlock before
+5 −3
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ struct msm_iommu_remote_lock {

static struct msm_iommu_remote_lock msm_iommu_remote_lock;

#ifdef CONFIG_MSM_IOMMU_GPU_SYNC
#ifdef CONFIG_MSM_IOMMU_SYNC
static void _msm_iommu_remote_spin_lock_init(void)
{
	msm_iommu_remote_lock.lock = smem_alloc(SMEM_SPINLOCK_ARRAY, 32);
@@ -194,12 +194,14 @@ static void *_iommu_lock_initialize(void)

static void _iommu_lock_acquire(void)
{
	msm_iommu_lock();
	msm_iommu_mutex_lock();
	msm_iommu_remote_spin_lock();
}

static void _iommu_lock_release(void)
{
	msm_iommu_unlock();
	msm_iommu_remote_spin_unlock();
	msm_iommu_mutex_unlock();
}

struct iommu_access_ops iommu_access_ops_v0 = {