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

Commit fb77ada1 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Handle a defer from IOMMU



of_dma_configure() will return -EPROBE_DEFER if the IOMMU driver isn't
set up yet. Propagate that error all the way back to probe.

Change-Id: Ic0dedbad3bdda6516386f6eeff485065f83aee9b
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 53aa7777
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -4841,6 +4841,11 @@ int kgsl_device_platform_probe(struct kgsl_device *device)
	if (status)
		goto error;

	/* This can return -EPROBE_DEFER */
	status = kgsl_mmu_probe(device);
	if (status != 0)
		goto error_pwrctrl_close;

	if (!devm_request_mem_region(&pdev->dev, device->reg_phys,
				device->reg_len, device->name)) {
		dev_err(device->dev, "request_mem_region failed\n");
@@ -4868,10 +4873,6 @@ int kgsl_device_platform_probe(struct kgsl_device *device)
	rwlock_init(&device->context_lock);
	spin_lock_init(&device->submit_lock);

	status = kgsl_mmu_probe(device);
	if (status != 0)
		goto error_pwrctrl_close;

	/* Check to see if our device can perform DMA correctly */
	status = dma_set_coherent_mask(&pdev->dev, KGSL_DMA_BIT_MASK);
	if (status)
+6 −2
Original line number Diff line number Diff line
@@ -288,10 +288,14 @@ static int gmu_iommu_cb_probe(struct gmu_device *gmu,
		return -ENODEV;

	pdev = of_find_device_by_node(node);
	of_dma_configure(&pdev->dev, node, true);

	ret = of_dma_configure(&pdev->dev, node, true);
	of_node_put(node);

	if (ret) {
		platform_device_put(pdev);
		return ret;
	}

	ctx->pdev = pdev;
	ctx->domain = iommu_domain_alloc(&platform_bus_type);
	if (ctx->domain == NULL) {
+3 −2
Original line number Diff line number Diff line
@@ -2412,6 +2412,7 @@ static int kgsl_iommu_probe_child(struct kgsl_device *device,
	struct device_node *node = of_find_node_by_name(parent, name);
	struct platform_device *pdev;
	struct device_node *phandle;
	int ret;

	if (!node)
		return -ENOENT;
@@ -2430,10 +2431,10 @@ static int kgsl_iommu_probe_child(struct kgsl_device *device,

	of_node_put(phandle);

	of_dma_configure(&pdev->dev, node, true);
	ret = of_dma_configure(&pdev->dev, node, true);

	of_node_put(node);
	return 0;
	return ret;
}

static void iommu_probe_lpac_context(struct kgsl_device *device,
+2 −2
Original line number Diff line number Diff line
@@ -646,8 +646,8 @@ int kgsl_mmu_probe(struct kgsl_device *device)
	 * go for the NOMMU option instead
	 */
	ret = kgsl_iommu_probe(device);
	if (!ret)
		return 0;
	if (!ret || ret == -EPROBE_DEFER)
		return ret;

	/* set up for NOMMU */
	set_bit(KGSL_MMU_GLOBAL_PAGETABLE, &mmu->features);