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

Commit ca3e7ebe authored by Isaac J. Manjarres's avatar Isaac J. Manjarres
Browse files

soc: qcom: mem-buf: Configure the mem-buf device's DMA mask



The mem-buf device can handle memory from anywhere in the
system. This includes memory with a physical address above
32 bits, so configure the DMA mask for the mem-buf device
based on the system configuration.

Change-Id: If91bb6d8044e8e6f47994acd7e50633b46596808
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent 4def0475
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1560,6 +1560,8 @@ static int mem_buf_probe(struct platform_device *pdev)
	int ret;
	struct device *dev = &pdev->dev;
	struct device *class_dev;
	u64 dma_mask = IS_ENABLED(CONFIG_ARM64) ? DMA_BIT_MASK(64) :
		DMA_BIT_MASK(32);

	if (of_property_match_string(dev->of_node, "qcom,mem-buf-capabilities",
				     "supplier") >= 0) {
@@ -1577,6 +1579,12 @@ static int mem_buf_probe(struct platform_device *pdev)
		return -EINVAL;
	}

	ret = dma_set_mask_and_coherent(dev, dma_mask);
	if (ret) {
		dev_err(dev, "Unable to set dma mask: %d\n", ret);
		return ret;
	}

	mem_buf_msgq_recv_thr = kthread_create(mem_buf_msgq_recv_fn, NULL,
					       "mem_buf_rcvr");
	if (IS_ERR(mem_buf_msgq_recv_thr)) {