From nobody Fri Sep 25 11:12:36 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EA4E3FC5C9 for ; Sun, 13 Sep 2026 18:49:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325397; cv=none; b=YJEHZMImL5vwk42zdCI5/uR7b2HwoCkxqUu4kxPqkLbxig3rziaO/2CPDDzOweLe5Z968B+HM43ZmffoohDEHPjCFfRM6B0TX7RCxGEBLR2ISeObZAAR+V1FfClhzOWRLyU3Hx9YqfEeW3kt8dKJ86dqizD+SzNr+c6mt2lTgFU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325397; c=relaxed/simple; bh=AiyWfqplixyHhsYEa6qazzHkZE3xEPK1wk4cmDCQzxc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YzXmYi4E7Iw1YCu9Z4x7Q4OnZLa3C9rkAJFhmXs61DqKBkRNDsXiht1U86tsE8QBujKR4Q0QtsyX3+LOmqI7KvlFxlIHFi/buD3WtTA0ug97nCTBOwPTSQs+pJ++tHfKWccr1apXVY+1I7Cfn4PXVQdIKXvaR5YipCVIJN6SUUk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=ZpnZospk; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=NzZqzhSK; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="ZpnZospk"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="NzZqzhSK" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI39Vv1749915 for ; Sun, 13 Sep 2026 18:49:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= j/B543lMo2xs5fq0oxi7+gzjq2nnRamJAsArnba3yCk=; b=ZpnZospk0atr1Q4t GWeK1YAhSl++J7e+yWGzMdx5FSQ9mE8F+oKDuu8tpg6eXbvJ1bALB1gR29VkOyeZ bmGxfwg52pVBsdkZNg6JuSkSnq90jfrbuCy2Y6NABKchbj0Agv1WzQMmhLlKOUX+ oi738aHpfdNw0lLZxLb2OWN307hEr4aU4/eK/E6xaHAOQzJyp5cX35kcEdbzJt9C UoTro1WO+1M4E0rk7h73J7sT2HTIvl4kYORRqXA2IeT1Pn1JbqN44rS1XV6wcVoq AZTLEWJnC+/hrT9Kbs0FGn/wJCrRbCwM5QcJ2ijEYCmmdzYVKzeqiH8yPyc5R9qr MpX4qQ== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9cbw2g-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:49:53 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-396b9ef3070so4661056a91.3 for ; Sun, 13 Sep 2026 11:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325393; x=1789930193; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=j/B543lMo2xs5fq0oxi7+gzjq2nnRamJAsArnba3yCk=; b=NzZqzhSK8O9w9H+165Uh71KsyssV+xaLJOFXSQ054h74lzthg95r5WpW+Z3GFR+yQB 4fBDTuJ2rBUHLqBdrpk+fq2DIaCcA8LfziNNeUFwH/FOoKlJJsT4/LniP7GJu4M3qwEg 3OJPGHjSUe+vGKVvMXVNSXXPoqHt7A6vKyJTK16+bua3Bh/w+qkK2WOKceaicPOasU3b scY36t3Bm03mSclVF3YB55abzTLe2jAZODtql2Ce2QZv6ZpcAE8y29IsJCX/60YMHmST Uw0+1h3YIIziafqGUJYgv1qtd9/Nlhh3xSGnB6M/DJyjShkLaRqVJ88aHhybaiwc1sjO /IwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325393; x=1789930193; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=j/B543lMo2xs5fq0oxi7+gzjq2nnRamJAsArnba3yCk=; b=q3Gf133ABwCliyRh5soAEo6BG08nCUOXG52DuE4GmV1LGDEsPYuQueAorOVpPt9MCV 9onlwd/Rb+Hk5Q3LGm6sTdbEU9khG22lzjJ/tCsmlq/rW+e0Ttvp1LyGoBABc0+B4Lq0 g+hzYidZlHbXAgpm+ZDt2CAKxmVlzeWBlpJIxxhsiHFVvLaEgynXv6+lYyfAM+cLeQBW UzmZZawl9MdOBJ7iOZOOdha1VXYUieL/YQxO3Yxql4HKJ7KkVJHxPEV5+ECyodPOtX/h 7DWNyTUCwS5zvfpHVssVy2+1BOiryq82VANr65tPZXs73f2ynoi0hYFberKEKDM/MdVA CmbQ== X-Forwarded-Encrypted: i=1; AKwUvBzlOaoM4d0TofK7ybGd1u8WvFYKJm7PD2POBS9TsDJT4742Pj9Ruf4l57DGeQnmwGEM+t+K9n7pTyV6myk=@vger.kernel.org X-Gm-Message-State: AFuF++n0FJWutXDpaApH4jPxwIfighnoSM7/nmfd+i1u8hydIv98fSlA VZ75CfmWw84hfq3hVZfrhgocf5F5X23tLAazoOdvE1uhfxxbk4Hd4Y4x3Qoa9Ejqhk+FVETH6+d TPIl2JjiLVmREkS0+vA9CkZ+2IxHuJDoC7SUEdJ8Xf4PbhMrnWG27Hj8Yujt+T5xH1FM= X-Gm-Gg: AYBFou1PsPBBzIxtcUjC0jRPjflyOrEuvLti3zJ7ym+0nHy0+jQ438ZZT82ks5LPtta ZpjmO+4bc2v67CdmHqos2hnEoeRTjb33Kvb1AyRGb5Ew3KdwoJPa4TxCQI7an7ROuJ3/7tcP/iE P9YRxmv+e0YG7glCL73oSpnw0GGc5XrNXIZTXllYBIHbYB3QEjX+iswEYy5sp5KVmFQ3XbKXkpA ZinjXhUjPOJ7gEiFL2qrRD14r4NiojFhJ+Ily4Fhn4cncS3mLlB8aldoeubUqh/1vaolpHdsm62 TnmSKB7TobIFea1G6G5MGavR0ghqWmiTM/AlqvkaNFZR3OARRuhRvCBCCAG8Of+z0oDe7Jrh51N s9P32K39nSVul8oyPluyhaYsneE5shGu/I28= X-Received: by 2002:a17:90b:3dcd:b0:399:ea1:5a82 with SMTP id 98e67ed59e1d1-39d9bc66ab9mr26784625a91.3.1789325392699; Sun, 13 Sep 2026 11:49:52 -0700 (PDT) X-Received: by 2002:a17:90b:3dcd:b0:399:ea1:5a82 with SMTP id 98e67ed59e1d1-39d9bc66ab9mr26784562a91.3.1789325392257; Sun, 13 Sep 2026 11:49:52 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.49.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:49:51 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:18 +0530 Subject: [PATCH v4 01/13] dt-bindings: media: qcom,venus: Add context bank subnodes to common schema Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-1-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=6062; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=AiyWfqplixyHhsYEa6qazzHkZE3xEPK1wk4cmDCQzxc=; b=seUnoj2xKMJ+NXtkcDwdorJnyiOhZ5yI5zE511+9J5owCUGD2ScaOoQdrNvNdU70jaB5Gg3oN M3sFFhfxNxEAq+AOdjPKv+18yIpYYKr40BTFC3UFh94ZvCYL9gcO45A X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-GUID: Jb0RQGrHR2LG0h0PvXho87J01D7nOl15 X-Authority-Analysis: v=2.4 cv=Pv4G/AM3 c=1 sm=1 tr=0 ts=6aa6f051 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=weiu3rfF03DHpAy_C5IA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 a=Vxmtnl_E_bksehYqCbjh:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX/5WH+zO9KyA/ MpOIvmwDVkE+VZBmccVqAeC/mcIhX+8HFjvwg7wCfudFtpInNzK2XODZUMZ14VSbC7u8Jx3Jl2v QGVzaq2zbXSwZ+8x0IBzglJV2CPRLHc= X-Proofpoint-ORIG-GUID: Jb0RQGrHR2LG0h0PvXho87J01D7nOl15 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX6n+Rg/9jLv0C SHTp0t47mDg3m/Wzl3b8dQz4qpnDvaFpCyWltHskjHzsvbgFLqIyuNEdvAil7KkmApZfI0GyVXW tClCuSKaehe2G8IVd4LerIucdXagno8CMfKNEhNCF6n/KGUEbNH9nMUIMS8TuXrt4aAo82rJLHq Rm63qE2qVd022iUBIMr6KMI19vv5KjtAfdMnkiRZO7SDQ5QbqTQvpMaSJZzG0CJg1JAA4lETxuQ xXitbvK+pP/WK1/bxMIFSLFni7zP2QgDmSbkJa6As4U3urFgYKxSO+qUz+u1NM4/sMWwcysOrBy y/of/33iaJzWzzgOiLbBgN6Yy98m9zmQMLDLHLnoRT7UQgWI3QGnPiijnKMXqdXfwdr9RuVjKwp RIZ8NkXp+X2KyPUwFwQgGwkZorR/m2nWB6T0iTyH0RWr3Oy1ZoeGton7qu2uRK+nntLNIoxofF8 kJwg6GkrkZ73YFUZMig== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 priorityscore=1501 spamscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 The VPU issues DMA through several SMMU streams, and the hardware does not give every stream the same addressable range. The non-pixel stream cannot address the low 600MB of IOVA space, while the pixel stream can address the full range: +-----------------------------------------------------------+ | non-pixel stream addressable range (600 MB - 3.5 GB) | | 0x25800000 - 0xe0000000 | +-----------------------------------------------------------+ | pixel stream addressable range (0 - 3.5 GB) | | 0x00000000 - 0xe0000000 | +-----------------------------------------------------------+ A single "iommus" property on the video-codec node puts every stream in one IOMMU domain sharing one IOVA allocator, so nothing restricts a non-pixel buffer to avoid 0 to 600MB. Once an allocation lands below that boundary the hardware faults, which shows up as unhandled SMMU page faults and spontaneous reboots: https://gitlab.freedesktop.org/drm/msm/-/work_items/100 Given that the address range restriction is for specific VPU stream, it should be ideally be moved to that stream. To achieve the same, a subset of streams is now represented as subnodes, so that each can be associated with its respective addressable range. The design was discussed and agreed by mainatiners here https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org In the past, this limitation was addressed with an iommu-map approach, with the iris driver dynamically creating the devices. That approach was later concluded to be a hack to avoid having subnodes, and was NAKed by the iommu maintainers. It was discussed in detail here: https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org/ "iommu-ranges" on the subnode describes the *allowed* IOVA range that stream is allowed to use, so the IOVA is allocated from the specified range only. Define all the possible subnodes so as to describe all the VPU hardware iommu interfaces, both secure as well as non secure. address-cells, size-cells and dma-ranges declares the 1:1 DMA translation into the parent. The parent "iommus" is kept as an alternative via "oneOf", so platforms that have not been converted to subnodes still validate. New platforms should use the subnode form. Signed-off-by: Vikash Garodia --- .../bindings/media/qcom,sc7180-venus.yaml | 15 ---- .../bindings/media/qcom,venus-common.yaml | 97 ++++++++++++++++++= ++++ 2 files changed, 97 insertions(+), 15 deletions(-) diff --git a/Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml= b/Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml index b21bed314848480b82153e49602f0b19e08e7335..bfd8b1ad473128c974bce84639c= b0aff59d8c2cc 100644 --- a/Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml +++ b/Documentation/devicetree/bindings/media/qcom,sc7180-venus.yaml @@ -91,21 +91,6 @@ properties: deprecated: true additionalProperties: false =20 - video-firmware: - type: object - additionalProperties: false - - description: | - Firmware subnode is needed when the platform does not - have TrustZone. - - properties: - iommus: - maxItems: 1 - - required: - - iommus - required: - compatible - power-domain-names diff --git a/Documentation/devicetree/bindings/media/qcom,venus-common.yaml= b/Documentation/devicetree/bindings/media/qcom,venus-common.yaml index 59a3fde846d2196ab1e4588eb396012ba6860712..68d5e592a028c5eecde04ce72cd= 5ae6815ba5c82 100644 --- a/Documentation/devicetree/bindings/media/qcom,venus-common.yaml +++ b/Documentation/devicetree/bindings/media/qcom,venus-common.yaml @@ -47,6 +47,93 @@ properties: minItems: 1 maxItems: 4 =20 + '#address-cells': + const: 1 + + '#size-cells': + const: 1 + + dma-ranges: + maxItems: 1 + + non-pixel: + type: object + description: + Context bank for VPU non-pixel buffers, including compressed and int= ernal buffers. + additionalProperties: false + + properties: + iommus: + maxItems: 1 + iommu-ranges: + maxItems: 1 + required: + - iommus + - iommu-ranges + + pixel: + type: object + description: + Context bank for VPU pixel buffers containing uncompressed video dat= a. + additionalProperties: false + + properties: + iommus: + maxItems: 1 + required: + - iommus + + video-firmware: + type: object + description: + Context bank for the VPU firmware processing domain. + additionalProperties: false + + properties: + iommus: + maxItems: 1 + required: + - iommus + + secure-non-pixel: + type: object + description: + Context bank for VPU secure non-pixel buffers. + additionalProperties: false + + properties: + iommus: + maxItems: 1 + iommu-ranges: + maxItems: 1 + required: + - iommus + - iommu-ranges + + secure-pixel: + type: object + description: + Context bank for VPU secure pixel buffers containing uncompressed vi= deo data. + additionalProperties: false + + properties: + iommus: + maxItems: 1 + required: + - iommus + + secure-bitstream: + type: object + description: + Context bank for VPU secure bitstream buffers containing compressed = video data. + additionalProperties: false + + properties: + iommus: + maxItems: 1 + required: + - iommus + required: - reg - clocks @@ -55,4 +142,14 @@ required: - memory-region - power-domains =20 +oneOf: + - required: + - iommus + - required: + - '#address-cells' + - '#size-cells' + - dma-ranges + - non-pixel + - pixel + additionalProperties: true --=20 2.34.1 From nobody Fri Sep 25 11:12:36 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B3953AD50D for ; Sun, 13 Sep 2026 18:50:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325406; cv=none; b=oucAG3EACQrffyUsQDxd/fhVwGXfGicxl/NCg3vsCwh6mZLJdx6K+aUp4jFjHI8S7cK3oPorbJcP18cvGKIPIlXPrfAw6Gj6sQHTgmPyJRXrIGCtWrRxByaE/MPrCn0joNF4YF0Af9ldK2o3wDsvjiUMDa0ikJfd79PRXG9tNKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325406; c=relaxed/simple; bh=qp0eeFSkW9qr12mPAr9R15JuDe58PZTGuiwGGGcfu88=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gVx/Z5lTELh//rICNC87QrWc/fpOZDWb+n/i6gi4uzIcxryV6qQfZfolBvBVYkLI7DHuoXw8ic8oBYebogWLADYTWOdlN3qELQUYIyx8F2tEBcMaKLNExFDBTYVf9bTpnQWir/WjD2T5qgEml2ZzK2Y9N1wyg7b9wXhQYIqaNRc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=m2UDWIFh; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=LYu3bKP4; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="m2UDWIFh"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="LYu3bKP4" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI45vF2982338 for ; Sun, 13 Sep 2026 18:50:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 782d8vA5qKhzXjsmtq848zNPg/gGyTeOCElg/IKXtGs=; b=m2UDWIFhOjm+Id5+ 2aKWySIYLUdIGILBkxQu9OVYcryJbSWq2gLhzcCWIzgkFo7qz2OQxmg39wn/u4Xg V0gpbpSmC1ov/qeiM+Ih1g5Y+deCzCcw4TD+5dF8S9s8FUB2BnxkhCIU4vqnp/Rk Ife+WiOTstQFzn+yHv1W82kJuzejZvhqP/PvtMg6AsJxJ1ElA5Wjl98zlHiHGUJn YnDc4T4FNsZRbpGmZuvUQnb02QPVG6/MkuaO/tKA1Gos2S+sZj5qW4sXjeYwveuf +Kz53DzdBUvhQekUvPoMnh+iRje8zDhsq81bBCS4APoJTLEgH2VAECY2Ds1xC8wz 5cbFiw== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9dkxee-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:50:02 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-398d0010cfaso5173921a91.3 for ; Sun, 13 Sep 2026 11:50:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325402; x=1789930202; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=782d8vA5qKhzXjsmtq848zNPg/gGyTeOCElg/IKXtGs=; b=LYu3bKP4y++/pibnEF+TqGVojZG/AKKygb33KACLBgabiTzBbvlOiVAmQBIRQy/Ijy mWJG4pJmtk1m6PoAM2+UcQ41r7xr7HbF1jK1+NroyaQSz90m439xgdYzAVycYpHPl2nH PlQHE1CElBmXUltRUU6gX9XPf38kY+Kzrlqazm05Gp0EAaQ7cyjx4eg9KYt5YOhe5zYQ ut38xUAejq7eUHFthkr/7Pxm6ipri+YhzmZIlzJbKhgFZZ+hRsWqAU4NUuN8OEOWCFlv 0KBxgqNK0rT70B/EdpYhiVy+htG+4A/WKv1fWT5Za3A5KiXr0NdnH7CrI/wgqsZk/nXK k9bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325402; x=1789930202; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=782d8vA5qKhzXjsmtq848zNPg/gGyTeOCElg/IKXtGs=; b=kw2DsDaihDtUzJ38gkECZPqD2dCwmlOnI6uvDEr1HZ8Ds3CCiOLN/zkGqS1q9y+PXB BfXZ+Ynxqf18YQsmtIpurhvKqGIfQ8p3WpJZOUfy/IgPiILr6cUexL/BqtTP5w8u8TRX m0Lv6BYK+lit7gh+yVXUIyV0qgjr7upRYKrAklaqnA9xxh/BS49sGj+mqqkFwMIVlpmv o+qqqbYuzipX91ZNcSE3WzlCv+hq2IFsORRmc9+1fte0977bdG1iKxWCwukDAipO3Ffe xubOs0oEJjsrqXKJphbrKqbXoYltl3+25RLmsVtYu9UMrdsXcpM9qYzAByoU32mr7Mw5 H6wA== X-Forwarded-Encrypted: i=1; AKwUvBxhVtfSz0tAt8kcvIQHB2RSbTgopW9o+0fCxRQFTufqFpV00Rczt9E2YlSrzAGZtUl8+9LCdIrlXulFnU4=@vger.kernel.org X-Gm-Message-State: AFuF++mFqaJXBf8b1w2g4gS7M38XE2qTgf4Dm20sIzcEh36V/u7vM3TO 6M/MIOro1uP3TlPAbddV+gnS11+Wg+neR1dC+YPVve26xSza99YHD/tAHzbdzVQ282ipcPIqtTw IZpg8wsIku2FPKlKG5d5pLBIXkhuQvqPe4cvNdQmjcf5AuFLLq8vZNJTF0hgy6NDJXow= X-Gm-Gg: AYBFou3S+s0tGEEEtTEp/OkOLcyO/Zc7f3UVk4TSW7UUxZtHKJ2Z8mGMtSiapBshPzs TXL7KkgCQp7/bh6PoiRzrjS36Lfz5UfDxmIbyzDB6wqBdoEIUoOwA9GO/IaZMdH8y9aEFsd+h/L /g+gSHi//djgR08u9mSSFQFGPXffz2V2oaPOHotEunKNxE5zh4WKgG+3B6mbPjzfna5E3jmjU9P BcgOxfxFTcH2ZxGJiCZ8YgRIL4dhHL2aqs1PJNkyGguieVA0wF4g0UkkOjvA/i4tag7NS9e+00W cM4dC9sia4/OLBPBUDlIRvkQ72zSfYA79B1lUmidufqlxdM1+7CFuKhFSiaUe2GPqrrOCWbLkZP w4Yjqa5yp8IDoZ5zwt+CIGDThh4MZHPMc97Y= X-Received: by 2002:a17:90b:57e8:b0:398:dcfe:968e with SMTP id 98e67ed59e1d1-39d9c22762emr29007933a91.20.1789325401476; Sun, 13 Sep 2026 11:50:01 -0700 (PDT) X-Received: by 2002:a17:90b:57e8:b0:398:dcfe:968e with SMTP id 98e67ed59e1d1-39d9c22762emr29007860a91.20.1789325401043; Sun, 13 Sep 2026 11:50:01 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:50:00 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:19 +0530 Subject: [PATCH v4 02/13] dt-bindings: media: qcom,sm8550-iris: Add context bank subnodes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-2-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=3706; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=qp0eeFSkW9qr12mPAr9R15JuDe58PZTGuiwGGGcfu88=; b=e3q/gARLkobKSIVL8IEYb1/H4SLP6nioe3uupeM+r9vAHJmujI9Vmw1i4Pn5seRY2EcbvlGKO 0wrG7qrDmuoCw/T0vRWi1Szt39vWGCTfHJi+9qp4upYz8V7+goTvEiN X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-GUID: mGcWz7r0giylF5ICabmsNXJFVUz0xOI8 X-Proofpoint-ORIG-GUID: mGcWz7r0giylF5ICabmsNXJFVUz0xOI8 X-Authority-Analysis: v=2.4 cv=NelzRGD4 c=1 sm=1 tr=0 ts=6aa6f05a cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 a=Vxmtnl_E_bksehYqCbjh:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX09MFyxyKFjul lNtDljzHep52SNVZupIg+sCECF3d2P99j+s1McGx2BZQLbw6ceNCS8IQ+xFOwBo1bEqE0rpo2/T QvWC6oFjyMSIbryvZ6FvU82Q/wsx2a8= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX+Rgv+4Dlwz7b T74LhaC5iybZav48SBexeUPb85RgE8A03xff6KohfwYSQ690eyVHLBGDYATuHD2FuVpjN8JOevE gg1HaCdwH5gkATJDKt6vmmyo3dbg2EB3YpdvsYAdo+5vaCm1lIKhmWy2VSSCDcFtGgYWniozM0R oWcQFoMQDVrGjizE7iS54fO4ikM7LdybWIzI+WaH7HBZ1PuD7/5ZK9TJ5ZaSUzHSDwfRT03MOug aClxRxC7fsDIucEpZWzmuwEAOJYoVcR1yybVD9bt3Eje28QTX2Ea6IBMZwCIlLmiKIH89er1zFH UkCOk7HJquMhxrKAGLmSersxO8GOE4DduQCzboGDq7Fb2zA9qL7PVGVawXoBCD0AgFeBZWwXyrd 3d1eUS7BH77KvNf4E7JeKKmJaaEPxZyQxpmrkLTT5AalMWPKrQ6nFBDfXjF92lgBjvHop2FDrda rpnA2VdtCTkirIJhd7w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 spamscore=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 The VPU issues DMA through several SMMU streams, and the hardware does not give every stream the same addressable range. The non-pixel stream cannot address the low 600MB of IOVA space, while the pixel stream can address the full range: +-----------------------------------------------------------+ | non-pixel stream addressable range (600 MB - 3.5 GB) | | 0x25800000 - 0xe0000000 | +-----------------------------------------------------------+ | pixel stream addressable range (0 - 3.5 GB) | | 0x00000000 - 0xe0000000 | +-----------------------------------------------------------+ A single "iommus" property on the video-codec node puts every stream in one IOMMU domain sharing one IOVA allocator, so nothing restricts a non-pixel buffer to avoid 0 to 600MB. Once an allocation lands below that boundary the hardware faults, which shows up as unhandled SMMU page faults and spontaneous reboots: https://gitlab.freedesktop.org/drm/msm/-/work_items/100 Given that the address range restriction is for specific VPU stream, it should be ideally be moved to that stream. To achieve the same, a subset of streams is now represented as subnodes, so that each can be associated with its respective addressable range. The design was discussed and agreed by mainatiners here https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org In the past, this limitation was addressed with an iommu-map approach, with the iris driver dynamically creating the devices. That approach was later concluded to be a hack to avoid having subnodes, and was NAKed by the iommu maintainers. It was discussed in detail here: https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org/ Update example to the subnode form. Doing so, it picks up the supporting properties needed on the video-codec node, address-cells, size-cells and dma-ranges to declare 1:1 DMA translation into the parent. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- .../devicetree/bindings/media/qcom,sm8550-iris.yaml | 17 +++++++++++++= +--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml = b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml index 0400ca1bff05dcef6b742c3fbf77e38adca9f280..6ee9d23554cffb30c92017ef99d= e15c2493455ac 100644 --- a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml +++ b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml @@ -98,10 +98,10 @@ required: - interconnect-names - resets - reset-names - - iommus - dma-coherent =20 allOf: + - $ref: qcom,venus-common.yaml# - if: properties: compatible: @@ -177,12 +177,23 @@ examples: resets =3D <&gcc GCC_VIDEO_AXI0_CLK_ARES>; reset-names =3D "bus"; =20 - iommus =3D <&apps_smmu 0x1940 0x0000>, - <&apps_smmu 0x1947 0x0000>; dma-coherent; =20 operating-points-v2 =3D <&iris_opp_table>; =20 + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0xe0000000>; + + non-pixel { + iommus =3D <&apps_smmu 0x1940 0x0>; + iommu-ranges =3D <0x25800000 0xba800000>; + }; + + pixel { + iommus =3D <&apps_smmu 0x1947 0x0>; + }; + iris_opp_table: opp-table { compatible =3D "operating-points-v2"; =20 --=20 2.34.1 From nobody Fri Sep 25 11:12:36 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DD023ECBE5 for ; Sun, 13 Sep 2026 18:50:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325418; cv=none; b=EAFN0EoJxhgpYwx3WrjKdIKfu1Lu6lfHxzcFMDVH42jGtYe0rL9HOKnPrCdTFAZwufRl/1yRyo1gG533REjqvvfZV7GhBQMCFfCZ+bNcD1qFX2lCoRXKwVs3nCHqa8B6MnK5Nmh8C+tKnhaflfbTFUQPwi/llEg2OTY8wZsfqmk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325418; c=relaxed/simple; bh=Qa2Zp3mtOCmlv43McNFjBc1+0AJv4pRvdWQWwZsWNKA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lozA4iwu/W8kFUpcd8J1leyrFAT5Pmwvo1JdQ/52EswSswGH7ZJqrv+SwTW3gXk70Eh6C8T7OEaAbG7FlfMoIeiH64qCtFmZpdi9UxZ7F3BBlO0/o0GLjWxQpefciuX8ZC3qRta3ZBGPYdwxzA9hQu6qUka72z3YNKYvFZOnHpI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=f6fqQAGT; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bt1nf0qE; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="f6fqQAGT"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bt1nf0qE" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI2mhH2614328 for ; Sun, 13 Sep 2026 18:50:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= aDXJrtGXbNQEY/5xdA10m94DDaprg9EVDMwPUbR8BWA=; b=f6fqQAGTN7OMA4qJ xIxk8mrcknnfqkJ6jQgWFkuDq5UyxcQT6rlGPxYm68EnESAArus4TYKzM/D/Ac6C NEEviq37sA0YNltC/INEqZSPOzvhTF28gMS5iNqyG0h8iYFF89XJdjIOGlli4N5I +uLm+X4UbPkGHHy251nozwXOX1hC7asPstwkuDe6Tq6M1bDykFANehMx54gRGD5k D5bzZw7Yprt/ODeOmgntKpF/OIrFcczaunlJB4scW8F+YBGLLD7WhAmKptTB9O30 dfrkMh3bfv/5f1kIEqTizxZWwXLNM+vDcwlAioxZm8yIsETB5iXhLUjZ8k2+y+KW gbgu3w== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9cbwbu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:50:15 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2d94f086fedso34318675ad.1 for ; Sun, 13 Sep 2026 11:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325410; x=1789930210; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=aDXJrtGXbNQEY/5xdA10m94DDaprg9EVDMwPUbR8BWA=; b=bt1nf0qEy8lAyA6FNvO7euu1VCdFSNmmBbF90cfkTZZOwYu05xfb0qKUA+tRN4SysF wKln+0n2T6r8S7NRFMq86aORIkhvvdAsG7K93sfWSsmxZHCdIfAV7yyD9/bNGX+d2c+U pHoqzDSYovioDF3zM8KZLg8V8X7qbed7hc3nr2IvxZ7iB/hSEVWgZI+sGRMFRgo1ca8q nNPCKdlx/sfYTQOwLJ3fScx1lrHMX60TnLkgbR3mqx2quxZD9VM92eKeykPXaXnPaWkO FH72NOPfrPbWkGU8xnxupqZr3e8/2d1yqR1/b7Fqt+AAE5CO6obVGASg542iunNC8Htw pHSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325410; x=1789930210; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=aDXJrtGXbNQEY/5xdA10m94DDaprg9EVDMwPUbR8BWA=; b=EaHDYtOVhZKiyXjvy1lWUAYpuEm5HbrfBh1jdm1z1bhCHxD8fbgT/a5ygjVymzVgpd wSzn2pZFVrybr7hp5n5D9axrMzisfn+KQX628RrvDOFST6uVY4l9jKkWU0zSQw5BRcGP tEMCx8Nfizewn6PSEBeBgMQzt4r9NfDF/qcFoL2oc46YQQ0InCtpnPsNP/XHnVRR9LRi RCnIt4TWZ/nWjNl2sQl8rGadSaS5vSm+IUIx09DopwFH0aRsLFY875XSBERAUj/BwxD+ jXuAoNVvYijfZ5niBGoTDW1iNzf2QH4sLdTqW3yYCBNLhpr11PlgglJ3msEjJ/V62qSN dGtQ== X-Forwarded-Encrypted: i=1; AKwUvBzsOUSEvsPNkGTr/yVrVmMy4jSdgYzIAEqH5/+k03nE7doIBk2QF93gtwm7LOTD7d9xNoO7A7dyvFEJExQ=@vger.kernel.org X-Gm-Message-State: AFuF++lwrf2UZVyWUy1PcgvCdU5JIL56i4+mYLE8uZOuXReH2ZWFEpdE 0DfjRroN8L23idsB3L048tyHDxGMDPfaz1vjYCyKIA6ueUGExazIua8/xvpXrVRWV/E/E5MIDO8 enTZf2JM0nYvlahhhBBpT4E2PdHlVdfWmiq0qp3kCVzbbJl40jo6IRjIYdacQWnSUjdA= X-Gm-Gg: AYBFou3SzZDB63tQmTh3TF8SZE1Myo9UvFhJaNlXHG3fKMWe6BVewgeNJlTQvH3TOSs tyLqEJKWtBrEHmKpkpPQg8xNGNTUw7di7qQo6xqp+isw1zMlr2dgI/7597Ac+EWHtU9lnzDtDeb LA9gpNNHQD9VDMGBAkDo8rHfsqz5tzZN6p8vwJ3yt+7CV607JBtETbsi/TheCkoaOAz1whUzKLu eXwdivGW+VVzpIp6NnQ9KnpZxK+T3GJ9R9Cxlwv6AGjD8r+Egfxj00SvcanA5Qhgmysf5zXItYS N8xeto2bpeX0bJ3hhJF1+RwmO5TfTIx1h1tsI/dYm18qQ0emTQ98PqdNrhS3+PZrlYfZCwOQ0Xb D9njSOrYFTiua/Xb+1HOUg7j+YjBxHgVepfE= X-Received: by 2002:a17:903:2985:b0:2da:e67a:87d4 with SMTP id d9443c01a7336-2dd2a35dabamr255818745ad.19.1789325409440; Sun, 13 Sep 2026 11:50:09 -0700 (PDT) X-Received: by 2002:a17:903:2985:b0:2da:e67a:87d4 with SMTP id d9443c01a7336-2dd2a35dabamr255818375ad.19.1789325409013; Sun, 13 Sep 2026 11:50:09 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:50:08 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:20 +0530 Subject: [PATCH v4 03/13] dt-bindings: media: qcom,sm8750-iris: Add context bank subnodes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-3-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=3817; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=Qa2Zp3mtOCmlv43McNFjBc1+0AJv4pRvdWQWwZsWNKA=; b=xKgMcGQDCsIW7jwgLM4Vnl4Qip4e1w3iS81Ohhu+3VzMXymIU74xzNdhZBAkJA7C6TXdaknjW J5oxiSK7hAiDI3mR8Qncd3xzM1hf1Q/GSpQx6fmrXThtgLeHH1qS4eD X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Authority-Analysis: v=2.4 cv=e+mT2qp/ c=1 sm=1 tr=0 ts=6aa6f067 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 a=Vxmtnl_E_bksehYqCbjh:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX/shMATmed3Xo QMmRtAJyl6ttXaC5afGMEpuL9hC7CxHmnyw7yrPTUqxht9P8emN/fYNhBjiIykmEiHusvYrQpMV X5gmtQxnMbG+Xi/g4mFASjSXZd2rszw= X-Proofpoint-ORIG-GUID: RBGA6NnR4GYEHpoeij6UO8muSYkK5K-k X-Proofpoint-GUID: RBGA6NnR4GYEHpoeij6UO8muSYkK5K-k X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX7T8VOuXLpW5P 4s6DD7je99KPriXzO78xoj8l2QMbbIgS3YxUzDWaHyahpGNFru1JoNY+fzz6Ko/w29dUxXgUg38 AoqssAuyrUxhXlYE0tEj/OAwQ9FfEU0sZY6zsRR0ERxImSWgHSYddpaiO68jddb++yApd/kZpbC /EcR4oBIdZdQNVJ0rqyvAZh0Xl9dr0o+wqJ+MIIdHHSvcLTZ77kcyszRzm+czHV2viWgfr/0VT8 gXqpjWyxrnNg+BG9q2vAyD66wdDPCYNK5Qw9Rev2u/BYLP/QPMba/5W77iccCc7R75qAT/qlIKd Hz1xq53Jq35jt0ck6FNZZa4eUPPF2cYqcs90grlBfFbqr9GHlXWN2ensOyKwTRYwLUfhfLuqBFM 0+hdbYIobK0GEiJi2QjWko8NjeAzVULFOQT5t/SJcWoNlRH9hONkf10hjohKI7VHuHnAUSdirta hhWuQlg/HBlIPBzGuow== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1015 phishscore=0 impostorscore=0 spamscore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 The VPU issues DMA through several SMMU streams, and the hardware does not give every stream the same addressable range. The non-pixel stream cannot address the low 600MB of IOVA space, while the pixel stream can address the full range: +-----------------------------------------------------------+ | non-pixel stream addressable range (600 MB - 3.5 GB) | | 0x25800000 - 0xe0000000 | +-----------------------------------------------------------+ | pixel stream addressable range (0 - 3.5 GB) | | 0x00000000 - 0xe0000000 | +-----------------------------------------------------------+ A single "iommus" property on the video-codec node puts every stream in one IOMMU domain sharing one IOVA allocator, so nothing restricts a non-pixel buffer to avoid 0 to 600MB. Once an allocation lands below that boundary the hardware faults, which shows up as unhandled SMMU page faults and spontaneous reboots: https://gitlab.freedesktop.org/drm/msm/-/work_items/100 Given that the address range restriction is for specific VPU stream, it should be ideally be moved to that stream. To achieve the same, a subset of streams is now represented as subnodes, so that each can be associated with its respective addressable range. The design was discussed and agreed by mainatiners here https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org In the past, this limitation was addressed with an iommu-map approach, with the iris driver dynamically creating the devices. That approach was later concluded to be a hack to avoid having subnodes, and was NAKed by the iommu maintainers. It was discussed in detail here: https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org/ Update example to the subnode form. Doing so, it picks up the supporting properties needed on the video-codec node, address-cells, size-cells and dma-ranges to declare 1:1 DMA translation into the parent. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- .../devicetree/bindings/media/qcom,sm8750-iris.yaml | 16 ++++++++++++= +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/media/qcom,sm8750-iris.yaml = b/Documentation/devicetree/bindings/media/qcom,sm8750-iris.yaml index c42d3470bdac796cc878090e65becf6b62bd80ca..b6d5ded1aae6a1a6836c2c24b1d= ae548cdc6f9d2 100644 --- a/Documentation/devicetree/bindings/media/qcom,sm8750-iris.yaml +++ b/Documentation/devicetree/bindings/media/qcom,sm8750-iris.yaml @@ -72,7 +72,6 @@ required: - dma-coherent - interconnects - interconnect-names - - iommus - power-domain-names - resets - reset-names @@ -110,8 +109,6 @@ examples: "vcodec0_core_freerun"; =20 dma-coherent; - iommus =3D <&apps_smmu 0x1940 0>, - <&apps_smmu 0x1947 0>; =20 interconnects =3D <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ACTIVE_= ONLY &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_O= NLY>, @@ -144,6 +141,19 @@ examples: "core", "vcodec0_core"; =20 + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0xe0000000>; + + non-pixel { + iommus =3D <&apps_smmu 0x1940 0x0>; + iommu-ranges =3D <0x25800000 0xba800000>; + }; + + pixel { + iommus =3D <&apps_smmu 0x1947 0x0>; + }; + iris_opp_table: opp-table { compatible =3D "operating-points-v2"; =20 --=20 2.34.1 From nobody Fri Sep 25 11:12:36 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 403203F7A9B for ; Sun, 13 Sep 2026 18:50:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325423; cv=none; b=lCNk7Xs2yzmPpzsAu8PozaQv4QedC/BsjydenYODL6i91S9U0idz4mUqloiMJ211vgLsivYDtJ+qT6WJRMlhp1hoQt81buO79NxHPwzgRAbR6DGbxLxhDtjqDyfH8Fg6Uwp/rqvgAPuIUscs0P2tdfGJ3gAiNiSaICeJ52VEnu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325423; c=relaxed/simple; bh=SotE3v19uTlQ096YvT10NlnX7cpT6wjYoiC6wIywFc0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ocg161qJvtrAQDDJqmnN47IzAF/LcExgPsHALnCqsa2UjuCU7SgWeXBOnp3NMFHlVPu0NyWdDObTGGZuozKPsDIpfWqA5NqIt7HmwgDDNDlR54qvY0p4jm6PL1z/04s2rMRqkHaEYeC78jcipldptP9I1kOIXK8cfXddNn6u9C8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=KmBG+UUg; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=cDPCjQ4C; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="KmBG+UUg"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cDPCjQ4C" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI2kbK1192771 for ; Sun, 13 Sep 2026 18:50:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= pWuI/WNDQwf1Ze/N0XRHCYa4glKdApgbQFIkuNsVpTE=; b=KmBG+UUgdcFiuabQ GKhxDBBEnBnPLu98dcfyTXu1y/7NMSyjyMTvBy/JnW7xpI7z3ru87phgSvg77JSE UPiNHiwWNENgFZ06qNFG9RK6HFUrywlmcjzC9iLGRLes2HDPklT1793y0Yem2HnA eNcM9s1EyKUBMKUae10DKXu50qUrfi5xx8bMu++BC07aVtDbsEOX6b3R+XXB3yGy yKoc4+PZgtBnD4LWNuNSU6I6NUItQGEAwVgnL2JvSCB+NhBCEiQNi6w4ytOxPps4 kKIAGjHzK76/MZW8d0t7Sh89nuYR07z96mVF+nVPXdiQQYrUwhrsB1qVnRnORyxX i7rurg== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmywh3t84-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:50:18 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-398fe469aa0so4718578a91.2 for ; Sun, 13 Sep 2026 11:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325417; x=1789930217; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=pWuI/WNDQwf1Ze/N0XRHCYa4glKdApgbQFIkuNsVpTE=; b=cDPCjQ4CB9q+RyLsp8MmCgrk8WClcxLy60cYN028HtcE54YfwIrtRf4y5HPtWWByUq RFQltM+pVdfX/WASI4L6urni1bs+dRPjVAfLoygaiGdPCaayshIFjzKhQa03fzOC5OWt UXfwaN2KB6ubREnrbb/Rb2S/bYshXUsv+ehXsxh6XdIDH5zD0fs/vbqDOfHGKbDVGp4m BgxlAUGXQENvBMdbASvGynKnfo8lzqUr4+wGar0cZf7Z6upHe/U3cr0T3goI4GVN/5hv puEefdoZBM7C+Ho7xoOLiiiFeLi54FW5CdJbaDqrKCxlpDTsMaOSH2/W9EdOfQDDVwf4 GCgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325417; x=1789930217; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=pWuI/WNDQwf1Ze/N0XRHCYa4glKdApgbQFIkuNsVpTE=; b=lRR/l0BGqqPnVkwKZAdDDW6wC1OlfZYVrn1EeyHu+R/VjwTDRz5TJtvM+mHtigRE0s 7DjbxcoljG9NqA0qXeN5GQGV+35ap1i0pqhhPob5qX1tv0KglpSzfjGUQvgYLFjoIHaH LvtGP/PpGTgBXM3g84mdcM8MXaa+6nSiOtOEhblnJe0GJMYpgfajiqkg7WL3jQO+VUTp aStxYIhBCHzahoxvRcRI9BjrzPC+xlZgbR4WMX2lg4C/1Yqy+lBqiOZxjhr7qFS0wWzU jDePbG8Rl2vaAxuO/A4Ldbao9ypGQP1BvqfI2DJs+GA3Lirpo4plHLrinzQOLmDoGTg4 u9SA== X-Forwarded-Encrypted: i=1; AKwUvBxvStmvkX1AW+dkfGp52okfnaVvoW+lV3ti8EWeW2dKr8JMpJ6Z0cdGch/kAp5+IYDBNgbzv9sGyhSmJkc=@vger.kernel.org X-Gm-Message-State: AFuF++lZFWwr3EERRwa48wloMGAHrKvxtMYaml9LRWG5BPtw4Ks+DP3L FTtv6c7oK8YHxaGRUeh7LFn8uuWD8oZ5Ynizd7nDwX74JffdOjwpir0j4x1Rz9zdASdtNmhKPnj 2pbTqB8TEaNx0xQfLZx4jL1V1v1V9ZyXxCGdgobH/caeNF0JbzJ9zSo+0JMVun2b0ltA= X-Gm-Gg: AYBFou2GjUsrm2QDJYMnkWFiJ8dstcz3tadqe0heOwS4v80C2GO6104jOYSFKIgT7n3 8Zhjult2x3aPJuL6icEO5Yk9efTDSu7hQtShRjffI2RuI+DZ1EO6tn03LDZ8SW2lPzgAODMzVJY Fqr5bkOSe9b5WWoaeCdgKyLXNhplUgwcReQrsCywwjgQMFf2Er6sG/yWIpff7fnbtna9CKUCSfY UKXZtqnRogVb9LaB+jffSt0c945TiF30R/6kqXwNX+Fcy8wt/tFzYvrk5a5ymnj3UJIONRpvtHt P2m0JmZSZfGJqwsiNfsw2+8jOZFJYMXOze88jLgPshJxwge6rZ+rF657tCLsRjI+rElU3UYNYs1 5YdcNedpEVjWVnCjZeAHci6HVhyPcpYFsKKM= X-Received: by 2002:a17:90b:134f:b0:399:1b08:28de with SMTP id 98e67ed59e1d1-39d9beb0be4mr26511006a91.7.1789325417400; Sun, 13 Sep 2026 11:50:17 -0700 (PDT) X-Received: by 2002:a17:90b:134f:b0:399:1b08:28de with SMTP id 98e67ed59e1d1-39d9beb0be4mr26510935a91.7.1789325416949; Sun, 13 Sep 2026 11:50:16 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.50.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:50:16 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:21 +0530 Subject: [PATCH v4 04/13] iommu: of_iommu: Add support for "iommu-ranges" on a device node Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-4-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=5912; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=SotE3v19uTlQ096YvT10NlnX7cpT6wjYoiC6wIywFc0=; b=KbtO+WjJsBKGHbk8Ef8lwgXtsXrFvcv2kA44jhpSPiwxZ0Z0YO5OtIGIfpNMFWsoas1fLZa3j /Kq8XjxatuDDbsIPxYDiSDC8a+z5pA1D5/b1pStcgy+Ewlbf9DV0H17 X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-GUID: 3fNGvWLMxUt2vfWt5m9_WhqBX-pS3W9z X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX9z03Kisymb98 +RNp05Pci3BnUzX1TEur5+9EyQnYsPeaE0d9x+Wa2vNxA5eZBC0/LMb/Dl77h/lx1B9bkWUGZHm n8ItVncZSWAbdbkMLd/4TfPOQpaoru73UsCAcY+uyJeuhNesUHrQMf94l49xmRrnq7ZUTpuoB0Y fi/b869UdH3kdPjbYrdL0OsgIbe/rwLPjyl+mNywGI9pbXQ6Uzd/O38uXN96LFcOpMGvfeTwGuW TjhPcc2Y/S1UFelf8T8WI5qTNcjFMPkXs4y/XaNOx3hr3N23m5MvxTE6XH1HMG3S2FFBWWvKExN Mir9ZWRVwpBE0mworlN4IAA4PnStWDuG+HN0btj3mMUgvQM9WUp+4x8TQpf1R34nWwxsD6aLB28 RBbyFlk+fVeps0gkY8Qh2z2FmSGHzAF83EDYOPT9z7WB04I2aUf1X+wRTTgh7hD7pmlr3DjqO/X 5SRi2xddCxaP/1Q6FVQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX9RmGQNU8E2U2 5+6xkt+vmsLUp0YRYXHD4I2RJ/bZ3PzVX/Kx7mOl5ajr8HSu9DJHNstKoYgTbyfHL1KSL6bGzCi d6gI6j0FofXAkVWWJO1kbO5kVyy5lJQ= X-Proofpoint-ORIG-GUID: 3fNGvWLMxUt2vfWt5m9_WhqBX-pS3W9z X-Authority-Analysis: v=2.4 cv=PsUG/AM3 c=1 sm=1 tr=0 ts=6aa6f06a cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=5d7BNXMnqyCmxenBVOsA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 Reserving an IOVA address using "iommu-addresses" requires it to be placed in the reserved-memory node. But when "iommu-addresses" is the only property being described and there is no backing "reg" (i.e. no actual reserved system memory), it does not really belong under /reserved-memory. A device IOVA range is specific to its own address space, and does not describe the system physical memory to make it qualify under reserved-memory. Given this, place "iommu-addresses" inside reserved-memory only when it is paired with a "reg", otherwise, define it within the device own node. It was discussed here: https://lore.kernel.org/all/662f7093-fb0a-4564-9ca0-98e03e68ba9a@kernel.org Existing "iommu-addresses" property expects a phandle, which does not make sense when the property is defined within the device node. Introduce a new property, "iommu-ranges", to specify the device specific IOVA ranges when there is no backing "reg". Suggested-by: Rob Herring Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- drivers/iommu/of_iommu.c | 115 +++++++++++++++++++++++++++++++++++++++++++= +--- 1 file changed, 108 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index a18bb60f6f3dfdba853b6e16dd2a8616f6a731c7..baf74db838d6bc45df2b36c49eb= 47eeca21b4b7b 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -190,6 +190,98 @@ iommu_resv_region_get_type(struct device *dev, return IOMMU_RESV_RESERVED; } =20 +/** + * of_iommu_derive_resv_regions - derive reserved regions which + * are outside of iommu-ranges + * @dev: device for which to get reserved regions + * @list: reserved region list + * + * A device can describe its own usable IOVA ranges directly on its node + * via "iommu-ranges". Everything not under those ranges is derived + * as a reserved region so the IOMMU allocator won't use it. Entries may + * appear in any order in the property. + */ +static void of_iommu_derive_resv_regions(struct device *dev, struct list_h= ead *list) +{ + struct of_iommu_range { + struct list_head node; + phys_addr_t start; + phys_addr_t end; + } *pos, *new, *next_range; + int size, prot =3D IOMMU_READ | IOMMU_WRITE; + struct iommu_resv_region *region; + const __be32 *maps, *end; + phys_addr_t next =3D 0; + LIST_HEAD(ranges); + + maps =3D of_get_property(dev->of_node, "iommu-ranges", &size); + if (!maps) + return; + + end =3D maps + size / sizeof(__be32); + + while (maps < end) { + phys_addr_t iova; + size_t length; + + maps =3D of_translate_dma_region(dev->of_node, maps, &iova, &length); + if (!maps) { + dev_err(dev, "%pOF: failed to parse iommu-ranges\n", + dev->of_node); + break; + } + + if (!length) + continue; + + if (iova + length < iova) { + dev_err(dev, "%pOF: iommu-ranges overflows address space\n", + dev->of_node); + continue; + } + + list_for_each_entry(pos, &ranges, node) + if (pos->start > iova) + break; + + new =3D kmalloc_obj(*new); + if (!new) + continue; + + new->start =3D iova; + new->end =3D iova + length; + list_add_tail(&new->node, &pos->node); + } + + if (list_empty(&ranges)) + return; + + if (of_dma_is_coherent(dev->of_node)) + prot |=3D IOMMU_CACHE; + + list_for_each_entry_safe(pos, next_range, &ranges, node) { + if (pos->start > next) { + region =3D iommu_alloc_resv_region(next, pos->start - next, prot, + IOMMU_RESV_RESERVED, GFP_KERNEL); + if (region) + list_add_tail(®ion->list, list); + } + if (pos->end > next || !pos->end) + next =3D pos->end; + + list_del(&pos->node); + kfree(pos); + } + + if (!next) + return; + + region =3D iommu_alloc_resv_region(next, ~(phys_addr_t)0 - next + 1, + prot, IOMMU_RESV_RESERVED, GFP_KERNEL); + if (region) + list_add_tail(®ion->list, list); +} + /** * of_iommu_get_resv_regions - reserved region driver helper for device tr= ee * @dev: device for which to get reserved regions @@ -214,10 +306,14 @@ void of_iommu_get_resv_regions(struct device *dev, st= ruct list_head *list) =20 memset(&phys, 0, sizeof(phys)); =20 + maps =3D of_get_property(it.node, "iommu-addresses", &size); + if (!maps) + continue; + /* - * The "reg" property is optional and can be omitted by reserved-memory = regions - * that represent reservations in the IOVA space, which are regions that= should - * not be mapped. + * "iommu-addresses" must be used in combination with a "reg" that provi= des + * the physical address and size of this memory region, for an identity = 1:1 + * IOVA mapping to that physical memory. */ if (of_property_present(it.node, "reg")) { err =3D of_address_to_resource(it.node, 0, &phys); @@ -226,11 +322,11 @@ void of_iommu_get_resv_regions(struct device *dev, st= ruct list_head *list) it.node, err); continue; } - } - - maps =3D of_get_property(it.node, "iommu-addresses", &size); - if (!maps) + } else { + dev_err(dev, "%pOF: iommu-addresses requires a reg property\n", + it.node); continue; + } =20 end =3D maps + size / sizeof(__be32); =20 @@ -258,6 +354,9 @@ void of_iommu_get_resv_regions(struct device *dev, stru= ct list_head *list) } type =3D iommu_resv_region_get_type(dev, &phys, iova, length); =20 + if (type !=3D IOMMU_RESV_DIRECT) + continue; + region =3D iommu_alloc_resv_region(iova, length, prot, type, GFP_KERNEL); if (region) @@ -265,6 +364,8 @@ void of_iommu_get_resv_regions(struct device *dev, stru= ct list_head *list) } } } + + of_iommu_derive_resv_regions(dev, list); #endif } EXPORT_SYMBOL(of_iommu_get_resv_regions); --=20 2.34.1 From nobody Fri Sep 25 11:12:36 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E516B3FFF9D for ; Sun, 13 Sep 2026 18:50:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325428; cv=none; b=a/4MADA35p4kGyo/IbRnyNCucpwofEuocs8sneYd6mOuBavvNAwQj/Vsf6b+Tu/iiZWwvFJSrYEy0wX4sLGSIuAzNUbnunUkZsY5MNe1v+kMluGWkXQPRseVZ8lqmhTbpq8HMSfd7ILHY4PY7vb+emhWyX+4u6CbDBSowq7fIWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325428; c=relaxed/simple; bh=foRnImGSZ75lU1r/edBBVgqmVHY1e0szEa/Z/AKAvQU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lEVzGOq9SbZc8SGVSaXjPwakvBmXevEWvz/JWu89Qkdxlzxwx5PB2P5Q0VZG6DL7D+lW+hPDrelflGjbAxEKQSVwDT+RiVCA2BhB8FOq2Ae6m7fXajc5mz17d3j6B8N+0o+5QJyzMMf6Y9NpBJiVpLF0ZxlV/t4qavxM4CILCAg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=MGBdtJNP; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=TI/cIjSA; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="MGBdtJNP"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="TI/cIjSA" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI2tbI1192990 for ; Sun, 13 Sep 2026 18:50:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= dbz2UkA+ppLqVOobr/nxngPFs17FSqKR9v4iZOMb5x0=; b=MGBdtJNPFvOe1AtS 12hXAUcOzZBXY4Qyc1T/pshHpIljnYwW7/AWZ2OF/9UEKWzLFzmkBQn4FILS9QiM SUc4QnkKc37RGyJKKIKtSPDmZlrHkaQlydodVi7pNt6+4L4D12ehiFV+2atxC1gb p9YqRZH29zyrNtDZKabbLy++r/S/obfxFBINh/QIoeSkdOx16/VEb43RibLzAzS4 mH38pAdz9WuacmhcWXT4M6Nkmdv7unvBxXowcgWeaEGWP3TYvpTkQVAL7ft5JSVF eM8/P9KNb/N9MfuPudYSDh2d8r3fCfoH78+2CBhfz+JbCe+J8FwBFH7f7T/XK/GQ E6FqDA== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmywh3t8a-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:50:26 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-cc1cade6b71so2137437a12.0 for ; Sun, 13 Sep 2026 11:50:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325425; x=1789930225; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=dbz2UkA+ppLqVOobr/nxngPFs17FSqKR9v4iZOMb5x0=; b=TI/cIjSA4D7TbmH0CK6X57qJxkEZi8811a/PIsWeXmgCpFRfJRLF4FelzTkS9a/EVw Hd2DdwJz/ByKVSJYNOFF0a+CE3ShTpHJNvUKBuZ5QG3r+8S6LOOMpUeyQ6hhSCQE1jzb XQVOb+dts56MirgEj2ysbtucOZL8wcomb7J2KLSWneQ5AC4t+JeBnBwj5SQnNxXBcCx1 ob+vxFuXAo/IRhJXtVg7bwZ8lQF/QF4BtGqi9HR0sPNnnPrEw/m+zs909gPRlvHI+4DG oOhN5J/N9zdLeHEQGZAfYnqzyRA0tBNbeJvkhd3wp0DXtQ/wo0NJ5ARlfA5d7/a1sypg uCPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325425; x=1789930225; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=dbz2UkA+ppLqVOobr/nxngPFs17FSqKR9v4iZOMb5x0=; b=NZ00OcVlcGLknwVtbYATBpPrmK1jSiAEnNTRBZhoA/YpthogAzluA9NrikeO90u6DF Mw2NbFlQC0Za97S4rVc9Y+u+0CJhF7T4YiIbR+60Tbf2LcYSbsF62Vfb4rXViTmEr9Gf T0ahew07pPF8jQ9Ex9jC3h0kmJh0mHiVHoLNmGAgy0epN0X5ToujOwxyb9rviyxxQyB8 +2Pl4GbXFOsIEmE19H/5oB+zJU+aFTKeqiWRtRU2ilFy+2tTP66PVXmgcWZkcFenDkfW Jtt8G7gzX2HYMy2xXN5pdTHoSU+IH/VOxGf5s/zeibDHPcJ74Sr3XK1wNt2f3TRQdAqh WJGw== X-Forwarded-Encrypted: i=1; AKwUvBwEQf82Wa74OpZRWigRE/y3X3UNokEBR3iYy3uolvV5OTSiupgKIP/f7eSJhKEbUQxjwRfwWQ6F7dTey2c=@vger.kernel.org X-Gm-Message-State: AFuF++l2XBZz97hWIjAN0WWppqhmmxhGMwMrIepgP9tgnJZfpE9mRn3K caEPN6/SSpkdJApnJZYa4TaTmVXpIQPy3IzYl4Z3+WvQXquKrUrOv8OehVwEe793rFWGL2HaMPN 8kALu1tlh350LcQhmINi6jRCYEFIXVjibXf38kAPphsfCfKZ4fNwOKyaJc/urrOHkOj0= X-Gm-Gg: AYBFou3VO/xHKg9A8/SwlDjP/9tRNa0DgG7vccjSAyYk0UhjNh9LrkKn1sgPUvrKhG6 ZQalwPgZotOil0UV8xn6FIiFWvyXJvuH5nIxCiqOYykon3nO2uEsVZ71m5e9Ff7W36njKxH1Ywn MOL71T2l56ZXiOc+1Nwml7DLkzw+51t+z/E4nBAK3nkOxxg3/FPCqBtUBHMGzBcblSvZBxGsImc S9Y2M9ntiFpv3EIF5uJEuiMM4QJqt/zsgzaXO0bLkGntp58qKINSwgbiWpdLHk6kI/WqjOIiC4I alvuQwHS94Dozmi1Lw0Sc7WgI5Pxs8B5iK28TarC8zDAcY6/zaAkTuanhfZeOBG9pnJRD9L4GOB dzW+//jUokQsx88GnrWV5Je0t8mBHDQeVAu8= X-Received: by 2002:a05:6372:a703:b0:3bf:8a0e:dd99 with SMTP id adf61e73a8af0-3db26e544f2mr3652660637.17.1789325425525; Sun, 13 Sep 2026 11:50:25 -0700 (PDT) X-Received: by 2002:a05:6372:a703:b0:3bf:8a0e:dd99 with SMTP id adf61e73a8af0-3db26e544f2mr3652619637.17.1789325425071; Sun, 13 Sep 2026 11:50:25 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:50:24 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:22 +0530 Subject: [PATCH v4 05/13] media: iris: Add non-pixel and pixel context bank devices Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-5-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=6003; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=foRnImGSZ75lU1r/edBBVgqmVHY1e0szEa/Z/AKAvQU=; b=7iP01YumWQ4RTSsHPLURYioMXAP6EhN2fZAqMRwVLVthIFnByJuGbB8kd6k8z/kAZ2LKZBP2D ir4fISCg+DDB251umHmR4xQxe0w8RSlJlZbbEg1YxtrQGe6VkofSTlw X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-GUID: aO2xwyF1jovS9uUxsHF_bu3wjuZaPWT4 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX0sYL9G7s6LBk 6nr8v7ovwLaDznbKjRXqpEdcOVFXKY6ttUZ79/F6E8NxIW3jg9VQ8mIjnBLkrju951PL8asI6X3 JK9g6BExgId52TCXijv12RZoeHUHo4Vi6Ml5YZH9Y/6REpgz//7iHFCfMtlN/KSSxOkyfJ/J/i6 Dwjg8HY2idA0yqKjUwwcPJWFPGFCjb/981IQWkBA4tylcBlBtLhBIjGASUvnNl/o9VURyqhsnBK e/r2GZYM9nswBeGIpRhvQPUl8poCEoy2UiAoMGIAiVPyf8LjNS6RhZmLpYGVrcaYtq3jS7RBrQT iD7/0fnGOB6IAf9ZoOcYyar16i/1FZ1btJc5pMpV9e1LRkGF513PDcSmxjblEZyz41TJPPj/63o jmC+AXu3ILJrCBAevVBiAouawV613lejDBAqEdz0D2+AM4AdmdzPWaBGrPdnUfYyVR5ciNUtLId ImVCNL1KTA4fnx8EQWA== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfXwnNf//CUPpr+ O3byoaF4KsJSMgzQzG2Pz0kwKrTafGOVWDM7tXsYN+bPzNqIJLWrT2DYXRmVj9Ukgt+kmKqvvQT swCocQ3kn4QbmtIcTj3nvx3eBHiw4DE= X-Proofpoint-ORIG-GUID: aO2xwyF1jovS9uUxsHF_bu3wjuZaPWT4 X-Authority-Analysis: v=2.4 cv=PsUG/AM3 c=1 sm=1 tr=0 ts=6aa6f072 cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=e5mUnYsNAAAA:8 a=EUspDBNiAAAA:8 a=UWePQM47DRlDhC0KtsoA:9 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 a=Vxmtnl_E_bksehYqCbjh:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 spamscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 adultscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 The VPU issues DMA through several SMMU streams, and the hardware does not give every stream the same addressable range. The non-pixel stream cannot address the low 600MB of IOVA space, while the pixel stream can address the full range: +-----------------------------------------------------------+ | non-pixel stream addressable range (600 MB - 3.5 GB) | | 0x25800000 - 0xe0000000 | +-----------------------------------------------------------+ | pixel stream addressable range (0 - 3.5 GB) | | 0x00000000 - 0xe0000000 | +-----------------------------------------------------------+ A single "iommus" property on the video-codec node puts every stream in one IOMMU domain sharing one IOVA allocator, so nothing restricts a non-pixel buffer to avoid 0 to 600MB. Once an allocation lands below that boundary the hardware faults, which shows up as unhandled SMMU page faults and spontaneous reboots: https://gitlab.freedesktop.org/drm/msm/-/work_items/100 Now the device tree describes "non-pixel" and "pixel" as separate context bank subnodes, each carrying its own "iommus" stream IDs. Add helper functions to create and clean up devices from these DT subnodes, and call them from iris_probe() and iris_remove(). This applies to the common probe path as it is required for all platforms. Set the context banks before v4l2_device_register() so the DMA plumbing is in place before any video device is visible to userspace, and tear them down on the probe error path and in iris_remove(). Reviewed-by: Dmitry Baryshkov Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- drivers/media/platform/qcom/iris/iris_core.h | 4 ++ drivers/media/platform/qcom/iris/iris_probe.c | 71 +++++++++++++++++++++++= +++- 2 files changed, 74 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/iris/iris_core.h b/drivers/media/p= latform/qcom/iris/iris_core.h index 24da60448cf24820af7947b85eb7208555ab7786..3c96f46cf567b2802148b2a7ced= b8488b6b9468b 100644 --- a/drivers/media/platform/qcom/iris/iris_core.h +++ b/drivers/media/platform/qcom/iris/iris_core.h @@ -36,6 +36,8 @@ struct qcom_ubwc_cfg_data; * struct iris_core - holds core parameters valid for all instances * * @dev: reference to device structure + * @np_dev: reference to non-pixel device structure + * @p_dev: reference to pixel device structure * @reg_base: IO memory base address * @irq: iris irq * @v4l2_dev: a holder for v4l2 device structure @@ -81,6 +83,8 @@ struct qcom_ubwc_cfg_data; =20 struct iris_core { struct device *dev; + struct device *np_dev; + struct device *p_dev; void __iomem *reg_base; int irq; struct v4l2_device v4l2_dev; diff --git a/drivers/media/platform/qcom/iris/iris_probe.c b/drivers/media/= platform/qcom/iris/iris_probe.c index e4acf4a74f944bcae83089ef5489f204d4b0078e..debd1f0e57038d7abf463e82fd8= 0f887b67750e8 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -150,6 +150,67 @@ static int iris_init_resources(struct iris_core *core) return iris_init_resets(core); } =20 +static struct device *iris_create_cb_dev(struct iris_core *core, const cha= r *name) +{ + struct platform_device_info plat_dev_info =3D {}; + struct device_node *child_of_node; + struct platform_device *pdev; + + child_of_node =3D of_get_child_by_name(core->dev->of_node, name); + if (!child_of_node) + return NULL; + + plat_dev_info.dma_mask =3D core->iris_platform_data->dma_mask; + plat_dev_info.fwnode =3D &child_of_node->fwnode; + plat_dev_info.name =3D child_of_node->name; + plat_dev_info.id =3D PLATFORM_DEVID_AUTO; + plat_dev_info.parent =3D core->dev; + + pdev =3D platform_device_register_full(&plat_dev_info); + of_node_put(child_of_node); + if (IS_ERR(pdev)) + return ERR_CAST(pdev); + + dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); + dma_set_seg_boundary(&pdev->dev, DMA_BIT_MASK(32)); + + return &pdev->dev; +} + +static int iris_init_cb_devs(struct iris_core *core) +{ + struct device *dev; + + dev =3D iris_create_cb_dev(core, "non-pixel"); + if (IS_ERR(dev)) + return PTR_ERR(dev); + + core->np_dev =3D dev; + + dev =3D iris_create_cb_dev(core, "pixel"); + if (IS_ERR(dev)) + goto unreg_np_dev; + + core->p_dev =3D dev; + + return 0; + +unreg_np_dev: + if (core->np_dev) + platform_device_unregister(to_platform_device(core->np_dev)); + core->np_dev =3D NULL; + + return PTR_ERR(dev); +} + +static void iris_deinit_cb_devs(struct iris_core *core) +{ + if (core->p_dev) + platform_device_unregister(to_platform_device(core->p_dev)); + if (core->np_dev) + platform_device_unregister(to_platform_device(core->np_dev)); +} + static int iris_register_video_device(struct iris_core *core, enum domain_= type type) { struct video_device *vdev; @@ -207,6 +268,8 @@ static void iris_remove(struct platform_device *pdev) =20 v4l2_device_unregister(&core->v4l2_dev); =20 + iris_deinit_cb_devs(core); + mutex_destroy(&core->lock); } =20 @@ -269,10 +332,14 @@ static int iris_probe(struct platform_device *pdev) if (ret) return ret; =20 - ret =3D v4l2_device_register(dev, &core->v4l2_dev); + ret =3D iris_init_cb_devs(core); if (ret) return ret; =20 + ret =3D v4l2_device_register(dev, &core->v4l2_dev); + if (ret) + goto err_cb_deinit; + ret =3D iris_register_video_device(core, DECODER); if (ret) goto err_v4l2_unreg; @@ -306,6 +373,8 @@ static int iris_probe(struct platform_device *pdev) video_unregister_device(core->vdev_dec); err_v4l2_unreg: v4l2_device_unregister(&core->v4l2_dev); +err_cb_deinit: + iris_deinit_cb_devs(core); =20 return ret; } --=20 2.34.1 From nobody Fri Sep 25 11:12:36 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1265F3F6C46 for ; Sun, 13 Sep 2026 18:50:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325437; cv=none; b=FPODPqVHbdom3KSsUBgGwnGKmrJO1juEUhn49+t0KOl0f17hL1c66kB/AunlvwsofhKFD4CRWo87Lh3Fk3+ILIyJ0v3p/OMrmbN9KufCz78BgEDaFjdeMaSv0ljREbWoAuo942Lvk4vsHJcIIIJjLAhso4TSOHgh7zuxKgVzFHA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325437; c=relaxed/simple; bh=44gwOtsuV4svXy2r1VgeLAkl3yGqfnpCHGL2qhWdDw0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=iHTnFXRm97rnq/WFaqYhmPrfXfmJVWw3QSNXSFq8tJ50Hyrtssa0ZLSzn7Yhg1c6CrgXbAsiM+NMDtkYwlqrzNF62GGlQ/Kt1nqI8lN+csv5+wRckdeG+NVqaCyt9+ZxNyVUNk5AT4XnrGBhYAOhIIXe5TvPxiZ8C86CieSSPUQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=FkzJsEXl; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=OMHM/Bhs; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="FkzJsEXl"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="OMHM/Bhs" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI2qWM2395810 for ; Sun, 13 Sep 2026 18:50:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= /rjuYuB1k1D5FG1VpLjjTkJ8iM5rIXfoPEKZ568PWSQ=; b=FkzJsEXldduLjQwS yPwjQPpwGIt4GTRmCr49yQ4IWCnAUW6gDL9knOTlPpIK5Do1JYJi4KG9IiF8SKFJ 4V47H6z3UccUrY0EpGEVFiKoH1DTHz46Nthhq2RPH2EVcMnugg3omLt1aix8zoa4 0QdBYkKZD9TTtFgSVi53uGBXQgafJ+hXvhkhypP5CuDrDVB0zD58XRX8SE3UBOjx hqk0baJHb2e0udTbKCipjQ8MQAbOi8W1WmaiPV2oTtu5W/hob6UVm71LDE/J2xQ2 MRIiJf7mccqE2+epdk4wJa1tu43RvZtymu/4XA38PMigidAyXOBn+owf/K2abMqp ONGYLQ== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9c3x7g-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:50:34 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2d001671a54so49496515ad.2 for ; Sun, 13 Sep 2026 11:50:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325434; x=1789930234; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/rjuYuB1k1D5FG1VpLjjTkJ8iM5rIXfoPEKZ568PWSQ=; b=OMHM/BhsQAQ6dsVfUVg8+ZO2J9tLIQBElX5Nm/dVd+lpUbRFj5E4k+NmA2hQj/CBBB 7Oh2PNaHWUyx8E1Eu8z7J5QS3BvlRmVug6LiSJBrQ2UPKOByhGLC9UqhQev0vCujK3ir gxT+QD3XQK5LnYYES4sxR8RAh1cHx+3eC/GI11jvMr6zanp1mfW2H39QeEuwgegXIkn6 y9bS22o/G6FowRVmGnu5dy2Jwlik/E4xkIXdf60iPhOOmKp0O175JemrCGQjWC/G8XLI MbGjv4Yff4eAKurP5CefnAMcJUo8PbwhhqMoOROUdtJwj1xsfr9Y+t7wEzALzYaBxzDv uuFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325434; x=1789930234; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/rjuYuB1k1D5FG1VpLjjTkJ8iM5rIXfoPEKZ568PWSQ=; b=Qhhxgkc1udCo3BVj43kA1oJpoFwzCKIZO3+NB+tB7E3AtHBiVWhfW2m6hE7QxGMcX+ m3sUSxzZu7cSQSF0tjchdFbtoyRBCqMXUkQjPzyCQhptYBL+mZtkC19kcoTZ3usmE8UN BAHfpoflTNXVxIzCCXTrUe4A6BoeHHbYSwEyeo4cndP8GOBFiTx6uHN7O9TVZeenCfYF 63V1Nt0Hx7hexycFyAIV01lYDXiIbetn/o2T82cDatWxMpPCLwzYoDa0gmc96uZvrI2d TKwPry3UD69OfNb1px65MepjTiR017JMG7Q8rLaZ+FY2QVwqi8isVEhvXaDixA4DOwgl mfsQ== X-Forwarded-Encrypted: i=1; AKwUvBwL+GeZke8cb8jsWqvuOvWlqxmhBkG9QjbTGP5UQ6FeaquwYuJ5QZnZdLMzNO19hnkw6Tddp3px3rNaiK0=@vger.kernel.org X-Gm-Message-State: AFuF++mTeUzv/9mQzhDZKbgDYsWsjn9YnrboUkG2OgTUfPHMuekFBMpT DB0UPW/RQWlDMUoIWUR8kxU/NvwT1vLhyDSqrWSspVCKBxqU5Akn0Qhahg2aL8VRlzkXFZ+im1N QZK2bQCkj96/l1CZw43j+iW/h+CdeowiIoEaz0QpHN0M6RQpIPlP5Av1TwKY1lkO4bns= X-Gm-Gg: AYBFou2XG8H/6tcHym3UVFJjCQdUvyqy0qneZ3Lzf4FMIoymmj8qMl3YKhLWk1lczsl 5viVG1Mr1YgrPbF6AuBQ1GFtYMrj8Y3sziiKCAboj51+qS3EmOpuwizGzEaVyVERoT/qkqgqJFg MB0ogyExY9DpMotj/VXZaevwW2amD1R/MjlxW8yRmZF/oiCSvFSMiMcvo01UEoCqLdISaNYgWFa Rw6Q4shl8oL6eEAJAz/mrRH/0m5KJzxWGoNuqdF7o+dzijBTpGh9EeYowqDm7TjVethsLoh8+zn ZSlbBDzYCbwAQ5YBIDEt91gbdm5cIeLU6uIvMAu1W5ce+QfVVhPR2LcwrWNvTLKwkhX1AlsOM2U 9HgbTU14Ex/OPORIxOxuujOmAWJZOyexAGPI= X-Received: by 2002:a17:902:d486:b0:2d9:68b7:c324 with SMTP id d9443c01a7336-2dd4bc331d4mr135504195ad.3.1789325433532; Sun, 13 Sep 2026 11:50:33 -0700 (PDT) X-Received: by 2002:a17:902:d486:b0:2d9:68b7:c324 with SMTP id d9443c01a7336-2dd4bc331d4mr135503635ad.3.1789325433066; Sun, 13 Sep 2026 11:50:33 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.50.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:50:32 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:23 +0530 Subject: [PATCH v4 06/13] media: iris: Route buffers to the matching context bank device Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-6-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=9250; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=44gwOtsuV4svXy2r1VgeLAkl3yGqfnpCHGL2qhWdDw0=; b=niXXonlOSudq7Lnbs/w/BlkSAU/R2L6UCtQsq83f2ah2kSJd/6Yrfnqi8VA9I3R3jywfzamPW C96zRanC2WlAjmfnrcmnoRqhgqtdQSLMW/+OtXozG09hH4lJH5Xtgzv X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-ORIG-GUID: hf95LKuMi8CWXcdkEhj8kEmSRv5pvrKu X-Proofpoint-GUID: hf95LKuMi8CWXcdkEhj8kEmSRv5pvrKu X-Authority-Analysis: v=2.4 cv=c5Y+0h9l c=1 sm=1 tr=0 ts=6aa6f07a cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=XoEKZCkTUFqVY0t_PIAA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfXyMb+luVgjJqO o7TKdm+yYltBVYQ0MLxTXSSCELj8siGiCJuysLAsg8f3aEfUcrkQ49g3Ye0yp+lUd5QlrnNNDDd 6vMFgh5UYSpCuGkohU7xaSuj7IOImTB+qH72zKN6Y7vSuwO/v25kZRmlcBV1TW1zii7JB9M4vf6 8fOfOMvUzSGoROV4RIMWQUECOQPkO7KyrhMTPsbC7w1TxL1bXh4nLr/YqJIEhV6tyGDPttg2yYL WPcNHZVHAiiS7hnhuIqLafbhBY38nglmlUmOmBYyvrRmiydLp1u21l02/r/WQ+VOlDYAKcaMtA3 XaXdlYIIbT+GeN9EtkeCdoWZICoGeo+gSeRtAUu96ys4Vd9mKAJR5uXdhLMAjh3Ksql1biSWrXP Uttz940anPreSdGVzZwgU+uV4NA4GNSBfgPilgLXuy02TbkLlHzTT4t5EH610Bs6E2Hgjoq4I44 SnROWDg0gKE8EyJtZsQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfXyWEql2RSCBn8 j0whRuBK0cFOnJMc3aXlhIRah41dyPYdHIMv3SfhRUdkUcSpypzusI4kHoCIAf9r+Vmc+4lsDB8 223r59jg0uyo9CpvOu3FTptA2PjM9jU= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 bulkscore=0 impostorscore=0 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 The VPU issues DMA through several SMMU streams, and the hardware does not give every stream the same addressable range. The non-pixel stream cannot address the low 600MB of IOVA space, while the pixel stream can address the full range. Add iris_get_cb_dev(), which maps a buffer type to the owning context bank device. Bitstream and internal buffers (BIN, ARP, COMV, LINE, NON_COMV, PERSIST) belong to the non-pixel device, and uncompressed buffers (DPB, PARTIAL, SCRATCH_1, SCRATCH_2, VPSS) to the pixel device. BUF_INPUT and BUF_OUTPUT depend on direction and are resolved from inst->domain: for a decoder the input is non-pixel and the output pixel, and the other way round for an encoder. Fall back to core->dev whenever the relevant context bank device is absent, so platforms still describing "iommus" on the parent iris node behave exactly as before to maintain backward compatibility. Reviewed-by: Dmitry Baryshkov Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- drivers/media/platform/qcom/iris/iris_buffer.c | 8 ++--- drivers/media/platform/qcom/iris/iris_hfi_queue.c | 16 +++++---- drivers/media/platform/qcom/iris/iris_resources.c | 41 +++++++++++++++++++= ++++ drivers/media/platform/qcom/iris/iris_resources.h | 1 + drivers/media/platform/qcom/iris/iris_vidc.c | 4 +-- 5 files changed, 57 insertions(+), 13 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media= /platform/qcom/iris/iris_buffer.c index eb8de60c1177f5e1ab83b90a3c8c80e0b4d1f02e..6e03d13ac1a792c539bf8fe6d26= 354aa29d7b3a2 100644 --- a/drivers/media/platform/qcom/iris/iris_buffer.c +++ b/drivers/media/platform/qcom/iris/iris_buffer.c @@ -531,7 +531,7 @@ static int iris_create_internal_buffer(struct iris_inst= *inst, enum iris_buffer_type buffer_type, u32 index) { struct iris_buffers *buffers =3D &inst->buffers[buffer_type]; - struct iris_core *core =3D inst->core; + struct device *dev =3D iris_get_cb_dev(inst, buffer_type); struct iris_buffer *buffer; =20 if (!buffers->size) @@ -547,7 +547,7 @@ static int iris_create_internal_buffer(struct iris_inst= *inst, buffer->buffer_size =3D buffers->size; buffer->dma_attrs =3D DMA_ATTR_WRITE_COMBINE | DMA_ATTR_NO_KERNEL_MAPPING; =20 - buffer->kvaddr =3D dma_alloc_attrs(core->dev, buffer->buffer_size, + buffer->kvaddr =3D dma_alloc_attrs(dev, buffer->buffer_size, &buffer->device_addr, GFP_KERNEL, buffer->dma_attrs); if (!buffer->kvaddr) { kfree(buffer); @@ -650,10 +650,10 @@ int iris_queue_internal_buffers(struct iris_inst *ins= t, u32 plane) =20 void iris_destroy_internal_buffer(struct iris_inst *inst, struct iris_buff= er *buffer) { - struct iris_core *core =3D inst->core; + struct device *dev =3D iris_get_cb_dev(inst, buffer->type); =20 list_del(&buffer->list); - dma_free_attrs(core->dev, buffer->buffer_size, buffer->kvaddr, + dma_free_attrs(dev, buffer->buffer_size, buffer->kvaddr, buffer->device_addr, buffer->dma_attrs); kfree(buffer); } diff --git a/drivers/media/platform/qcom/iris/iris_hfi_queue.c b/drivers/me= dia/platform/qcom/iris/iris_hfi_queue.c index bf6db23b53e2106c08f2139b643f8626af8bc40a..ce6a682b0f9ada79f9fae26289d= b298855d777c2 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_queue.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_queue.c @@ -245,25 +245,26 @@ static void iris_hfi_queue_deinit(struct iris_iface_q= _info *iface_q) =20 int iris_hfi_queues_init(struct iris_core *core) { + struct device *dev =3D core->np_dev ? core->np_dev : core->dev; struct iris_hfi_queue_table_header *q_tbl_hdr; u32 queue_size; =20 /* Iris hardware requires 4K queue alignment */ queue_size =3D ALIGN((sizeof(*q_tbl_hdr) + (IFACEQ_QUEUE_SIZE * IFACEQ_NU= MQ)), SZ_4K); - core->iface_q_table_vaddr =3D dma_alloc_attrs(core->dev, queue_size, + core->iface_q_table_vaddr =3D dma_alloc_attrs(dev, queue_size, &core->iface_q_table_daddr, GFP_KERNEL, DMA_ATTR_WRITE_COMBINE); if (!core->iface_q_table_vaddr) { - dev_err(core->dev, "queues alloc and map failed\n"); + dev_err(dev, "queues alloc and map failed\n"); return -ENOMEM; } =20 - core->sfr_vaddr =3D dma_alloc_attrs(core->dev, SFR_SIZE, + core->sfr_vaddr =3D dma_alloc_attrs(dev, SFR_SIZE, &core->sfr_daddr, GFP_KERNEL, DMA_ATTR_WRITE_COMBINE); if (!core->sfr_vaddr) { - dev_err(core->dev, "sfr alloc and map failed\n"); - dma_free_attrs(core->dev, queue_size, core->iface_q_table_vaddr, + dev_err(dev, "sfr alloc and map failed\n"); + dma_free_attrs(dev, queue_size, core->iface_q_table_vaddr, core->iface_q_table_daddr, DMA_ATTR_WRITE_COMBINE); return -ENOMEM; } @@ -291,6 +292,7 @@ int iris_hfi_queues_init(struct iris_core *core) =20 void iris_hfi_queues_deinit(struct iris_core *core) { + struct device *dev =3D core->np_dev ? core->np_dev : core->dev; u32 queue_size; =20 if (!core->iface_q_table_vaddr) @@ -300,7 +302,7 @@ void iris_hfi_queues_deinit(struct iris_core *core) iris_hfi_queue_deinit(&core->message_queue); iris_hfi_queue_deinit(&core->command_queue); =20 - dma_free_attrs(core->dev, SFR_SIZE, core->sfr_vaddr, + dma_free_attrs(dev, SFR_SIZE, core->sfr_vaddr, core->sfr_daddr, DMA_ATTR_WRITE_COMBINE); =20 core->sfr_vaddr =3D NULL; @@ -309,7 +311,7 @@ void iris_hfi_queues_deinit(struct iris_core *core) queue_size =3D ALIGN(sizeof(struct iris_hfi_queue_table_header) + (IFACEQ_QUEUE_SIZE * IFACEQ_NUMQ), SZ_4K); =20 - dma_free_attrs(core->dev, queue_size, core->iface_q_table_vaddr, + dma_free_attrs(dev, queue_size, core->iface_q_table_vaddr, core->iface_q_table_daddr, DMA_ATTR_WRITE_COMBINE); =20 core->iface_q_table_vaddr =3D NULL; diff --git a/drivers/media/platform/qcom/iris/iris_resources.c b/drivers/me= dia/platform/qcom/iris/iris_resources.c index 2c4d34c7bd77d1f78d3572f659da656eb3b12113..a6c3df892ca9888d82414ca6b48= c80efbf7b06d0 100644 --- a/drivers/media/platform/qcom/iris/iris_resources.c +++ b/drivers/media/platform/qcom/iris/iris_resources.c @@ -12,6 +12,7 @@ #include =20 #include "iris_core.h" +#include "iris_instance.h" #include "iris_resources.h" =20 #define BW_THRESHOLD 50000 @@ -138,3 +139,43 @@ int iris_disable_unprepare_clock(struct iris_core *cor= e, enum platform_clk_type =20 return 0; } + +struct device *iris_get_cb_dev(struct iris_inst *inst, enum iris_buffer_ty= pe buffer_type) +{ + struct iris_core *core =3D inst->core; + struct device *dev =3D NULL; + + switch (buffer_type) { + case BUF_INPUT: + if (inst->domain =3D=3D DECODER) + dev =3D core->np_dev; + else + dev =3D core->p_dev; + break; + case BUF_OUTPUT: + if (inst->domain =3D=3D DECODER) + dev =3D core->p_dev; + else + dev =3D core->np_dev; + break; + case BUF_DPB: + case BUF_PARTIAL: + case BUF_SCRATCH_1: + case BUF_SCRATCH_2: + case BUF_VPSS: + dev =3D core->p_dev; + break; + case BUF_BIN: + case BUF_ARP: + case BUF_COMV: + case BUF_LINE: + case BUF_NON_COMV: + case BUF_PERSIST: + dev =3D core->np_dev; + break; + default: + dev_err(core->dev, "invalid buffer type: %d\n", buffer_type); + } + + return dev ? dev : core->dev; +} diff --git a/drivers/media/platform/qcom/iris/iris_resources.h b/drivers/me= dia/platform/qcom/iris/iris_resources.h index 6bfbd2dc6db095ec05e53c894e048285f82446c6..a9a5bddb19c24917de4c5dba525= 67934b77e5c59 100644 --- a/drivers/media/platform/qcom/iris/iris_resources.h +++ b/drivers/media/platform/qcom/iris/iris_resources.h @@ -15,5 +15,6 @@ int iris_unset_icc_bw(struct iris_core *core); int iris_set_icc_bw(struct iris_core *core, unsigned long icc_bw); int iris_disable_unprepare_clock(struct iris_core *core, enum platform_clk= _type clk_type); int iris_prepare_enable_clock(struct iris_core *core, enum platform_clk_ty= pe clk_type); +struct device *iris_get_cb_dev(struct iris_inst *inst, enum iris_buffer_ty= pe buffer_type); =20 #endif diff --git a/drivers/media/platform/qcom/iris/iris_vidc.c b/drivers/media/p= latform/qcom/iris/iris_vidc.c index fcbc60016beec693f2ce27927a09a2d51494bc38..064cf0a80748dab1be0515c4c2b= 6688aeb2b7022 100644 --- a/drivers/media/platform/qcom/iris/iris_vidc.c +++ b/drivers/media/platform/qcom/iris/iris_vidc.c @@ -108,7 +108,7 @@ iris_m2m_queue_init(void *priv, struct vb2_queue *src_v= q, struct vb2_queue *dst_ src_vq->drv_priv =3D inst; src_vq->buf_struct_size =3D sizeof(struct iris_buffer); src_vq->min_reqbufs_allocation =3D MIN_BUFFERS; - src_vq->dev =3D inst->core->dev; + src_vq->dev =3D iris_get_cb_dev(inst, BUF_INPUT); src_vq->lock =3D &inst->ctx_q_lock; ret =3D vb2_queue_init(src_vq); if (ret) @@ -122,7 +122,7 @@ iris_m2m_queue_init(void *priv, struct vb2_queue *src_v= q, struct vb2_queue *dst_ dst_vq->drv_priv =3D inst; dst_vq->buf_struct_size =3D sizeof(struct iris_buffer); dst_vq->min_reqbufs_allocation =3D MIN_BUFFERS; - dst_vq->dev =3D inst->core->dev; + dst_vq->dev =3D iris_get_cb_dev(inst, BUF_OUTPUT); dst_vq->lock =3D &inst->ctx_q_lock; =20 return vb2_queue_init(dst_vq); --=20 2.34.1 From nobody Fri Sep 25 11:12:36 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0879B3F86F3 for ; Sun, 13 Sep 2026 18:50:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325444; cv=none; b=ogqxOY06dLIuzuQIOiQf8FD+cQSkmfa0F19fK3/fMMn9vbTnBNEMtvhktZ8BNDineQ80seLesBNSeHDbx7ONn9p8JVs6UOAOGtkyJL9gwtij/wAMiff4TaGFOIsBEKIHE0xhLOOkKxO7XC7OuSd8D8KQh5KVP2kt1GBHfbjtDmc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325444; c=relaxed/simple; bh=u4T/TiBVjk6sDPMeOEWKmkDa4GYeq4h6p7YKB7q310c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YB6SVmxC5rK9In14UxlrgmQ1fwv2pGtD47omNF9cJrGmfy5g0BZwLBW5yQNqOHNC6LI377ki5AjgHxr+sJHPYkmRr+b1hwnIsP1KkYvI9r+JNjoF0elzYlPt6QJkfBD19aMBO8YRgLW3no7apgsiYwUl5HX2sMv77HlvQJvaGVI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=D3RVJXJb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=iJ/R/0cX; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="D3RVJXJb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="iJ/R/0cX" Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI4AB41932622 for ; Sun, 13 Sep 2026 18:50:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 6m/+51lEBEN8BFk27SUULRpvRuJnuqvGtKovB+gc4D8=; b=D3RVJXJbDMef+7qr wM18t2813Qyobh3pgTt3yRs0+10ZMEookR+KMS5Vf0U7Cc2BS5oEg820O77ULNKS 5YWWOz2cfDPrLsF0qAQ9NMx7PoG9KSyMUUErzl/Y16+GFTizs3JF98Pz1mU9364z Fi8IiAwQYdsWRQtBN7hbm1IYOTXsm1XTovJyuHNH2N91pbzY0ZIb6gklqkacEM4Q dlbkSR4yUm0RNvTfJ/pydKTivGC8xdZ+SMFHAkTLEfrN56pMirvUrrfked6ft2jX x8D7bGmu5MNbO0v23puZ11h5rtyUsQTf7pscuwt4mU+WDtT0QpakMtTz6++y4UMh CJDjQA== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmygd3y6e-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:50:42 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2dc92350888so43156445ad.3 for ; Sun, 13 Sep 2026 11:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325441; x=1789930241; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=6m/+51lEBEN8BFk27SUULRpvRuJnuqvGtKovB+gc4D8=; b=iJ/R/0cXCf9eujV0VQWX+ZcAl6rn82lu3iYlzxgwOmQsi5/iXDPrB47lbFmzzYjb1Z EY9iM3VCbz1+OFmrVnzfcKhPjcRLXqHBe9wQWwEO9djicrq1fxgrMrN8u6/MFsnlc4p1 9JsRB7gqZTpm+MsyINkfsUKlCRRlKu9ekp0AIu9GVu7TBgNkNDHQsSw7X5cI9XZl6ckK mHeka3W2QiGyy8hoXz7tyYg9I0BmS6sAaL5L4lS43sfX53qmXwg49vy4cU6gxTloxVZT fPHfUSfWqHHH+D1G483IRObpCQPYM9Z5glJruANGZZkT0tFlCgsXiFh/ys+1OwEEvCOc Q2lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325441; x=1789930241; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6m/+51lEBEN8BFk27SUULRpvRuJnuqvGtKovB+gc4D8=; b=JwDiq37e7cbh9mG4tOlHBuLBhvMJsijazuzyf+PHD5pWgsQ8SyqeTKUHsIbcnjdTW9 UNS0wvP/yRYPQ1ikSHnoGYCB9T4xM7Q2KPcDF9dmQQmcC6eo2PzYQodyNnghPD4+FWIM yuZHijJHkVI91STrWBohM1ZN5fDeeu4nh05PNDJNawD7M3cMFg7aEHIyJAH/9p1JDYkR qOxxbxKJJkRubAceL0lbc01Nxv6SrVagEgToVOJv9j6gNiihL9ZXGoVNR10Hwq9UU2iZ vbb6MX1Glx23xXahaSyuAbx4oEmBbCiNlgmcgmPjuvv5HnruNYr8D1p5ay6bXobPJR+i JHBg== X-Forwarded-Encrypted: i=1; AKwUvBwnTIGy8bNu/8mZAX0bK1SEgsMyoWakY0Pt6zyUEh76bCzfYj5rnX9y+mKXTQ1rUddgddz78dX+AhmTO6I=@vger.kernel.org X-Gm-Message-State: AFuF++nr8zebV4i5wpmBqvOQQSYpCkuGMMR5wLZfYjHgOBwKuxlvdFLh Ai308LQVkj18bA4EsP41gRua8khQxcHmBBs11KlT1On/b5s97ht+fUJXWcf3ycrW3RkVAWkF0rg 1S5vsnn/5CmzqXwsSuKKE1ViXfnlyEN8dV94WvyB8hMtI6/pxyFX63k2kGI2SdkUNuJw= X-Gm-Gg: AYBFou19xiSW7cCj6J7Qq+ASvR2B9DGpD0oadyuHPVARpXAUnWLt5iQKeeXJ2xwhK+z Xb1yrPXcZsMUBou/ArQbOB1/If3y9MajZbaohFG9XItv0QqTj5b+Sr2Sg9kqfzp8WlzaGThtCdZ /q4HO3PJ0p2sUtS/vcUvzvcAOrzuOGvewSkUr5VpQkE0yjcK1ijolvSHMmS3TS7Ygtd2BAkXX62 BHKiziuln3tG08lig6JhgoowsLs2kPCK7YYmhVlt/nUEen/WjChR/NRa3XkhBm38OeeTjZ4Mjoq fJmyzlacqaybovHQRV/yLh93ghNmfYgkDEty8ie9pkRgyPTmybyeaIqe7Qxwj+hOKUDfISFJ0dp 1yEGHaRGyBBNVRcIIHnphlRIdPwJf+K7sbpI= X-Received: by 2002:a17:902:d984:b0:2d7:f0:896b with SMTP id d9443c01a7336-2dd2a33648emr270824405ad.13.1789325441468; Sun, 13 Sep 2026 11:50:41 -0700 (PDT) X-Received: by 2002:a17:902:d984:b0:2d7:f0:896b with SMTP id d9443c01a7336-2dd2a33648emr270823745ad.13.1789325441023; Sun, 13 Sep 2026 11:50:41 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.50.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:50:40 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:24 +0530 Subject: [PATCH v4 07/13] media: iris: Skip DMA mask setup when the core device has no IOMMU Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-7-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=1806; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=u4T/TiBVjk6sDPMeOEWKmkDa4GYeq4h6p7YKB7q310c=; b=b/OU4xVwL6Uy7p7LysRQLTjOXu92eavws+64eXUu0+bfYdoL+0OiwJJs9umzBS2comu/vew0g KOaqouqlj83Cjk5pDwRP/ocj3Qz9nsLuMW5i/1KTFwdM2q1Dnx7kpOk X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Authority-Analysis: v=2.4 cv=RY0FmFtv c=1 sm=1 tr=0 ts=6aa6f082 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=EUspDBNiAAAA:8 a=1uU0fEruEEfCXXW2WGwA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX6dBdBj2tmNxd WotVueM5Jb1NgPh3I07bOG61Q2ZZiZI6Wm1p+WUNw+bpnIG0CdVnnOjtuxMU1mugXkOPG7n87OF hKn5PSkik0c74gcF4YaSDZx59suTLnx04ebBjLae20SztAvEWZ0cyWVSGEFNw72QutMRjJEjw5h kSsJ9tHKQav9f8HKs3ARClMnzpajT6PfdMBsO5oXqx/kMpMRxuGbl1JCob1pQ7aAQM9vS7srwWE hoA9rlQGBgb1v9QwJkC+jX8z03GF5IOSSZ3ONl+sbzVr0I3xWCGP8wmuby3hMnx+t82nqqkzl+r WDTgOaOw7sqr4LQw1Gpf5YvrNRoIKzP5ySpPd5CkcwGMeeq26yve3ZBzPWo92CeLg0/ENrOtFAo CoMJKeZsDtTTCPR9jCKi7G8Kx2plUq14iV73t23jKdQo/XA8FVUKc3n+OsjA3RfhaePvWbBIdLz egQsnXqsHxPvWQwmlsw== X-Proofpoint-ORIG-GUID: DjfAMkUf7LgH_bbVaGz_gX-NDrDrg_Jy X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX9itoHeal4J4l nzyKoah6KDgk5HP6ybC4C9hBYRm3InQ4SKe7kYTcsJtxueaiXqfbYidZ5mKFLzCnzxpJOrAzA4B j3+xj1wG+yvy7EaTU0WC0Vz5nDqPnbY= X-Proofpoint-GUID: DjfAMkUf7LgH_bbVaGz_gX-NDrDrg_Jy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 spamscore=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 Once the streams are described as context bank subnodes, the "iommus" property no longer sits on the parent iris node. That device then has no IOMMU domain of its own and never performs DMA directly, so calling dma_set_mask_and_coherent() on it is meaningless, and on a device with no IOMMU it can fail and abort probe. Set the DMA mask only when device_iommu_mapped() reports an IOMMU on the core device. Platforms that have not been converted still carry "iommus" on the parent node and keep the existing setup. For converted platforms the mask is applied to each context bank device instead, in iris_create_cb_dev(). Reviewed-by: Dmitry Baryshkov Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- 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 debd1f0e57038d7abf463e82fd80f887b67750e8..4bdb078d83b5c331869dab2409b= c4d10ab302737 100644 --- a/drivers/media/platform/qcom/iris/iris_probe.c +++ b/drivers/media/platform/qcom/iris/iris_probe.c @@ -352,9 +352,11 @@ static int iris_probe(struct platform_device *pdev) =20 dma_mask =3D core->iris_platform_data->dma_mask; =20 - ret =3D dma_set_mask_and_coherent(dev, dma_mask); - if (ret) - goto err_vdev_unreg_enc; + if (device_iommu_mapped(dev)) { + ret =3D dma_set_mask_and_coherent(dev, dma_mask); + if (ret) + goto err_vdev_unreg_enc; + } =20 dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); dma_set_seg_boundary(&pdev->dev, DMA_BIT_MASK(32)); --=20 2.34.1 From nobody Fri Sep 25 11:12:36 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F00F3F9265 for ; Sun, 13 Sep 2026 18:50:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325452; cv=none; b=mxdlpFuiyhHpLukZwexph37RY3yG82QrCEWrb9Jv4uS2Apj6q+GmWR5mTs/4nlPhzKTFKycAYClra4ekVlRrrhu+LnLFZOOroLNHLrYfkZ4lVBIdwtJSBQAiL1cC3ucCqH3zYQ26XBEEBqipjPWE/q15j9POK8X+PLkU7OaYyAE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325452; c=relaxed/simple; bh=vE3R0Cr/6kZkP3egk0sXz+1Lyiu0KUq9YNJevNH+FoI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Dt6rc7qM3rDRuxcJjDzzrNkhB2Xs9fSHgeJXRphLH+K0tVaXj5w90HlvbV23j255UVjbqH7ImfRWG74jl+Va4AGv7alO2oPM+W9nQVeBDWuUTgQ8RNkB6tzDsxkhP1s3f4zACfCh32cyun1/GCUEveyznQfqkrLgT2Msm8PMwyY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=PMta6o9b; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=VmpidQ9F; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="PMta6o9b"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="VmpidQ9F" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI349t3539662 for ; Sun, 13 Sep 2026 18:50:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= iZATYvq14VYqRSPBW+mTQl6wrULakSEle1sP/Bc+xrw=; b=PMta6o9bBtAdvw0c bS8vDSzpZ3cisKd+drPRprVMRJhw+V9jAT8U2ibrGNwLIOoySkQaiOeTzaYW7K2l bDJKIbafogaJXUenttOC9808X57j9IBsVSmkpq1TNXpYI7tlS2/B5zX+AYGJJUXv iirsWRWLA8d1Dqr9cPqEaQA4OBs3YVejzqLzvRSvwL/YHh2azecq4W0GusuVtn87 UiXOquf9rfDG4AgNEid3GWoFN33HvNrlLwNk3Nwj6OIMs3V2Uq9g5E/knp2cs/am Infy+8SpwQducfd+70kqGch7ZP9zHWXlR3YpWreQnuI5cb9BMmJ1cLy34DLYQ70R fO5Udw== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9ckx2f-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:50:50 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-398dc3d8f0fso3863202a91.0 for ; Sun, 13 Sep 2026 11:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325449; x=1789930249; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=iZATYvq14VYqRSPBW+mTQl6wrULakSEle1sP/Bc+xrw=; b=VmpidQ9FdqTBY1EoHSE8is6X5AvWwySOo2/CeKilP5eAE86Z3Rcx7OyyeJ4QRZRcXt teKa5gOtdN+wowGc6VfuLbKzkh4vCGtymW+l4k8nimfH4KyqGC6FEKrReODZnrSCLgQx 4YxORZ24xUt6hHSkMU+asMj8tXuSkKNmWcOO30Wf2xo+OAXCNVeDNT0VKUoAhUZwVjLP zIO87KCp+5yzPm3piq4PGX16Iqt7rjy3Qf+QYLuQ5ar585O2hJMPS1p2CHW4w/1HEr/d uXJQ6Zop/MSEnrGvcd04dGL5SsLrR5qvBo0J/KJuDzfokpzLfgMShxMTlIKc/d1FjGs1 7ZRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325449; x=1789930249; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=iZATYvq14VYqRSPBW+mTQl6wrULakSEle1sP/Bc+xrw=; b=qS+XtcSRVkCPVGRGLXQc+ExYMPLtbDd1cMijxt0HBQ5mrB1zxPhk5A9LjiMMLphEfX gwEBZvvMpd+trbwaZ7fXcZRRf71yjV8WP1MK0nq1K8L88+u9YE59cKKM49psZ4WeXqJt F2Uly3uWoFvQw9vebtJJh8R4bpftr6YBSg+rlhRSAhvFN0xuW2F8wlcefxsFyBjJkH1s Wtb45Ezgl/LvWEAm/w+OmUtrMdexbfRuOxCKQCMzSD8cDOCJIlZwQP8pk3RM9COIiqab +Q1EmOEEm/Ob9+lF0Aa0YCusSHM8+R3vhJlCMbmZPQ7KRsnD6f3DBUVjqdrmIE3HMgeE DOyg== X-Forwarded-Encrypted: i=1; AKwUvBxYBvjC/Mh7sb7GW+BROE+DPsbl2xWK6v//bCl+X4T0FLHkkhn27wt2ExvWb3BfUcn7ypSdZMbj6GKJDAE=@vger.kernel.org X-Gm-Message-State: AFuF++nlorU42vIm5We1LBGxnKDcnmhtrO/89BoB8wyBVo4X85jo2cyY bN8q/Fs8e8YuKLtgT77KJpfZy+Cf7d9xa40sDA721ROFO+ucE0zc4xPTTopU8wh8wDHYQ3WyGvF HWjBCw8J3ymUL4U0uSYX27QkqE87hzyjzPzNnh9CBoNf7J39X2GccGArZ52RmR62DYYE= X-Gm-Gg: AYBFou30LRL3ct6Dd7cG9fowYTwbnYkW3ISKnXRi2J/1aovzC9W0M717KKH/6vWgkUl u/xv0/b6SaxD68NocJBHMi6/sB8ccnTYyRTE1chqccyIvO44iv+KXkkWndPtzOLLAb7B2/lD287 HLghS8F2F6Wn2+6Z3nv43HtxD01blYV3sitAryY25SerGH0O7s6bIzGB2IM4v87/r+uSHDAJSzs al/t9IIlt3lZTaJry2sQWo48A1B52BNluqypJKSPpvdu3bRvdezmrv96/R+IcC6UJ971LHzAFYY r051/VroFK2cS2yF6C0YKYhWexBBPFdR4GeXhDhWMYn9rwg2SJoB3w1S3uh00bD+wIWkdPEOqE0 ncd3QpI3BhRBBBjE+86b4+PMdl8QV+jb6eAo= X-Received: by 2002:a17:90b:4c4a:b0:396:d28e:b53 with SMTP id 98e67ed59e1d1-39dd566515bmr4232262a91.20.1789325449408; Sun, 13 Sep 2026 11:50:49 -0700 (PDT) X-Received: by 2002:a17:90b:4c4a:b0:396:d28e:b53 with SMTP id 98e67ed59e1d1-39dd566515bmr4232230a91.20.1789325448973; Sun, 13 Sep 2026 11:50:48 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.50.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:50:48 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:25 +0530 Subject: [PATCH v4 08/13] arm64: dts: qcom: hamoa: Add Iris context bank subnodes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-8-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=3399; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=vE3R0Cr/6kZkP3egk0sXz+1Lyiu0KUq9YNJevNH+FoI=; b=R2AxcUirXGZwTaa18cY/UgbIsxNLrNL4Y8IGkK9XB3MmqPpPv66B4RtRCxuwA6i7iZvks77M7 kcMebpuFQsnDs/QtQvMjst+j1QtNIQOvq5uSKlLRUOvuRA4VEoU0Zh0 X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX3n5vpi5vxhJH CKI1hfekigmVfHqslKo1gr6q5l8yxplSDPbyyj3IdxpPTu01z+WrPU0Zi05uMKpMRXxiVt7twrH QCXV/5JFW7bPInDKprY5aU34b0RNgFKxSuy0YryrTn4rVLQK0kZQJEqJWErPfR3MXFWNqeoXyyd LuEr8quemGSRLaNq2V8xpTAOnEhEwwpEigDmz8nNKbQ8/hJWIb8ScM+TmOH2gldifJcUUpByF6H 8Up2+JhZOX6GgfBMPev+MpotoGvfJx9UJjd8bNrr1zWdeWyfSzXP9HonfQMu9yj9CbrAILIebaI Q4kA8sdgRyi+cdYT0G7BBR+HcN0LdXvc//k8tXiAGwc0q0GxF942FMAcd6MGQYdyGkURy4eTeMO 0SqKLxNoLI6hhEUBT9kvDY17zC07HdS8d12rfm9dn5gzXxSHYi+fDg4RmD3+uJR2QVOk1ChUYKK quPYcMCMlHr2vo1cVQQ== X-Authority-Analysis: v=2.4 cv=EMyTQFZC c=1 sm=1 tr=0 ts=6aa6f08a cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=iS9zxrgQBfv6-_F4QbHw:22 a=Vxmtnl_E_bksehYqCbjh:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfXxsIvoDjEC8uh beJr1GoGlXeMfKDMG0VRBX1TWgVidMbDbq2/SbV1OSStmB8cAcRAPXREKfAuEUlRJKFntoB97nF TRrNx2RhnKfVWWmvnLK7nwsOAjwfoxo= X-Proofpoint-GUID: AHzk-mTL24pXnxBshPgkr2z0qVgnxogV X-Proofpoint-ORIG-GUID: AHzk-mTL24pXnxBshPgkr2z0qVgnxogV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 impostorscore=0 spamscore=0 bulkscore=0 clxscore=1015 malwarescore=0 suspectscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 The VPU issues DMA through several SMMU streams, and the hardware does not give every stream the same addressable range. The non-pixel stream cannot address the low 600MB of IOVA space, while the pixel stream can address the full range: +-----------------------------------------------------------+ | non-pixel stream addressable range (600 MB - 3.5 GB) | | 0x25800000 - 0xe0000000 | +-----------------------------------------------------------+ | pixel stream addressable range (0 - 3.5 GB) | | 0x00000000 - 0xe0000000 | +-----------------------------------------------------------+ A single "iommus" property on the video-codec node puts every stream in one IOMMU domain sharing one IOVA allocator, so nothing restricts a non-pixel buffer to avoid 0 to 600MB. Once an allocation lands below that boundary the hardware faults, which shows up as unhandled SMMU page faults and spontaneous reboots: https://gitlab.freedesktop.org/drm/msm/-/work_items/100 Given that the address range restriction is for specific VPU stream, it should be ideally be moved to that stream. To achieve the same, a subset of streams is now represented as subnodes, so that each can be associated with its respective addressable range. The design was discussed and agreed by mainatiners here https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org In the past, this limitation was addressed with an iommu-map approach, with the iris driver dynamically creating the devices. That approach was later concluded to be a hack to avoid having subnodes, and was NAKed by the iommu maintainers. It was discussed in detail here: https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org/ The video-codec node includes address-cells, size-cells and dma-ranges to declare 1:1 mapping for DMA translation to the parent. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- arch/arm64/boot/dts/qcom/hamoa.dtsi | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/hamoa.dtsi b/arch/arm64/boot/dts/qcom= /hamoa.dtsi index fcd88e5f5d7ee1b15e4329d45131ab969e1c9970..63e9ad58097f79b62102c79ff0c= ffddf12d00f48 100644 --- a/arch/arm64/boot/dts/qcom/hamoa.dtsi +++ b/arch/arm64/boot/dts/qcom/hamoa.dtsi @@ -5462,10 +5462,12 @@ &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONL= Y>, resets =3D <&gcc GCC_VIDEO_AXI0_CLK_ARES>; reset-names =3D "bus"; =20 - iommus =3D <&apps_smmu 0x1940 0>, - <&apps_smmu 0x1947 0>; dma-coherent; =20 + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0x0 0xe0000000>; + /* * IRIS firmware is signed by vendors, only * enable on boards where the proper signed firmware @@ -5473,6 +5475,15 @@ &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONLY= >, */ status =3D "disabled"; =20 + non-pixel { + iommus =3D <&apps_smmu 0x1940 0x0>; + iommu-ranges =3D <0x25800000 0xba800000>; + }; + + pixel { + iommus =3D <&apps_smmu 0x1947 0x0>; + }; + iris_opp_table: opp-table { compatible =3D "operating-points-v2"; =20 --=20 2.34.1 From nobody Fri Sep 25 11:12:36 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C849D3F7AB4 for ; Sun, 13 Sep 2026 18:50:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325462; cv=none; b=fhhiIj4z8h88GMkGDPBCdDhLbvMTGmnH+bQgSFz4gTkUOjZj38ac97nQnliwpdIicI8QzT42lbEZFAHZRFY+9pcNZSmLIuq/th2SVSuWZoOinKfAMhZT6ug6STZxDaKohI7/G+5Hzwa6GXvwtuqaRuOBNla1oFMkQXJYyDeDVCg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325462; c=relaxed/simple; bh=aMjd9aYFnA7xUvSYKyRihpubAtnTpKk18gq2dPNLq2Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bIex/Rf8kMcww10PUfpPdi9M1eE+lsnB9TQ+qubQLpBtKMViQs2JTIhXLhiLn0p2brK95t9HQukp8TJfsvmrZ4CXQ/TKgyhN5yxZYA8wQwT/E1tOjGlFRIGflntr8LAOAWq0KBH+KjQ6DRpwILRTZL/T7EK63uqw75dy4tgcVAU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=YJNAYki3; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=NYL9KUWe; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="YJNAYki3"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="NYL9KUWe" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI2htT2979834 for ; Sun, 13 Sep 2026 18:50:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= V+x7UtvEzgjdSrT4tt1OzVc4/3CO9RvMlBltyh/a/30=; b=YJNAYki3njIkq+3+ s+Hk5kP4GzGY9RxHHQ/vVFz7fa/f6eH+PMCeG7cme5Ys+4tOMXlRnbAzDyvtbH+P s1BExDqtq/ocY4wpnMYftO40rgVTVGq1PqQSJlB+rs0REo0vyfbe6GRpzc1bkeOn g8x7JoCyjEtdiCvlZUgidvyGPaHngQpBx4N1WTYiBIF1X7s4rEXulTduuXohy7z0 Xx3TJ7UZMk4/kP2VnnZzFildFhqvZoMnu1LuRG1b5zFEScNzC5zDLA21h3oGXyZF ccX99/SMhWSQetrQHibf08e0PYQSwZA0NMT+TUNDDxNO1NJaV3/7SxrRBELt9LTe Mzwj4A== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9dkxg2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:50:58 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2dd1631d291so28121705ad.1 for ; Sun, 13 Sep 2026 11:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325457; x=1789930257; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=V+x7UtvEzgjdSrT4tt1OzVc4/3CO9RvMlBltyh/a/30=; b=NYL9KUWedAE1XF35/wWOCl5GhPMYwq18kUw7UsxmyY68nPpIhEWv5yo1mJR2W099PS mKGiJYZi2vYXy/y0/vkpQ9BRuXS0WXlmrZ9DZoy24/L66xVWAbEUbrQxrqq7t7Nprbrm VBn+2gHQDeEfSkG441tsYtB2h/XrGoGL0TMvntEUaR3suyU8q74WTLfXwgKw1KQpNF2k R493jMNNAzxRARU7xkk7hiO+zGQcraboLQpOc7GmmJ/h4NAKQMM444x77Lb6BiST+NCs iuJC9ohK2i9kVKkl4yAoHf4ebwua+T1sA5rWVyTFqbR8UJIMFqWWARoNQyp4Ta5qPvDO hrXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325457; x=1789930257; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=V+x7UtvEzgjdSrT4tt1OzVc4/3CO9RvMlBltyh/a/30=; b=m4qvu0SovYU+enG7zGPCDyW72RSPBbAc89lqPvjCsGmQXfRjw+SRmYOXv32XDsqI2j v+UplMImInpOrwVeN6ma6FFXjACZzWm2ipdH1TGeOjOXhPIN0+szU666grdula5rbocq AOreLKKPUtjXXpmEa86eJSjchwEUD67IkxzrRB54KjSqoomoCtwaF9PkoJq/l9rEYYbq D3l7w7TXKdTyYys+PUdwile6EjFr3UYOm/1Y5z3kab9wfOz7ZuwDzWZocFpxeZMzQFsv K48zI6r06maWXzwHtHoHJV33/QWGI9MXERF6zsJOeTydvjuZ8iT5As03afREfPCfi+ku OEAA== X-Forwarded-Encrypted: i=1; AKwUvBy1iWSZuWb9JZdOYIej1T6XvRDts1ePBATeMqHqajeHuS/89fk+EiUOQjYl1uwtP5gmJH7YXhpyX6UIfqQ=@vger.kernel.org X-Gm-Message-State: AFuF++kUFXOS0GIGom58I1rTr5UjKpaBTWRNDebTrYEvwJGPpNO9IJFg 6HrjTsOxDRKX045P6RzRCpkhArKYu5f33bAnJFgE9Stoch3QxtLocUWmP9uTBLCbos7iz/XhpFQ rQTMBxMg9bfoZrQWLVyJYcC4TlR8t3W48VXe7A1VEWuw88ceMo1XZcrElIqRpwNv763I= X-Gm-Gg: AYBFou0jKDWRf32tP96Ce5CdQXEL6B/Zo3CJPK6In0+zqzB6Id6JQQZfzIBDOOs1Ul8 Vf+qtsNIERb3ZXlas+5VZBvjA6Luh4HyExjg7km7XV2GU+pAbQlXRuF0Qb5flTGoDXgJWVGylba G3iwqibZ2HlUrTlan04806miECSOIQo0J3K1N1t+rGcrr3Akcb/bSFRHwMSQi9QbCpM1adIkUvu XtbiBs4ioUJXGIY5gs/s2d4lYtaTHUrD0YA9e/VrJCT9c+lqGYaHfc4Ea1Hc/MVseNY9My0dogi CPNqA3tYrZkPA29S8+MwusCKCQ0F3k4kInboSJFyQ0TVeXI93XD1lTgsJJ2jXokUc8d9XXLbpsf BCENRqdP4fdHCn6gkTUwlpWZTIA/lxZMpydA= X-Received: by 2002:a17:903:1b4f:b0:2dd:40cb:a054 with SMTP id d9443c01a7336-2dd40cba32bmr186298765ad.19.1789325457344; Sun, 13 Sep 2026 11:50:57 -0700 (PDT) X-Received: by 2002:a17:903:1b4f:b0:2dd:40cb:a054 with SMTP id d9443c01a7336-2dd40cba32bmr186298245ad.19.1789325456919; Sun, 13 Sep 2026 11:50:56 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.50.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:50:56 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:26 +0530 Subject: [PATCH v4 09/13] arm64: dts: qcom: sm8550: Add Iris context bank subnodes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-9-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=3295; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=aMjd9aYFnA7xUvSYKyRihpubAtnTpKk18gq2dPNLq2Q=; b=ZXgALxYrEDfJi1Rg2+EUjjxP35Zcnlz2ROOmWEgGpZSrc29xppYSwMvOKEmMNW7/uyfWNBC4y sVLprhTofZqCu2TryGSwv/LXcUAHmysw9hzNK/80x8Ok0LA9go2gFBV X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-GUID: dHo45x7bhRiJ6QQtj3CJRinHbHXiwhIm X-Proofpoint-ORIG-GUID: dHo45x7bhRiJ6QQtj3CJRinHbHXiwhIm X-Authority-Analysis: v=2.4 cv=NelzRGD4 c=1 sm=1 tr=0 ts=6aa6f092 cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 a=Vxmtnl_E_bksehYqCbjh:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfXwOXtQpP33izN DqSTrWllNJ6lZpETDF1x4KXCMJK1LWHwEhz5Rv9xdY55gt5ANRf2iz/L3EWwvYpNsz+LM2vYd5j US9NLQ25rq4ONCSV4t6jZWRgKTo7bmw= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX9sFRuniNQGWF TPuAlmTVrptAT3r4QYji9kgMzDfKRdE/tMPQEpo0ppaBuwpa7w09IdVSN8IfwG7FW38jTMqrBxb b1R8Iw0RCcAq9p15JHFpsOpeccHX0QbYT9zNaePOGhPqjToYmKAXNsLGlB1ovV0NJOe1hhF0G94 smW9l+lXgkUjDqKRdqV1CYD1rbmTNb0vdzdhdP9Llv+x5r/lReZUEhaVOkRbzqBoifE81Kr38Qa nMAl+wkc2mqhV1gU092LB37HrP5mw/eIFl4kiEFzuSN/PLBUB9WD6CNDQcb+UzPZrPxbfRKxS7N aWYmwK5oSyTO/0FcfVrvtz4T2iFx1/YcwNJpwYhbxRSIwwIdlHw5ZOKEf8+J5W0a9xZklreyfsu mzs3gQd5+1P8npMi7WYAwJi2CGyCmUxTXIh2eqPF1q+M7clpdiBhjzwsum5IgWp+kqWkavE5sKv k4E8jMJp5f/NzL0uK3g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 adultscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 spamscore=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 The VPU issues DMA through several SMMU streams, and the hardware does not give every stream the same addressable range. The non-pixel stream cannot address the low 600MB of IOVA space, while the pixel stream can address the full range: +-----------------------------------------------------------+ | non-pixel stream addressable range (600 MB - 3.5 GB) | | 0x25800000 - 0xe0000000 | +-----------------------------------------------------------+ | pixel stream addressable range (0 - 3.5 GB) | | 0x00000000 - 0xe0000000 | +-----------------------------------------------------------+ A single "iommus" property on the video-codec node puts every stream in one IOMMU domain sharing one IOVA allocator, so nothing restricts a non-pixel buffer to avoid 0 to 600MB. Once an allocation lands below that boundary the hardware faults, which shows up as unhandled SMMU page faults and spontaneous reboots: https://gitlab.freedesktop.org/drm/msm/-/work_items/100 Given that the address range restriction is for specific VPU stream, it should be ideally be moved to that stream. To achieve the same, a subset of streams is now represented as subnodes, so that each can be associated with its respective addressable range. The design was discussed and agreed by mainatiners here https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org In the past, this limitation was addressed with an iommu-map approach, with the iris driver dynamically creating the devices. That approach was later concluded to be a hack to avoid having subnodes, and was NAKed by the iommu maintainers. It was discussed in detail here: https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org/ The video-codec node includes address-cells, size-cells and dma-ranges to declare 1:1 mapping for DMA translation to the parent. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- arch/arm64/boot/dts/qcom/sm8550.dtsi | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8550.dtsi b/arch/arm64/boot/dts/qco= m/sm8550.dtsi index 23604436add303348867f890890f2f7af4f831af..60164b853ae0764cdd79c468049= 0e66a548b0613 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -3690,8 +3690,6 @@ &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONLY>, resets =3D <&gcc GCC_VIDEO_AXI0_CLK_ARES>; reset-names =3D "bus"; =20 - iommus =3D <&apps_smmu 0x1940 0>, - <&apps_smmu 0x1947 0>; dma-coherent; =20 /* @@ -3701,6 +3699,19 @@ &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONLY= >, */ status =3D "disabled"; =20 + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0x0 0xe0000000>; + + non-pixel { + iommus =3D <&apps_smmu 0x1940 0x0>; + iommu-ranges =3D <0x25800000 0xba800000>; + }; + + pixel { + iommus =3D <&apps_smmu 0x1947 0x0>; + }; + iris_opp_table: opp-table { compatible =3D "operating-points-v2"; =20 --=20 2.34.1 From nobody Fri Sep 25 11:12:36 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA5463F7AB4 for ; Sun, 13 Sep 2026 18:51:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325468; cv=none; b=EKMTE51T3O889Tb3pT5tYGcl3H5DO+54hyqGecFKXx+uzjvBzdbobIiCqVeDs4ZTxdYV4qDR87NJSAJ01b5uZTEO4VI4GNVPIIPW5OyoWBWEfAMVPNRhMHQpnJ5uj1pJT73FOl/pwraUCkmX334U5SvynMI+urBlFhuAvcss47w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325468; c=relaxed/simple; bh=hSjOhcc48OJghLc+5hynLFQU9EGrwxyIHApwVUWJDT4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eprci1v20HmEJtuDEg8hgIzzVEvnbD+wPoF9Od6MWgo/u3DNV95MIjvYSfwU0ndYPmoul/DnTllf588rmIE+Lo0Zn8P0XVL9qU+WdVMdxpawNXOCKiTQMBzfB41SCxtHUZuhEg4Ih2myjcH9FJFmucbC1Grm3zLSPLkUih3BaEg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=a6wEii+A; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ZbdB/srX; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="a6wEii+A"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ZbdB/srX" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI2bh82450902 for ; Sun, 13 Sep 2026 18:51:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= JAqVWluA7QrGCFj1n7kbIXyDpI8LEcOYb0AIJAcvUOA=; b=a6wEii+AcrYF/jNb fTL5eJGPrtG/DS06S8C9poMnseBMYrKS9DeKEvlJlGnPfayvDTZd5CqrIn7UXxqj 96/JEs57jDJifjTh3Rf9mcs2c3AjbOksWMb+dUm0DOJCGe+YrDONdJHd5mGdfkGu mh14gfgHe4ZvLobuQE6r4Sg5JqesUqPji3epcdehdjsiwd6mVa70X2CW3KjYuTvr W9VRyizxRLBJLJBfMFM870UHvePPIVKetafsj9YNjdd+3R4SmVBc13vGtyPFAnI4 HI2jzh6T0G0MYf7mWaGPT8x8Q0WuZnTm11T7celbJ9uTdGKGcPoOFFyfwvwBvxby U4DDgQ== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9d3wkf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:51:06 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-cc2229450b4so2180500a12.1 for ; Sun, 13 Sep 2026 11:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325465; x=1789930265; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=JAqVWluA7QrGCFj1n7kbIXyDpI8LEcOYb0AIJAcvUOA=; b=ZbdB/srX3GiEq0eud0PxZm3hXiMcrxAejJlXW7UNT+ZKGpImUlkNuVJex5RLtTmokC ML2Bbvyw2gQIFN9rU0AgkzACO33MdQMLacRnKcv1gERhoF3bkGnPvsNSGcceCgXyG1zV pHytur9/h/VXWV7fpPyugdm2MJOj45TWqNwFa6g4HTpLDsRQNvQ5JIbQFXuHqtXX78+5 rCve8zLKkHp57+U+pdkIKFUt14LEUweE+X8KEMzzqk787FdpAM89EaonYAnC6LdESvAD lvsidrYq2Sp+fI463A8e+Z11ReyuMC+P3P4R7dBJn9euAp4VDEbWx9stxxPiIR+ImM/d l97g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325465; x=1789930265; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=JAqVWluA7QrGCFj1n7kbIXyDpI8LEcOYb0AIJAcvUOA=; b=BDYZKiWyIaIs25GG/U6xPkZaDtnwc3aN3n12T4HH4cf7wUwHypDl8LAdrCs2n/9bzW a5u11WsncCfyID2OC63eLf0QHOZp5CCFfXBayMr0cT3MagjKe+JEvOMRSC9khmom7vK7 OIMmXoENwK6IA0d/xeuejFZkp0SjvQE578mEeD4uetvbZPqFp5UkaknNDXfd5yPXSyXb /FpAsuvRF12/DRtj0KNhVSeveGoEReG7ehWH9O0HuXTSYQZKXJy8BZ1fzePNOuHvQtNu mMpQJy6hwA/jnyrbCF4ckrKPucxzwlCHw4ZPhzJeYzKZS/osVrNEFj/hWVqGHSZWn6d7 sa2g== X-Forwarded-Encrypted: i=1; AKwUvBxIh++SDIuOYEDViTNbSyGRL0P/kBKJYctuOonzZIrnLNv6jmLQUhhi6SjJfSQmgXq1GX18XL4Y4m2ruCo=@vger.kernel.org X-Gm-Message-State: AFuF++ksMZlzXaCAsRMtl4kOwAnW0IYzFc2WIOSzt1wwb3Bz3SXabEQk 9A3BU01UgctueX3lZlEhGDhSH1ACImOzgqmL/khXZ/l+J21eK9FLCWcnQesvLvwN5WQRcPfJYCn dKliZ8ZCA8xjZrFMhcZXDAABqm6M5b92v86us3VPreQmOgk7bnPJ7lozSglAZR2nEAV0= X-Gm-Gg: AYBFou3kgMNt07y/h4xt6a3n6kIpVKUUZkvSejckNHcFbulEB1lP1H6IG2UTL0xrcOO 1TR16xsb1iQJbT7kONjfRZtrWI4lXdR25WWuaTfGzKU59+7zhFujcFPfwPwQpVX771/9srMWlcO sAb6PRqKIkd3FtWJz63dlcWPaJhGEa4KKhBzwcQDIDdvnB1TFcouRF9BgnjAFABmJ1isCpaNCkR 9yHr3XgOHMgayis2/JYE1NBlR4vyOQqvZf6zwl4O1sy0BaeTZNdVzkTaFDB2IdSgH32mUO7aMHf 0IDxL5320IEcxQSSls1/oJod/MQbO+D4LAmoz6ARdmNWl8oY+1fuubLMzOy8ThLld7cg8L7ycOF fXUtNO/fBMtNqD9moC/sI6t6G02kriS/Sx3Q= X-Received: by 2002:a05:6a20:3c8d:b0:3bf:7e2a:e874 with SMTP id adf61e73a8af0-3daed15360bmr29215140637.1.1789325465275; Sun, 13 Sep 2026 11:51:05 -0700 (PDT) X-Received: by 2002:a05:6a20:3c8d:b0:3bf:7e2a:e874 with SMTP id adf61e73a8af0-3daed15360bmr29215086637.1.1789325464863; Sun, 13 Sep 2026 11:51:04 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:51:04 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:27 +0530 Subject: [PATCH v4 10/13] arm64: dts: qcom: lemans: Add Iris context bank subnodes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-10-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=3217; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=hSjOhcc48OJghLc+5hynLFQU9EGrwxyIHApwVUWJDT4=; b=rNRYR2UL+6T+Y/48EKnbZEZhgN2E1kCdWuexvsvexUC1FXasDOTGl0dVgyL7S6L7yqUiwHPkQ AeWD3PV3JnSA9ir0zeujjgzPioZI1LuG1StoJZP0bpFuv0+1J5quea1 X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX6JKMK2v51gtv 0d9zUCrOcKS1VLIuj81pKJMxn1CoGn8sU52xGeVbH/whnMi8eq6xTaqnTXHzSLLL6U4MgclGKix /S+Prvua2eOQJZQqU/f9f1agGMUTv5E= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX4CM4orjD6rES cA3VIXCq2b3eFUDoJc8jL+NFa/AvGpZw713HYcwcuK8pOMJMK6SdoIyI9WqF5Pa03iiTFFdTBBG FPihXvnSZSAqmNIwv0u318SnP7z/hYbolXswYz3UiaNxNo1G0LDUSBhAdzT0aEc3EcRDttM4BLF 26G1ibKtPok3p1JeJgLDw3ft4SOt82gKmmo6g+9+N+8ryr4zuqbSoIL7leLBaDuNEB+d1ZQT58y coIsuRrIgoDPDkfrwiPUofOMrt+YsvEvnSQIIn8FtjnXvivLh+QhbHi3rzMGe6xG4ZuSnL7rK+c txC06Z3cFOWyJwbUIK/tt6In3EoUGv+vUEf3jtqF75jWn0dJ9ZLVU7JPF0nA3MEgWzpKnJYAsb4 HWBHgp9blpjHHn2B6L2ANARGHn9I60V6NSTD8Pxi7ei+DzNIj8e5aBxqJKofUsIbXxTmVhjBDXq lBOcEm4oGkPfy4uzdbw== X-Authority-Analysis: v=2.4 cv=IOSXmQvG c=1 sm=1 tr=0 ts=6aa6f09a cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 a=Vxmtnl_E_bksehYqCbjh:22 X-Proofpoint-ORIG-GUID: UBMnSrnNxBvOkWHyYztUS1N5bdouzQoB X-Proofpoint-GUID: UBMnSrnNxBvOkWHyYztUS1N5bdouzQoB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 malwarescore=0 phishscore=0 adultscore=0 suspectscore=0 priorityscore=1501 lowpriorityscore=0 impostorscore=0 clxscore=1015 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 The VPU issues DMA through several SMMU streams, and the hardware does not give every stream the same addressable range. The non-pixel stream cannot address the low 600MB of IOVA space, while the pixel stream can address the full range: +-----------------------------------------------------------+ | non-pixel stream addressable range (600 MB - 3.5 GB) | | 0x25800000 - 0xe0000000 | +-----------------------------------------------------------+ | pixel stream addressable range (0 - 3.5 GB) | | 0x00000000 - 0xe0000000 | +-----------------------------------------------------------+ A single "iommus" property on the video-codec node puts every stream in one IOMMU domain sharing one IOVA allocator, so nothing restricts a non-pixel buffer to avoid 0 to 600MB. Once an allocation lands below that boundary the hardware faults, which shows up as unhandled SMMU page faults and spontaneous reboots: https://gitlab.freedesktop.org/drm/msm/-/work_items/100 Given that the address range restriction is for specific VPU stream, it should be ideally be moved to that stream. To achieve the same, a subset of streams is now represented as subnodes, so that each can be associated with its respective addressable range. The design was discussed and agreed by mainatiners here https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org In the past, this limitation was addressed with an iommu-map approach, with the iris driver dynamically creating the devices. That approach was later concluded to be a hack to avoid having subnodes, and was NAKed by the iommu maintainers. It was discussed in detail here: https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org/ The video-codec node includes address-cells, size-cells and dma-ranges to declare 1:1 mapping for DMA translation to the parent. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- arch/arm64/boot/dts/qcom/lemans.dtsi | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/lemans.dtsi b/arch/arm64/boot/dts/qco= m/lemans.dtsi index 695eae1b7256911e656ab1ecdd92aca135d92f39..afed5e43b4fcda8b8400e815d24= c5094834677f3 100644 --- a/arch/arm64/boot/dts/qcom/lemans.dtsi +++ b/arch/arm64/boot/dts/qcom/lemans.dtsi @@ -4962,12 +4962,23 @@ &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONL= Y>, resets =3D <&gcc GCC_VIDEO_AXI0_CLK_ARES>; reset-names =3D "bus"; =20 - iommus =3D <&apps_smmu 0x0880 0x0400>, - <&apps_smmu 0x0887 0x0400>; dma-coherent; =20 + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0x0 0xe0000000>; + status =3D "disabled"; =20 + non-pixel { + iommus =3D <&apps_smmu 0x0880 0x0400>; + iommu-ranges =3D <0x25800000 0xba800000>; + }; + + pixel { + iommus =3D <&apps_smmu 0x0887 0x0400>; + }; + iris_opp_table: opp-table { compatible =3D "operating-points-v2"; =20 --=20 2.34.1 From nobody Fri Sep 25 11:12:36 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D90F03F7AB4 for ; Sun, 13 Sep 2026 18:51:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325477; cv=none; b=tfAmTJMfXD3frSWjg1kX3RgAii8G391I3QNONA4Ukw6wQLoMZ6KF3n+JehBmQ3oqWYFY/5XAb5rtDvKtdHCmi912JiIIWYeOzxC4CZ7vA+2tF74yxq0NveOt2d3Ec2LX1MGQg+3azurNJXLfffZ0c65QzZLhZ9llJ7qBcTTzekE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325477; c=relaxed/simple; bh=3kFVW5Nz6U6ecZ7e3CWStkI5fGjySwII8rzzk5lKC5I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oQlPwdYjxAezB85jV8qduoCijvIsrwHo7i1FsCUHjkyLOzR6obDSPjbXHBiPtKYJuayqSG+ydY++BKZVrgr1ZhH5RgNKo2Vsx2RkFfeO60VPodfmhDJHTWX7j93zG3ea2tXKHy/vP/eYAmWPN5d728muxTgnNrFvqSSw8X1LVV4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Hqm7yuvJ; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=UCjJ/0G6; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Hqm7yuvJ"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="UCjJ/0G6" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI2aAQ2395618 for ; Sun, 13 Sep 2026 18:51:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= cZYBA7KJEqE8Qvpi2+pbZkng941B30M0z1x+yOLpprU=; b=Hqm7yuvJBqKI1+lz rkcqTsimc3phZTJYSvBUx9/Suk91lIs/QXAhGroMhN2GuDB6vuQ2jsMYIUBuLvEC Xy0CZ7z4ino880kpD9QpKu9aKiq6nOT9UHNm9DUMf3Hi6yXgHdoQrfk9ny9ZY9Fb Qy0PbCYPW0HLqbkSx1b0f2ooOUxONwkgdwZC5GCg4eqFUd22jKy5brr+hy7i/UOG PxZlADJCA7FpEoFlzdE9TywGhIVxHghXZ04CNzdvGSkj/3g6RhtMfeDjqQbmgYkv sIIA9qrTti7W1BmuVl7N52Cr6D6iANMOr0pk39CXi8gMLWio6fj9ZogTOUZ73BBt xtKQxQ== Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9c3x8q-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:51:14 +0000 (GMT) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-cbedb8673ceso1799492a12.0 for ; Sun, 13 Sep 2026 11:51:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325473; x=1789930273; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=cZYBA7KJEqE8Qvpi2+pbZkng941B30M0z1x+yOLpprU=; b=UCjJ/0G6HCsN3SuxltrSgfgk2HLZ92s8KgUkdQj9atqPQN4LlBcJmK0Xy/jN+uqjyu KbXZJMnPGWmdLpI0xz4l9ruS8dgHN4l6QfAQQBHcCE1BE/A9nDQc+JyiYZnijCOesP8n /+rL91xEVBGh53czh6YHcoQCfjVe/9Akiz7V+ir8GPNbBmhNtUaNg/33TSbffP7gbUTu zRZQf9eZN5Ljszx3Pe9BaTWXWgAmO7Ftr6ZT3gCFuqATw6jXi5LTUS43NU2v9kpWCXRf 3721IR7ZcvQJxQfmLaKnpCyxvKZ5Fj901U12bvSU0X6KtqTdhCgVSDr3D6vDJcviKpV/ U7rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325473; x=1789930273; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=cZYBA7KJEqE8Qvpi2+pbZkng941B30M0z1x+yOLpprU=; b=pd5bAbRElZCEznftNE6giemkJjfH8Zyvgi6azZRyKMuN/SJIUZMFErZF0uok8p5gy/ 1uAUsPAuN04i2Mf1CFTcY4afX9d/ToieTaPnKJ3xEU2muXM522li/URJpZdJjgmQUzhd OTULibnq0jV8b4FO4zMZohAD8OjhMmp11iiTqRtsgimRAFv26Y0ya4p2xv1hlx7hnPqt l7td98+c23IJCCbY1oK6QyaK74lXORFa2enw9MCTVw5OES+pMzDKHj64Mcl2TeizOSXK /skxkPl0wQzeNNvp9hunKV3x+vArWXXngOAYgGHpKdr5vQaj0wlgyIncAn3kKIgTKq3I k7xA== X-Forwarded-Encrypted: i=1; AKwUvBxMLTN31Fl8NUO+os1mpQwEy7Ej6/xdNAADv5UeXb6mn/ntIqV6ecgOXE0jpC9eTuNEXdfwCWECr0aVQ5k=@vger.kernel.org X-Gm-Message-State: AFuF++nerPxLntEh34SHh5ZfL691lbvIqS3iLSuOS2zdZ40pCV6NHv1c Tk4V987glhxdyF9WFnfpYDXYRpKath0r31uAhAdnqiUYgqLr/nE91Cz9LsMR1wfMWz8n4AYOuEG JHJHtyQCEocBSmw96wZlpfDcaO05BaxXrb764aDtvuWjlWIPbVQ/6+kR3860/d5FeY7o= X-Gm-Gg: AYBFou3PisABpqY9OIvshoClJh25qFCFBNui2fGDzLxIJnHo/cm5hy9PP+Gjut/sLet hg6WYVHnO1roW5KKvqNy8BZn2RoALi1ijFx30vtkPLPt7+U3rvQDzEBRW21+eBtm6zW4Q11Sos2 DdVuXM+q/Xb/oqSnFPTTaa8dH/7bvCBpNxdZIjp9N6gb2yozTf34zKTUT0Uno9tjg6McH9mLKt4 dJrTiLnYp5mmfkXaxibjJqMtOqZKAmriv4p8lwGs+oHcKL5zmWTID+ntJ14dTirma9O2y1uGYqE 13Ns8hPMqKLXTfBYW8XQcwRJVmBz9dGoQCR2sUAlcBtOwJYNYNgoXej36zbcqb7S6SE3spffF4F ++9/m+zfHPwHH8gut+RjQ17dfAQGjIc60RYs= X-Received: by 2002:a05:6a20:7f96:b0:3cc:9288:99aa with SMTP id adf61e73a8af0-3daed1e2566mr25624895637.0.1789325473218; Sun, 13 Sep 2026 11:51:13 -0700 (PDT) X-Received: by 2002:a05:6a20:7f96:b0:3cc:9288:99aa with SMTP id adf61e73a8af0-3daed1e2566mr25624843637.0.1789325472770; Sun, 13 Sep 2026 11:51:12 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:51:12 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:28 +0530 Subject: [PATCH v4 11/13] arm64: dts: qcom: monaco: Add Iris context bank subnodes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-11-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=3217; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=3kFVW5Nz6U6ecZ7e3CWStkI5fGjySwII8rzzk5lKC5I=; b=uRbsrG54rSlIvw5dxswkSgYDuPsgJ7WI7yRlR7+lQVnsjs2QW7OI8r4fYwTgXzrYpF4nCcI7L MEnv4CCIL8GA8mIcMYksG2nlnTQoYmle+Dimp/KHEEiy5x0Fa/Hlvj6 X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-ORIG-GUID: z5OlohW_eB3M6-YuYUQmRMuYi2NLTRAd X-Proofpoint-GUID: z5OlohW_eB3M6-YuYUQmRMuYi2NLTRAd X-Authority-Analysis: v=2.4 cv=c5Y+0h9l c=1 sm=1 tr=0 ts=6aa6f0a2 cx=c_pps a=Qgeoaf8Lrialg5Z894R3/Q==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=x9snwWr2DeNwDh03kgHS:22 a=Vxmtnl_E_bksehYqCbjh:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX3JXmBDXpJpIk enkveZpbwlZrMuykHVpMPqSIA/W0sZt02Yb4CeCpVhS5fZWVLCPJfTtoEctCrmsQKWaGBKnTUsn laZcAPxGFCdHL2hzqhKy3tVY1jDi9JQZ5cgGJr3E79PDV/1NncrchBGo7Aj83Hw5nKMMN+Op42p AlLO9Q+fuH/zraggrl7WCRfeOZBxNbamtzZ9F0STpXx+0eSBXVK8gessXzLm8tO0YeEsR0VQOqY fGi5kAa2cGpt2axQ0ZPLqG2Uuy/biVeu5MyqdTpuOuW2ZjiCF+QWmO+BHQXwDEuBmF3qxwNsoRM TE6HbQWl5F2ZBFEeqvm7wX2VVLcAW7WfMENXVZb4Y0y+Lb7UDMkwsItuPw5wr6Klup+IgCMNSqT LZ0sdLhtibWxMfi62nrNT5uFc6j3PXfVYgDm/6lPZcQltpa781ulfyytem1VKxP/Er0ckS5IBs7 6anaSytUmn6UVi35cRA== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX66hRWwFCYcYd /NVyvKfuh7xDqwwvVjCkLeWr4IFKcDV+lT8qvArNulN7Bvb7WiZ7Gztb2cHoB5G5s3O39dzBKjx M9TCXVm0sqfVQQlHS6MKPQ4vf/MRavA= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 bulkscore=0 impostorscore=0 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 The VPU issues DMA through several SMMU streams, and the hardware does not give every stream the same addressable range. The non-pixel stream cannot address the low 600MB of IOVA space, while the pixel stream can address the full range: +-----------------------------------------------------------+ | non-pixel stream addressable range (600 MB - 3.5 GB) | | 0x25800000 - 0xe0000000 | +-----------------------------------------------------------+ | pixel stream addressable range (0 - 3.5 GB) | | 0x00000000 - 0xe0000000 | +-----------------------------------------------------------+ A single "iommus" property on the video-codec node puts every stream in one IOMMU domain sharing one IOVA allocator, so nothing restricts a non-pixel buffer to avoid 0 to 600MB. Once an allocation lands below that boundary the hardware faults, which shows up as unhandled SMMU page faults and spontaneous reboots: https://gitlab.freedesktop.org/drm/msm/-/work_items/100 Given that the address range restriction is for specific VPU stream, it should be ideally be moved to that stream. To achieve the same, a subset of streams is now represented as subnodes, so that each can be associated with its respective addressable range. The design was discussed and agreed by mainatiners here https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org In the past, this limitation was addressed with an iommu-map approach, with the iris driver dynamically creating the devices. That approach was later concluded to be a hack to avoid having subnodes, and was NAKed by the iommu maintainers. It was discussed in detail here: https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org/ The video-codec node includes address-cells, size-cells and dma-ranges to declare 1:1 mapping for DMA translation to the parent. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- arch/arm64/boot/dts/qcom/monaco.dtsi | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/monaco.dtsi b/arch/arm64/boot/dts/qco= m/monaco.dtsi index 395d32d368443e6c73b934b183c3de007ca2e6b5..89ea87a274a159da872facb688c= d742d8d28f3c5 100644 --- a/arch/arm64/boot/dts/qcom/monaco.dtsi +++ b/arch/arm64/boot/dts/qcom/monaco.dtsi @@ -5403,12 +5403,23 @@ &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONL= Y>, resets =3D <&gcc GCC_VIDEO_AXI0_CLK_ARES>; reset-names =3D "bus"; =20 - iommus =3D <&apps_smmu 0x0880 0x0400>, - <&apps_smmu 0x0887 0x0400>; dma-coherent; =20 + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0x0 0xe0000000>; + status =3D "disabled"; =20 + non-pixel { + iommus =3D <&apps_smmu 0x0880 0x0400>; + iommu-ranges =3D <0x25800000 0xba800000>; + }; + + pixel { + iommus =3D <&apps_smmu 0x0887 0x0400>; + }; + iris_opp_table: opp-table { compatible =3D "operating-points-v2"; =20 --=20 2.34.1 From nobody Fri Sep 25 11:12:36 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 21DE9406270 for ; Sun, 13 Sep 2026 18:51:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325487; cv=none; b=Ksvr70ArBSt5lFpEUqisPtVn+ORK1jWFT3EhGY//Ag9qvcVhgs/XqklmQOIU/aVm1jgX6uCcIzRxDVZMJMEd1Pg8CthsFXUcNuZIlDZbICSf6F7zI/g5LvrqpE0d6uXIcZu+zUH+SF4tw2tQAT3iu471A4MY6fs15lJQMaoNaoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325487; c=relaxed/simple; bh=XZTtH+KJamke7BFQt4SKU9GHxEgBbysv5OHmqTqkLnA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CNIAfk4qU82Bl5ilFkR2DdpwLcDWE2nvLEWn7ZgWE67BwlYYhwz8zoVL2EsA2IM/KzLVh6CrCyj7B1h+G66/uYFqNvulkDOhCRT+vFEnbjJ7VSlaid8gwhNkkNteV9aBtKB74fc3+ldbUqcEniySSROQJSigqSntFlN7txSHQCE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=YnG1P6rN; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=gdLx21Qg; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="YnG1P6rN"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="gdLx21Qg" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI2bt23284353 for ; Sun, 13 Sep 2026 18:51:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Q2X//wdUyighhdjTu9aFC9mEc3Ky0vJevf2387nQX+A=; b=YnG1P6rNVYvQj7N1 0JRSiheTe5dwHdZ1yYPoC8K73Y6fdz3lsSxvQzLGnLBFiaDjZqibnzkLuybNnZLj PWm+36kedWfqlFiL9ywbNllZxVDfhuyuwwl+A7Kgbv6bKtVU+QG1pGMDuseDZ8Gu O5w8up4NNpOXW8SJ14ubeCa05DvnMEWmCFYutHBDJZt3i31k0CKgEvtu0wOioXnV a9ckf+Fx5tyhjDeWWoNoA2+1dwc6b8Xrz1TgmdPpzPnBGTuivpglI4eDgiGAvyXx 2A1JNrBcQ++35N9KlZeK4u78VUxZzxXbnphV2BU2pZ2XuRtHWItpu950tFtHI3Fw sNDYrw== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9cby8m-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:51:21 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-399311947f6so4850040a91.0 for ; Sun, 13 Sep 2026 11:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325481; x=1789930281; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Q2X//wdUyighhdjTu9aFC9mEc3Ky0vJevf2387nQX+A=; b=gdLx21Qgh1qyJDSP4yRgAUZXRz0ca+BS57bDctsdd1GjY9dq7zZz8ulbnLlqfRLxJY DbC3B/eJj+Bm2+l7cduelkZZX/DWoIZp5td1JzCYyYIRXNDJO9FG0q9b45HvKacXkkSV 78KNIsx0uXoR7BKW1PQGnt3yAd5X1s/w9MZeQPAIuFqq99A3vv4nz5xQlmwA0DvGOaYY 0GKtO51GrDPfhUOyPAIK5pyZRMwbeR647ADqAdvBVjU0jF6QBGA/U77bxQ7yghgHwTke gz3tbN1j6eSBJ6XQkKXLwUPqMXLoNdtKiIG1jAj+sq0UBUhtZ23HCLPGaa0ygXp8Ba8U QC9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325481; x=1789930281; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=Q2X//wdUyighhdjTu9aFC9mEc3Ky0vJevf2387nQX+A=; b=B0FrFcUWLx+3DCWZPayKzcPbG0dqhct9lU8BuKRYUEmPAIa2OnzMJ8EU2RK4RYhV6F IpU5RTXEZUMpBE0ZInbHFoXnhGUnDX263BldtdQUycnGMk3Ny9kJrWxtth2JV9R1wuT5 acVLFm2IbcE7J3k4D+sqRkTJLSwt7hqWyhlp5/WmA1tQWXwudcNXyLN0ttS4A3VRZFRJ Sk9FUendGSMUPY8VWM7U/RW439Gs2nNgRbfMt6KowW8n0VaepGvLcdDyL+DGTIza2iJu tRXD1Wo8oR74IN16DyoeY1iT5hlIZ2j32wUzzoa6e8qXzM8gIIRSFBYb+UBOGu4ptEdu sq6g== X-Forwarded-Encrypted: i=1; AKwUvBxNLTL35McaFcnbSl2rt7BnCcs0SbRPrCLQyKvvMwGU0vhk8KN/aWTtcWcaTKSXlic6lwq7RBXtFEToV/4=@vger.kernel.org X-Gm-Message-State: AFuF++kaWsrgZuJeA+Bk1oihaMwBec8pMl5WiEdNd8Rf33xToDrA/aXm xVBW4G+BU3Hc8KMAdo2gAb6Cbz/RNnfBuHyLZ1NA0uJe0Q2gDP/UaA9iooGpt/3XN5/2Z2ZXE+f G4ybhmldfyD87VTw1/Y1dX3bAsPnnkFeEu+LnUhUw4TWsHCM+nJfEDd536ycVucPI/otTs7a8DD s= X-Gm-Gg: AYBFou2PHGmkOQic+YM7fXDSDym2rU+fBtmoOodMGKfo1MPHURa7cPz4/TDKvwoQIKz mc4WJapMqvy513eweMt2tq9t7CiEd3mQJ6JVFs02a8Hq6LhrCFClEyWduYSPS5NCv2rPXMpLJp8 WkrIJfKFTueA4Tue5DXSIPqbh8I3v98PZxBeynoC6bOy6qwGfkgxZ//5NSi+3QGHDjvNjLGLwYr JIA3wU5d9L4HpFm6ikUE18sFyFFagFWqWuFDc6OXyfZLmVwlCn5U7Gujs3LDXRQPydGQpX2VVr8 a9HfrqmHTr/Nd2Hpm0/VvYfSMTGh2E5R8cOyl+YRfwDJeiE1WSzj0okl4V7ZZLN0L9+k7i1bbef kgTe+5m1+rr+tMusQ2bUKAcGME4VeXeJs0oo= X-Received: by 2002:a17:90b:5283:b0:398:9bd5:490e with SMTP id 98e67ed59e1d1-39dbc6f0818mr15864242a91.21.1789325481140; Sun, 13 Sep 2026 11:51:21 -0700 (PDT) X-Received: by 2002:a17:90b:5283:b0:398:9bd5:490e with SMTP id 98e67ed59e1d1-39dbc6f0818mr15864196a91.21.1789325480726; Sun, 13 Sep 2026 11:51:20 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.51.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:51:20 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:29 +0530 Subject: [PATCH v4 12/13] arm64: dts: qcom: sm8650: Add Iris context bank subnodes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-12-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=3374; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=XZTtH+KJamke7BFQt4SKU9GHxEgBbysv5OHmqTqkLnA=; b=3nR06g4I3fBs4o4T5XyN+m8O+pKFq55VzseEc6i5f+1knjv4ynnPHTfHqGTC4ufsLP9OOFxdo GmoP0kLA6X4DkjwqjCtu/xGJOLXc3FWdrQYymwfSkvKVr1uhi+5WF+h X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfXyY8ZCfO14eZv aHJ83/F0OfEFxZ79/y2+EVCXK/9PbmphQMwPa5bk2lC/fsgkGLeaxkpHuEpKlqGVv8h56KxaiXH nCj3DgkcXDFVn0y+4a2KERm4ry3Ze5E= X-Proofpoint-GUID: JLFFfLGwsQ1KpIazxUm6MHkIIcW-OPuJ X-Authority-Analysis: v=2.4 cv=BdZNQbt2 c=1 sm=1 tr=0 ts=6aa6f0a9 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=mQ_c8vxmzFEMiUWkPHU9:22 a=Vxmtnl_E_bksehYqCbjh:22 X-Proofpoint-ORIG-GUID: JLFFfLGwsQ1KpIazxUm6MHkIIcW-OPuJ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX1X1WwTwCBVtW M4Zp1dyV/GWF8kOI1OQR+kQvIfaIrTpfZRoTJQ7565pmDcbPAManGY/WqzpvEzVTIuCIjL5/r5/ XQQ385KwXT/BTWS+u7jfDjanD7B1MT3l44bZbEvRldtXXqx0QPRDhfUx/EwU08JHYB3Sn1Yd62Y 6MT7eKgm26CpHpOIn7p1fZ+4/5r+ubShL4HCKh45nlIQIeJ5X9P7wT+fCtlrOQjjzOJSqtUyoKN tLbrssTj4d/GVlURkBJyd6Q37Fbntgy1fNVQx5EnD90JGPTfmGtXcZ+B8TL4J41mhRGPLylBeFF 66LBz2L3qVvKKSzW3HeeNpWtfr6Iz8i+i7xT/qmU/YPL5Yco+p9UFj43w7xqi0IFm9gYIULXstJ PLlv2n/CIChS2bXHnKuCszcaf2I6k4e1SEA5wD7+I4Qaiv8ywTPpF0fRnbqrYBUMrjjjaMiz4+0 KT5m12An87WGnfGf15g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 adultscore=0 malwarescore=0 clxscore=1015 spamscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 The VPU issues DMA through several SMMU streams, and the hardware does not give every stream the same addressable range. The non-pixel stream cannot address the low 600MB of IOVA space, while the pixel stream can address the full range: +-----------------------------------------------------------+ | non-pixel stream addressable range (600 MB - 3.5 GB) | | 0x25800000 - 0xe0000000 | +-----------------------------------------------------------+ | pixel stream addressable range (0 - 3.5 GB) | | 0x00000000 - 0xe0000000 | +-----------------------------------------------------------+ A single "iommus" property on the video-codec node puts every stream in one IOMMU domain sharing one IOVA allocator, so nothing restricts a non-pixel buffer to avoid 0 to 600MB. Once an allocation lands below that boundary the hardware faults, which shows up as unhandled SMMU page faults and spontaneous reboots: https://gitlab.freedesktop.org/drm/msm/-/work_items/100 Given that the address range restriction is for specific VPU stream, it should be ideally be moved to that stream. To achieve the same, a subset of streams is now represented as subnodes, so that each can be associated with its respective addressable range. The design was discussed and agreed by mainatiners here https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org In the past, this limitation was addressed with an iommu-map approach, with the iris driver dynamically creating the devices. That approach was later concluded to be a hack to avoid having subnodes, and was NAKed by the iommu maintainers. It was discussed in detail here: https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org/ The video-codec node includes address-cells, size-cells and dma-ranges to declare 1:1 mapping for DMA translation to the parent. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- arch/arm64/boot/dts/qcom/sm8650.dtsi | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8650.dtsi b/arch/arm64/boot/dts/qco= m/sm8650.dtsi index 99509305f9702addbbf3f4269e558e08d0bc1b25..88233c1f6107c5fbc0f0f68202f= e6383abb10f3f 100644 --- a/arch/arm64/boot/dts/qcom/sm8650.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi @@ -5274,11 +5274,12 @@ &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONL= Y>, "xo", "core"; =20 - iommus =3D <&apps_smmu 0x1940 0>, - <&apps_smmu 0x1947 0>; - dma-coherent; =20 + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0x0 0xe0000000>; + /* * IRIS firmware is signed by vendors, only * enable on boards where the proper signed firmware @@ -5286,6 +5287,15 @@ &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONLY= >, */ status =3D "disabled"; =20 + non-pixel { + iommus =3D <&apps_smmu 0x1940 0x0>; + iommu-ranges =3D <0x25800000 0xba800000>; + }; + + pixel { + iommus =3D <&apps_smmu 0x1947 0x0>; + }; + iris_opp_table: opp-table { compatible =3D "operating-points-v2"; =20 --=20 2.34.1 From nobody Fri Sep 25 11:12:36 2026 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4697C3FA5F8 for ; Sun, 13 Sep 2026 18:51:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325497; cv=none; b=pj0cDFI09OSSU78jb6aebmAIpJUaCt0i/xDmBRGlcDxsW/giBEts9bW9BfACIRY0RS/rW80XvOqWPzW5/RqIWBSTcztM8zpsjaQ8bDAv0ctLeBH2dEYd9HWbIFkabcFmXP3vJ9Gd4asCs080PaRtdrI0QXujN91CmURc1ETYE0Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789325497; c=relaxed/simple; bh=gYrrWAAu3UM4XmJOH+Y9uqQA/KhAPozl/f9r3EEBGVc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=l6ZHikABfd/U2Q+cqFLQw/DKagUpMiDyJnLUlpM1GkQkWGVvt0xJDqOdCZ7xV52o++qU7FIBmYdyfLURVvEBMw2XPZ2K2bn+j/FJ/c8PNNlJ1RNo0gEjdts73NHHdTbOdVKiHnsKe5jA7RvrrvwGKJnvzi4tQ6kvp0Wp0eHUYoo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=TAsOj25G; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=buKVnLmK; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="TAsOj25G"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="buKVnLmK" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68DI2tRB1749645 for ; Sun, 13 Sep 2026 18:51:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= lCZiOT9vk+oD3cSiqrNWNn+aGN0ogRGv3H9bL1TqTw0=; b=TAsOj25GPSVtV4cZ /HOAuRYeNMie3g7dc3xikFe5ZDW2CAiyHAw4p0icaxSyabynTTk33tA6b663XjV1 e03lpPhk0qEHYGfRKcVYOZ2NyfqK/6OMbqQh48vZ9USwls4ASZl8rZ6l55ug3GDv O9KOGR8iUibadvxRxA5pmHjsap/iNDLppaGaXQgVj43OnVmrv21R4b9NzDsCzkCn VT9n2siWRZI6CmeSbOn97Aic+LrVpdD7XeWv/PFZlBOXDHXsYQf7uH3gVIY4E0QS qxaAKN/dfh1syEopLDv1eEt/sEIMOfRvfdoGVzA4fghCkeKLfqK8SCWqKTUaFx6o Td0P0g== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gmy9cbw5j-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 13 Sep 2026 18:51:30 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-cbedb8673ceso1799545a12.0 for ; Sun, 13 Sep 2026 11:51:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789325489; x=1789930289; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=lCZiOT9vk+oD3cSiqrNWNn+aGN0ogRGv3H9bL1TqTw0=; b=buKVnLmK1g1UD7Q7mdUt5S2dCc8WivfxA7Y61Km1UDtn1bgNN5WxoHPdpSGPiUBVMu ZFleQdDWsAEPfvYvbvd8UAnWwEWNKFL6dCnll+wQGLXpO1A3minue0pfjNG2T3x6TlV0 HgfUkUtx6IBCUjMY/vx2mpGBTEb8y/5S9A2kJuFbVLsPEbBNv+cHAuqRUmzQwHw3b+9J g4AgxTOXB/Fxb7mLu4r9TyhTKXMoe0suovegSjaCSYA3zemMGgz4FLOfR28JLzuHGOpi RDnWotQWyayDQhDk35CMOuG4EjzLtCJCGErApQHp4Zz1IICmpvRa8sp0fsAZcLi2xWeg bxyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789325489; x=1789930289; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=lCZiOT9vk+oD3cSiqrNWNn+aGN0ogRGv3H9bL1TqTw0=; b=k4IQBTQFpg2ZrGylK/XQFdZ4C0iyrfyBqg/Uctdgjg811F4rJyL90pdQESwN6j0E9C PXe3HRW1WftJ4+ULuwtUr5IQVYnivRNSgvv0NWQoD6cu3biHvtISgO+eWqdVprm51OJ3 1nYYXSGMgdieOKCTl/PSorxf5fcdzJeu+H/YiUBvA0eViNeKhFNbaFOLT2doKl9ZH5a0 yZkB78IEVm6Y2TMUww2s1PKNMpFxqG3fQzyM+R+7nwGMQLps661T2dzvVq1mhIQQE5bx hld2Rg2PBP4jyOL21lbUuU+dtOmc+WeeG5mKefny/Q3Vckp451U8a+yJ4u7wrya1W5uR g6Bg== X-Forwarded-Encrypted: i=1; AKwUvByuMO/qtJy2VeOEC7AyUvnjM72GMjYXvvcwsELE8rvLMXDQnOA6DKGfQCdxi8HKpx5+UOIRRLmh5AYWqcQ=@vger.kernel.org X-Gm-Message-State: AFuF++mJHiXheXn3p89mWEbNAlx1h7i7F/XbVBOeokdi25GE43/hvRo5 pgXdKnFC7IUWuhP18lvtlSFRWBdpbosVygUOHuORuKNvJnDSUbfD8UO7l6zswpKJSxQfLS0dY0m 8DRdNunF+1nBFUdexbrw7X9rAfhtMs01XHputB3q2dAibn6xqx2F/vP51hdwihszM/LU= X-Gm-Gg: AYBFou2rx7RXSSdFmbpHEL0/L5qMjBwpUVotqmhzGS+E5SOMsVSpx4k9BESTScNLdS4 Pi6sthOESTA2u/QisDgXrj3daK2tWUlYI+++JqBhz+tB9IS3Ig2d283cwM/cejgBFP44bGqhhDO 88rcGrD6wVbo4GO0R2AHRo4BBqp/gI883OJ+Uu/3HLfI378q0XbunfirzSS4PCiyDRisYn7YJnr dnsuG/+nDSWDclD0gSzI637dCGfy1D3+8J0DR3LeJ2QBiMJlXsxjPr5l7zKvK8I/mgiEVZc8uVo No5Xfs2zjorS6XCymGSlAovOzU5QByw97MYetzlQrtQpp/nVRdhvmQHjLrzg1eWR/UxT2eFMCwi pSsRwJi6QyjjUMt2VGBwyIkltEX2Pof5yOTQ= X-Received: by 2002:a05:6a21:7e0b:b0:3da:f32e:b3bf with SMTP id adf61e73a8af0-3daf32eb452mr21465272637.17.1789325489150; Sun, 13 Sep 2026 11:51:29 -0700 (PDT) X-Received: by 2002:a05:6a21:7e0b:b0:3da:f32e:b3bf with SMTP id adf61e73a8af0-3daf32eb452mr21465215637.17.1789325488682; Sun, 13 Sep 2026 11:51:28 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4f55735sm22473130eec.24.2026.09.13.11.51.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 11:51:28 -0700 (PDT) From: Vikash Garodia Date: Mon, 14 Sep 2026 00:19:30 +0530 Subject: [PATCH v4 13/13] arm64: dts: qcom: sm8750: Add Iris context bank subnodes Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260914-vpu_iommu_iova_handling-v4-13-9b9074a73c41@oss.qualcomm.com> References: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> In-Reply-To: <20260914-vpu_iommu_iova_handling-v4-0-9b9074a73c41@oss.qualcomm.com> To: Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Stanimir Varbanov , Neil Armstrong , Dmitry Baryshkov , Bryan O'Donoghue , Stephan Gerhold , "Joerg Roedel (AMD)" , Will Deacon , Robin Murphy , Abel Vesa Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio , Krzysztof Kozlowski , iommu@lists.linux.dev, Vikash Garodia , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789325376; l=3606; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=gYrrWAAu3UM4XmJOH+Y9uqQA/KhAPozl/f9r3EEBGVc=; b=Y4eeAu0k6A/PwtRusPc6pQKOgvqS3Nq4tR3EDHA8bebt+tl9fO5k0LCZEe/M4OlMMlya8km8d rDFwu/fzA7bA9mLcVEPilGt8+xCC5/GeMbmbLGH7nxkzQP7G9Vb/84k X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-GUID: -I8gn24Xo_475P3EuBFFvpbwyOyqNCye X-Authority-Analysis: v=2.4 cv=Pv4G/AM3 c=1 sm=1 tr=0 ts=6aa6f0b2 cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 a=Vxmtnl_E_bksehYqCbjh:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX5PX3yTgBNqQN yI1IK7Ur8kiPT8t8cmPy+sLlZmSsc6xf6tWtns04U0ZcTkE26dAv8fN/qQwG5aTj4/AfuBQ0zuK vBraFtgzNH9v3S6WBaZjVigNHnfjv7I= X-Proofpoint-ORIG-GUID: -I8gn24Xo_475P3EuBFFvpbwyOyqNCye X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTEzMDI2NyBTYWx0ZWRfX65yJf1IJ8Qyd WGQZZQGenlkDrm32f/SHSP251hcJpH5pl2Org8qwiRHKBKdrZ5yHRJncLeE0mGPvj7DZqthfpaF 7ImL8rhc1Fu4MB+WrxbL9ednl21OxSr37zaqu7DTiudiviGC+0zFwcluqkeupLEsFSmyKq3ESw3 wr+rJS7JDFpqrMVs4gAvfWjbEQD70Qq7wSIIGdz4p/WDYEjnorotD+iVaLfxT/TClg5zOBm3sjC MJgj2u8/k8M+sTXeK6w4fwyUCkfjLLvTguOtblTzolhVOwVd5jU6eQm4M4CO82wZ1qXkyEhGmwS CaYa1Vj8POThETr7lQEZdgvjm+JHvYWM3v6oWf7V9v802MT/K+52FY2fVJFYQbgE3+JoA65vLqi AwJlZoT9RAMeX8dOcScaQmBEU3cu0OBRxNWVXNHUnT5Pov/J+GddvjJFyXS8GDYL2xxZmL5o0lR T7NUJtFSHDuK6WIa+ZQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-13_06,2026-09-11_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 adultscore=0 suspectscore=0 malwarescore=0 priorityscore=1501 spamscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609130267 The VPU issues DMA through several SMMU streams, and the hardware does not give every stream the same addressable range. The non-pixel stream cannot address the low 600MB of IOVA space, while the pixel stream can address the full range: +-----------------------------------------------------------+ | non-pixel stream addressable range (600 MB - 3.5 GB) | | 0x25800000 - 0xe0000000 | +-----------------------------------------------------------+ | pixel stream addressable range (0 - 3.5 GB) | | 0x00000000 - 0xe0000000 | +-----------------------------------------------------------+ A single "iommus" property on the video-codec node puts every stream in one IOMMU domain sharing one IOVA allocator, so nothing restricts a non-pixel buffer to avoid 0 to 600MB. Once an allocation lands below that boundary the hardware faults, which shows up as unhandled SMMU page faults and spontaneous reboots: https://gitlab.freedesktop.org/drm/msm/-/work_items/100 Given that the address range restriction is for specific VPU stream, it should be ideally be moved to that stream. To achieve the same, a subset of streams is now represented as subnodes, so that each can be associated with its respective addressable range. The design was discussed and agreed by mainatiners here https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org In the past, this limitation was addressed with an iommu-map approach, with the iris driver dynamically creating the devices. That approach was later concluded to be a hack to avoid having subnodes, and was NAKed by the iommu maintainers. It was discussed in detail here: https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org/ The video-codec node includes address-cells, size-cells and dma-ranges to declare 1:1 mapping for DMA translation to the parent. Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- arch/arm64/boot/dts/qcom/sm8750.dtsi | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qco= m/sm8750.dtsi index 28cf22da854d01413b8e86be3f6330354aad05f2..2e1e07eb5b6aa49850a7a5572ef= 9e755e298b799 100644 --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi @@ -3025,8 +3025,6 @@ iris: video-codec@aa00000 { "vcodec0_core_freerun"; =20 dma-coherent; - iommus =3D <&apps_smmu 0x1940 0>, - <&apps_smmu 0x1947 0>; =20 interconnects =3D <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ACTIVE_ONLY &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONLY>, @@ -3059,6 +3057,10 @@ &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONLY= >, "core", "vcodec0_core"; =20 + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0x0 0xe0000000>; + /* * IRIS firmware is signed by vendors, only * enable in boards where the proper signed firmware @@ -3066,6 +3068,15 @@ &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_ONLY= >, */ status =3D "disabled"; =20 + non-pixel { + iommus =3D <&apps_smmu 0x1940 0x0>; + iommu-ranges =3D <0x25800000 0xba800000>; + }; + + pixel { + iommus =3D <&apps_smmu 0x1947 0x0>; + }; + iris_opp_table: opp-table { compatible =3D "operating-points-v2"; =20 --=20 2.34.1