From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796428320; b=zx+1j6oww98Og6tnHCXpq+qlW7ZzKUyHwWTCITLqukFCjGWmjXlbPqu5wzfq3AFVliU7 4T97AezVVL9O5CCGKeFpXknST2Psnjw5okbzi7iAMIkH+K3r35i8gaoqeY6kOp5GC2KiS a3ReD7hlFbC45kidoE0C6e918BybiFWjjntzSTXTHVrSlliMRlo0eU7TEy084DkN3tLKb yvRvcVDI/g3iKuhyNpPrhoAxOBZsX/3wKigsl6lD2celrTgmsciHnKSbF96JbMh5Q3J4G HZmXIvI+HQqBK86mMXkOOBkoCtAViGjv6QLiBWyPJohU6TVdaMLWY848L9m2F71xhSA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796428320; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=58UvdGmdXZoajy25B0gzxvsYJhl+xpbjRnp6FOdpOAg=; b=svCpK7HzOiBcn4D/TBAKyUCynTo1MAlvpCiX3B9yOejRYEYcNguvEX8Vmu4rLAFhkHDm Zi7OyOUgGjBxZ0plO5G3aQrLpawax4i4IwgMOBcNu8E5YRxr/DUsB97/43L1O/7di2NFV 3jGbj1WvqJ3yAo4Ely8WaxLnAG2wto2mfxquZugAC1Oqa9lyHnAkIzGzuzM/J9dHb0IBX tCKEZ7cGNTTEeKI60Y1QwptQ9z1aIZHIxBMnFxFf68N17eqKoyBjixwrcLcknRszXLn4H QhTlBeMvnluBUvRrP/qDc6cVpJdIZyHyuQ6qesUFsCvgMFiuqdTZe63P9ffGl6dGG6w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=AUhnaakR; arc=none smtp.remote-ip=74.125.82.45 Received: from mail-dl1-f45.google.com (mail-dl1-f45.google.com [74.125.82.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EC9F606A335 for ; Fri, 4 Dec 2026 23:51:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9EC9F606A335 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=AUhnaakR Received: by mail-dl1-f45.google.com with SMTP id a92af1059eb24-1a2af4c8d00so1150762c88.0 for ; Fri, 04 Dec 2026 15:51:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796428319; x=1797033119; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=58UvdGmdXZoajy25B0gzxvsYJhl+xpbjRnp6FOdpOAg=; b=AUhnaakRGGtu/HnOvJjQih16+xbzu43KiPBk5J3/FFIPeAJ98wTIABCVOCr/zsb+ig tX77f+i3HxswwhfcibI4yGi3ucUtzSOcf9oAGs9PXdUq+g7vgz/QBnDm5KMXoxDk/XbP 6aBY5CaLJHgr0Xyv2QW4FcaW1Mf+c5goZ3GadiQhjf+nnkafECFs2BudPj2veNiheHFv Y8TwFzg0N6aKKXvtienIghBLkR3Wf1oAVy63271N5b1fKb8GzAfa9CNHnRQXq32kYpBZ S1rr3iyYkgVupDaQioz9/8y9JAed+7FiE9GpiGSn8u1yl6FJFZ3hoAnM8i9OMbdGq9hq SJyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796428319; x=1797033119; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=58UvdGmdXZoajy25B0gzxvsYJhl+xpbjRnp6FOdpOAg=; b=YFYAwJjcVVZTZMyJvTOSoGyxLVbHIZnSPLiXWOMfpSlF2DMC5CYSkEUyPAD51XwUP5 rJB41CjCv0gObBgpBHKYwEXSsJaf68HOFvO7NzzJMpbYfdKHWVWwJt3xqDTpC351KYZp EJqjClCk3lWivefazIa7V8lzPH6B34CyNxt53ykMuZZA3H71R9XqxDvOQ2evaTj0a3If H1BSc0WfgL7ygzR9uEkIbcDtpN8bDvYI1HijD5OIk6MIWyw2UDso/PlklR3phSbdZujD wY5Xh+9a5ysrCVri6Pe0xVZb+6ScyRN88Fo3N6goKqNj2MuWcGECAuL3wNOvEl/fxAHH rfZA== X-Forwarded-Encrypted: i=1; AL+hErEIgf+46n9cZ7DIY6EldBJ3nIBuf+AZyeotxOQKTdQXoZLEm86S0UCwHHW33zfYFKAiKJIxfvKBYLAcu7I=@vger.kernel.org X-Gm-Message-State: AB4q+uFdyMolHW/blIiimO6913HkyOJ0YpCjBeZB274Mhev+E8yQYaZ0 tD8oJVCmkjxt5513NuNFIvNsy9l7uPYnvqDmHg4jf4wQ0ebdMfp5NpUX X-Gm-Gg: AZFdTZfr4HFsXzSjokouJjQG/zt/aYv5p2MLWEBXetr2N79CkTm922fpj+k+y2hiL1t UFjz4HoxMOcBsiKSmqpZPNjGn4Q6MYpSjdB0iQ/v8kq//k0DDiAMLmfnLX+y8NLGwHlVbh0PsEp 7haVJaeBXrRItKpD9kweLDL3KMhq/1y1Mm8Nn3m+M1tK7nVDtyH/ydF58179caTMF1SnzfjJ4da Ljfa2cKnkbT5hagsd6vurp10o7OY2eIgpHhehQaJWvxWlE8WWwsKCsARrf0ALstWQlGW2FUTrin HZnfHzU94LnbVQxZR32Ovfu3FgEvfoIajT2qY6XfYLkjlEcswh7wzcnTcvqVC1LSDPQq/Rcev1X irw4fF6ev53KMrBErTKZHBPntxn4xqmeeb0R6xLgfHVp2wcVPxSaaFPHiE1TSM9CSzeKam7xTAl cAphX8j6bNLmFzNAZKZYt805IOmARWKdseOV5gkiTmKR63cc6Tf6rE6VbqdmcnGIWgwAV68BxCA eAsSBsbud7/dnU3mSkIDDB0aKqIhgCcUk1tFLjaTMcyHe8MAxug+YcsBevyDxdHLCNwBIsXFwsn x7KEHmRRdK3z8zxtTiRRyd1Qkgg7BzPI142Rebl9yDaWEnQXQgW5XCyQ9uKyw4sVnS5KlH1Rnbn edSF7 X-Received: by 2002:a05:693c:83ce:20b0:385:ce95:2e14 with SMTP id 5a478bee46e88-3875216af6amr3321933eec.30.1796428318632; Fri, 04 Dec 2026 15:51:58 -0800 (PST) Received: from flipper.lan (2403-580b-35b2-8--9d8.ip6.aussiebb.net. [2403:580b:35b2:8::9d8]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-387521bb842sm11499796eec.15.2026.12.04.15.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 15:51:58 -0800 (PST) From: Kel Modderman To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: Kel Modderman , Vishnu Reddy , Dmitry Baryshkov , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH 1/2] media: iris: Skip the IOVA reservation when the range is already reserved Date: Sat, 5 Dec 2026 09:51:38 +1000 Message-ID: <20261204235141.1264368-2-kelvmod@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261204235141.1264368-1-kelvmod@gmail.com> References: <20261204235141.1264368-1-kelvmod@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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@vger.kernel.org Signed-off-by: Kel Modderman --- 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 #include +#include #include #include #include @@ -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