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

Commit 5e362ff2 authored by Vipin Deep Kaur's avatar Vipin Deep Kaur Committed by Gerrit - the friendly Code Review server
Browse files

dma: qcom: gpi.c: Configure GSI device node



Configure the GSI driver to call "iommu initialization code"
only if iommu-dma is disabled.

Change-Id: I6667870f1d17ddca149d7e46bbdd06c7d29e072b
Signed-off-by: default avatarVipin Deep Kaur <vkaur@codeaurora.org>
parent 2cea1f57
Loading
Loading
Loading
Loading
+38 −22
Original line number Diff line number Diff line
@@ -2642,6 +2642,7 @@ static int gpi_probe(struct platform_device *pdev)
{
	struct gpi_dev *gpi_dev;
	int ret, i;
	const char *mode = NULL;

	gpi_dev = devm_kzalloc(&pdev->dev, sizeof(*gpi_dev), GFP_KERNEL);
	if (!gpi_dev)
@@ -2689,11 +2690,18 @@ static int gpi_probe(struct platform_device *pdev)
		GPI_ERR(gpi_dev, "missing 'qcom,smmu-cfg' DT node\n");
		return ret;
	}
	if (gpi_dev->smmu_cfg && !(gpi_dev->smmu_cfg & GPI_SMMU_S1_BYPASS)) {

	ret = of_property_read_string(gpi_dev->dev->of_node,
			"qcom,iommu-dma", &mode);

	if ((ret == 0) && (strcmp(mode, "disabled") == 0)) {
		if (gpi_dev->smmu_cfg &&
			!(gpi_dev->smmu_cfg & GPI_SMMU_S1_BYPASS)) {

			u64 iova_range[2];

		ret = of_property_count_elems_of_size(gpi_dev->dev->of_node,
						      "qcom,iova-range",
			ret = of_property_count_elems_of_size(
				gpi_dev->dev->of_node, "qcom,iova-range",
							sizeof(iova_range));
			if (ret != 1) {
				GPI_ERR(gpi_dev,
@@ -2715,9 +2723,18 @@ static int gpi_probe(struct platform_device *pdev)

		ret = gpi_smmu_init(gpi_dev);
		if (ret) {
		GPI_ERR(gpi_dev, "error configuring smmu, ret:%d\n", ret);
			GPI_ERR(gpi_dev,
				"error configuring smmu, ret:%d\n", ret);
			return ret;
		}
	} else {
		ret = dma_set_mask(gpi_dev->dev, DMA_BIT_MASK(64));
		if (ret) {
			GPI_ERR(gpi_dev,
			"Error setting dma_mask to 64, ret:%d\n", ret);
			return ret;
		}
	}

	gpi_dev->gpiis = devm_kzalloc(gpi_dev->dev,
				sizeof(*gpi_dev->gpiis) * gpi_dev->max_gpii,
@@ -2725,7 +2742,6 @@ static int gpi_probe(struct platform_device *pdev)
	if (!gpi_dev->gpiis)
		return -ENOMEM;


	/* setup all the supported gpii */
	INIT_LIST_HEAD(&gpi_dev->dma_device.channels);
	for (i = 0; i < gpi_dev->max_gpii; i++) {