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

Commit 45c412cc authored by Chintan Pandya's avatar Chintan Pandya
Browse files

iommu: Use proper bus for domain allocation in client drivers



When there are multiple IOMMU drivers in the system,
each one will be sitting on different busses. This
way, clients should be choosing the right bus to
declare their domain on. Once and for all, update
all the clients code to use proper bus abstraction
API msm_iommu_get_bus() to get right bus.

Change-Id: I5edf7037e7b1e4af6a559b6aeaa0b6de0976bf35
Signed-off-by: default avatarChintan Pandya <cpandya@codeaurora.org>
parent 45f1dede
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -493,7 +493,7 @@ static struct mdp4_platform_config *mdp4_get_config(struct platform_device *dev)
#ifdef CONFIG_OF
	/* TODO */
	config.max_clk = 266667000;
	config.iommu = iommu_domain_alloc(&platform_bus_type);
	config.iommu = iommu_domain_alloc(msm_iommu_get_bus(&dev->dev));
#else
	config.max_clk = 200000000;

+1 −1
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ static struct mdp5_platform_config *mdp5_get_config(struct platform_device *dev)
#ifdef CONFIG_OF
	/* TODO */
#endif
	config.iommu = iommu_domain_alloc(&platform_bus_type);
	config.iommu = iommu_domain_alloc(msm_iommu_get_bus(&dev->dev));
	/* TODO hard-coded in downstream mdss, but should it be? */
	config.max_clk = 200000000;
	/* TODO get from DT: */
+2 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/dma-attrs.h>
#include <linux/of_platform.h>
#include <linux/iommu.h>
#include <linux/qcom_iommu.h>
#include <linux/dma-mapping.h>
#include <linux/msm_dma_iommu_mapping.h>
#include "cam_smmu_api.h"
@@ -1395,7 +1396,7 @@ static int cam_smmu_setup_cb(struct cam_context_bank_info *cb,
	}

	/* create a virtual mapping */
	cb->mapping = arm_iommu_create_mapping(&platform_bus_type,
	cb->mapping = arm_iommu_create_mapping(msm_iommu_get_bus(dev),
		cb->va_start, cb->va_len);
	if (IS_ERR(cb->mapping)) {
		pr_err("Error: create mapping Failed\n");
+2 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <linux/err.h>
#include <linux/io.h>
#include <linux/iommu.h>
#include <linux/qcom_iommu.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/module.h>
@@ -153,7 +154,7 @@ static int venus_setup_cb(struct device *dev,
	size_t va_size = size;

	venus_data->mapping = arm_iommu_create_mapping(
		&platform_bus_type, va_start, va_size);
		msm_iommu_get_bus(dev), va_start, va_size);
	if (IS_ERR_OR_NULL(venus_data->mapping)) {
		dprintk(VIDC_ERR, "%s: failed to create mapping for %s\n",
		__func__, dev_name(dev));
+4 −3
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include <linux/msm-bus-board.h>
#include <linux/netdevice.h>
#include <linux/delay.h>
#include <linux/qcom_iommu.h>
#include "ipa_i.h"
#include "ipa_rm_i.h"

@@ -3753,7 +3754,7 @@ static int ipa_smmu_wlan_cb_probe(struct device *dev)
	IPADBG("sub pdev=%p\n", dev);

	cb->dev = dev;
	cb->iommu = iommu_domain_alloc(&platform_bus_type);
	cb->iommu = iommu_domain_alloc(msm_iommu_get_bus(dev));
	if (!cb->iommu) {
		IPAERR("could not alloc iommu domain\n");
		/* assume this failure is because iommu driver is not ready */
@@ -3813,7 +3814,7 @@ static int ipa_smmu_uc_cb_probe(struct device *dev)
	}

	cb->dev = dev;
	cb->mapping = arm_iommu_create_mapping(&platform_bus_type,
	cb->mapping = arm_iommu_create_mapping(msm_iommu_get_bus(dev),
			IPA_SMMU_UC_VA_START, IPA_SMMU_UC_VA_SIZE);
	if (IS_ERR(cb->mapping)) {
		IPADBG("Fail to create mapping\n");
@@ -3860,7 +3861,7 @@ static int ipa_smmu_ap_cb_probe(struct device *dev)
	}

	cb->dev = dev;
	cb->mapping = arm_iommu_create_mapping(&platform_bus_type,
	cb->mapping = arm_iommu_create_mapping(msm_iommu_get_bus(dev),
			IPA_SMMU_AP_VA_START, IPA_SMMU_AP_VA_SIZE);
	if (IS_ERR(cb->mapping)) {
		IPADBG("Fail to create mapping\n");
Loading