[PATCH 1/2] media: iris: Skip the IOVA reservation when the range is already reserved
From: Kel Modderman
Date: Fri Dec 04 2026 - 18:52:07 EST
iris_reserve_iova_region() allocates IOVA 0 to 0x25800000 with
dma_iova_try_alloc() and fails the probe if it can't. A device tree
can already reserve that range for the video codec with an
"iommu-addresses" reserved-memory node, as the firmware device tree of
the Radxa Dragon Q6A does. dma-iommu then keeps the range out of the
IOVA allocator, so dma_iova_try_alloc() fails and Iris does not probe:
qcom-iris aa00000.video-codec: probe with driver qcom-iris failed with error -12
The range can't be used for DMA mappings either way, so skip the
reservation when an IOMMU_RESV_RESERVED region already covers it.
Claude Code (Claude Opus 5.5) found the cause, and wrote this change
and its changelog, after being asked why Iris stopped probing on the
board after a stable update. I reviewed the change and tested it on a
Radxa Dragon Q6A with v7.3.5 stable: Iris probes again, and H.264,
HEVC and VP9 decode with no SMMU faults.
Fixes: 200473c198b2 ("media: iris: Fix iova allocation from restrict region")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Kel Modderman <kelvmod@xxxxxxxxx>
---
drivers/media/platform/qcom/iris/iris_probe.c | 26 +++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/platform/qcom/iris/iris_probe.c
index 41dec90f3e2..65fd5e993ab 100644
--- a/drivers/media/platform/qcom/iris/iris_probe.c
+++ b/drivers/media/platform/qcom/iris/iris_probe.c
@@ -5,6 +5,7 @@
#include <linux/clk.h>
#include <linux/interconnect.h>
+#include <linux/iommu.h>
#include <linux/module.h>
#include <linux/pm_domain.h>
#include <linux/pm_opp.h>
@@ -158,6 +159,26 @@ static void iris_unreserve_iova_region(struct device *dev, struct dma_iova_state
dma_iova_free(dev, &iova_state[i]);
}
+static bool iris_iova_region_reserved(struct device *dev, unsigned long start,
+ unsigned long size)
+{
+ struct iommu_resv_region *region;
+ LIST_HEAD(resv_regions);
+ bool reserved = false;
+
+ iommu_get_resv_regions(dev, &resv_regions);
+ list_for_each_entry(region, &resv_regions, list) {
+ if (region->type == IOMMU_RESV_RESERVED && region->start <= start &&
+ region->start + region->length >= start + size) {
+ reserved = true;
+ break;
+ }
+ }
+ iommu_put_resv_regions(dev, &resv_regions);
+
+ return reserved;
+}
+
static int iris_reserve_iova_region(struct device *dev, struct dma_iova_state **iova_state,
unsigned long start, unsigned long size)
{
@@ -171,6 +192,11 @@ static int iris_reserve_iova_region(struct device *dev, struct dma_iova_state **
if (!state)
return ret;
+ if (iris_iova_region_reserved(dev, start, size)) {
+ *iova_state = state;
+ return 0;
+ }
+
end = start + size;
rem = end - max(start, PAGE_SIZE);
dev->bus_dma_limit = end - 1;
--
2.55.0