[PATCH v10 05/14] media: iris: Skip DMA mask setting to core device when IOMMU is not mapped
Vishnu Reddy <[email protected]> Sun, 26 Jul 2026 11:19:35 +0530
| Newsgroups | dev.linux.lists.iommu,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-media |
|---|---|
| Message-ID | <[email protected]> |
From: Vikash Garodia <[email protected]> The non-pixel and pixel subnodes move the IOMMU streams away from the iris parent device. As a result, the core device may not have an IOMMU mapping, and setting its DMA mask is unnecessary. Legacy platforms that have not migrated to subnodes still associate the streams with the parent device and still need the DMA mask setup. Call dma_set_mask_and_coherent() only when an IOMMU is mapped to the iris core device. Co-developed-by: Vishnu Reddy <[email protected]> Signed-off-by: Vishnu Reddy <[email protected]> Signed-off-by: Vikash Garodia <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Tested-by: Daniel J Blueman <[email protected]> --- drivers/media/platform/qcom/iris/iris_probe.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c index 2594f5a67378..c40c4ec44e83 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -310,9 +310,11 @@ static int iris_probe(struct platform_device *pdev) dma_mask = core->iris_platform_data->dma_mask; - ret = dma_set_mask_and_coherent(dev, dma_mask); - if (ret) - goto err_vdev_unreg_enc; + if (device_iommu_mapped(dev)) { + ret = dma_set_mask_and_coherent(dev, dma_mask); + if (ret) + goto err_vdev_unreg_enc; + } dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); dma_set_seg_boundary(&pdev->dev, DMA_BIT_MASK(32)); -- 2.34.1