From nobody Fri Sep 25 18:25:35 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 38F9757D22A for ; Wed, 9 Sep 2026 14:57:38 +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=1788965861; cv=none; b=qW/JbrMZm0i1CKTeYjEAtOCNA9R7hJUH3rq6uV38hEbYBepitVxL81hxZQAA0DZwAT5mp7l4FuKtkO9FVmUa/VDvFRG+BGX9e/sz2HptgC8YpcZqAhYAKTPWC1WfH8a1bT4+atRy7H2rBtDLRBQ3jA9YRB9KKeIYW38w1f0r+As= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965861; c=relaxed/simple; bh=ClN1HxPqioNiIjlqriHYURWSJ/USriPE6SkA+Pha1Kk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pTnPCzCVbIPDOCnKNZW0PUj3vGhyZxQQ3WFq3v/LRTf+BooUK29RR9dzSzSOJxwsO8qtboX2IP4HypgmETLqH8NMHMyA9lcxpiwywPL/7H7eM/3CD4EazMi9J8Xolbybu7+/cjJs7+KS1RiD+V2m03rmkPxPr4QGHZyKlIrmq/I= 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=R7cpT5/+; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=KYrwvcwn; 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="R7cpT5/+"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="KYrwvcwn" 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 689CCwpd3053122 for ; Wed, 9 Sep 2026 14:57:38 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= W3824liDhpxEGBtUO3K6ahqQxpsQoUAznRXV0ie19fc=; b=R7cpT5/+Yc7NrvIL JJW2TMN97rsPWYV93VoCeucS7uxtzd22TBT7OWVU/XIEqs2O8JEcfQdbcnwP5mWE L1kcv236rmJapkN1jg+ZsOUg4d2Bx080EJitVd6JxneT3AYgHderVwuLysYAoEpg Nx7UXfihkk2tgUjvLR7xmfqDQmSjRF5xASYM1t5AAm49AQQULVWW08rxn30nQnZE W037BLYfJ9tlAbyhCwSieluh5Sa1+Momf846Rk+HDPkD2XDHZ6ynN5zDxs6M3p9b wDVOaTw5PtxiYTXfhr+ByrRj1vjkov8345PJoDILUMy50EjvJCftAu3SbNCh0cVC +gwEKg== 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 4gk7920qpf-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:57:38 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-cb835525b10so7063158a12.2 for ; Wed, 09 Sep 2026 07:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965857; x=1789570657; 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=W3824liDhpxEGBtUO3K6ahqQxpsQoUAznRXV0ie19fc=; b=KYrwvcwnsMLJIUjx3MgyYA2xHU0iNqTSfGB0e33gCuT5aPl8IRrfp/3S66WnHAhvER npmhugz2qIWCf7Pnd7INxZMH8i7NI/eHKp0B0ctVce6rLKhwiITHenT+/uwKgp4KM8Ee 71hb6CUGZdgaRYnUlVYzNvFQSSlvcTAkpl8dobFFtK7u39gH9LA2xhVKIPwcDOEY4ppB 80Qkwd4lkhDqG6IjBcuAU/R5f6zuXRRwoaRI23Jmc4sjS4vFhPUcDuYTxENw/M7xNzDl 1ZjCB+VHSwYP/dTOQVSWlbbofSVl45Y7XtwExR6qnrpAT43nX+5jIvaYAz/MFEo40RT1 1Egg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965857; x=1789570657; 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=W3824liDhpxEGBtUO3K6ahqQxpsQoUAznRXV0ie19fc=; b=gXaV5+j8OHpsTQyPcFrURrvkCr5l/O3fD3ZYCCat1phLzWbcfswZ2kH/W+6A7vFJz9 X6LBHBhhBxjZQROMFrBOnYXPqlhJroSdvw//yecOuWMjV9opO9dr4eFo72XmfkgrA1xK fO8hsapiyJIlPYGI06dEF9xP5eT1vUK36lv6FeqYPzdu950FttcZAAb0fV6YsPs0QdaI oVBbGlxhOKLyFYNGT7GZQdTVlWDj+K9tCtNAk0b1/aeXYDlHV0M5O4htI+rw7dh1VTmh M8fXgAmyLhgx45aWkqH98Etcf6IslVU4qnVJPq1Cj/T2htHeF+5vkOj0wjqce6o1/ckc 4Nlg== X-Forwarded-Encrypted: i=1; AKwUvBxdUeIlwvwzbM91IK5oTkgZ0ARKzl6uEQWDKY3TIqz7X2jKBA6fh27+lZ2U6xoPvRCOPvZ/ty2K5dLmIBc=@vger.kernel.org X-Gm-Message-State: AFuF++kcdsgFzyBuGvsMs/st/N+eIvhOdyyY9sVIxvwjI2xvLTz9LNZA XAkvdtVU0PLwJyLTydepfy1PtqSFwFznB1CwgppkridRuWwdbLIjZwW8m/lTz5EMcv2pNqbsxwn YcpjURLTeeYEtlUDqCNB0DzPgyO22X+VErSFz+KDUcpem6azf+/tK+rZZiCtjJVI1oLuNvGjNcr 0= X-Gm-Gg: AYBFou3L2S8R8yu1SSpRKl7hFSKmEkykvVjSbm7Zp3IuO1y9FwLDwWAcwCq/R5RR/PO I5ImFxdRD60TSFUTL0gyQwMVxaLOJBPyUbPciyOg9MCZyWwq0zpa3dWW+GyKopnXE+bYC10adr9 qFsWYk5wV8g9ceOGbIYvQg54UjmOtAo/AC8U1sl2edca+4NHFW8nHeN/Dq0HaXsl2qRVL+RqPPK RO8a9qdH0MpdbFkliKu1ncK4618e+GaVNmX5oCkmRLuQxSZQtC7KUu2kokglsanhkeioLYwMf/0 pwJx0RloPXA2JUzCnkpEd9Khf94W1S/2wVxGbzejAvd7VMvYMy9ygVaSQ/RI3tMNqF8gjeO7GPZ v1eg0mQfH3n2v/2ABnhpMwm2/TILPfRjHYB4= X-Received: by 2002:a05:6a20:72a6:b0:3d1:e510:905f with SMTP id adf61e73a8af0-3da39b3a6b3mr50443056637.1.1788965857307; Wed, 09 Sep 2026 07:57:37 -0700 (PDT) X-Received: by 2002:a05:6a20:72a6:b0:3d1:e510:905f with SMTP id adf61e73a8af0-3da39b3a6b3mr50442961637.1.1788965856678; Wed, 09 Sep 2026 07:57:36 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:57:36 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:08 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-1-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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 , Daniel J Blueman X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788965840; l=6191; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=ClN1HxPqioNiIjlqriHYURWSJ/USriPE6SkA+Pha1Kk=; b=b74xqKaGQeMMbMBnkJ6h6gZyHbLoxYz6ltfwWDTDCXK3NsNerz6TlxLTZVJlMPf8JHcFz39DK uH23C55c/I+DczAHj7JXx0Du/xr3KzDUA5jr8rPleYKS3BLYvIens4M X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Authority-Analysis: v=2.4 cv=bd1bluPB c=1 sm=1 tr=0 ts=6aa173e2 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=eoimf2acIAo5FJnRuUoq:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=NEAV23lmAAAA:8 a=t9ty7G3lAAAA:8 a=EUspDBNiAAAA:8 a=weiu3rfF03DHpAy_C5IA:9 a=QEXdDO2ut3YA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 a=Vxmtnl_E_bksehYqCbjh:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX6gqZuCB+Ccom w1PbfElAcN/ZKNFZAxCTXTkk7yJl4QUEnTDLKf0aKeo7jSaJp9WCO0l5JeyOJE9uTHvKXJtzL7X n9SmR8xWiSo5TGShXgGgJe4B4e8YJtAAEB9NY4DkdZwl1++TsvUW1qT6aQR7exvkSXpn0F3Dfgp wkOsbUOBE/S9N6b/rg4tQrh/nJP3ZFdmga3+L7YUuxG/899n99SFIwx7dUUZuQm0BBFat52rgDq btyH0EybW/Bk1iGqidghLCE74IB2k8mCravKBBf8ZCe26+KSHOtLifvJ1Drj2gcwuPSBfG2lSvh MeR8/JwrB3gXNvVUt4NMzoBi2/eDiso5FhPw+s+VztcrkLp7XZJd4zE8V2a8UX9OoMkDHZ3rZgc OMv2VPiR99sV+/4onTa2QnSZ4xyKgXyHu6DGy48OzlD0Vuo+/hA+KvOhKr6Mm0S6IUthGDyCRSY 5k0ymY7ggTuniQrS2cw== X-Proofpoint-ORIG-GUID: 5BdToqtwF0oLjIyFCb3PS7Js1DwKajub X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfXzhySTiOGDPQX 0hXgDAxjsoBaauGKSGaI9zKdb33YF8mL/8X2IIeQR10KNW9bA+8hGbct6cgUYu2s5Elt8+IPV96 L2QtJEuqyoFReHMNm6a/EE6X4AMGX5E= X-Proofpoint-GUID: 5BdToqtwF0oLjIyFCb3PS7Js1DwKajub 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 suspectscore=0 bulkscore=0 impostorscore=0 phishscore=0 priorityscore=1501 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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. This patch depends-on: https://github.com/devicetree-org/dt-schema/pull/207 Tested-by: Daniel J Blueman 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 18:25:35 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 AD2B1560AAF for ; Wed, 9 Sep 2026 14:57:47 +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=1788965870; cv=none; b=BVWnjASnqEmKnupa5hEk282tuYRSR8WLp96g1xIo+wHTydS24I6dZzzOEtnsobpZPcMeAno5Gu3wFaDLK1oS6M+Elo/ZoM0+D0h53kaVrLVMm86HakzCpx9dSuT5N8uRhna1Q6DXpD5Fa+nxnPMOYgYZYIvMWSJPIgFEnusl3eQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965870; c=relaxed/simple; bh=rBSCWNkR0ZpYrQr0eAPLkf2cHifsomeJt8xFTUOnFYM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ez4c3nBfCvVCps4ff5MfnMyCnD6AYlhne2lYUQofwIOnBFhskO42f0ZYq7s1ldBgOgm/jKbip9N4qWdD6MIcolDSPNFgilXVN5vwt7oJJON8+/01TddzOf0GHWiIgr/DO5Lr3KhayZ3hYrDRt5cjr+T/TFNV9OnlSFxDrbVdJWo= 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=YI4ZdUmP; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=LupoDbVk; 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="YI4ZdUmP"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="LupoDbVk" 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 689BUAQj1183763 for ; Wed, 9 Sep 2026 14:57:46 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= Fq8iT09hiZxF4vzzjyqQsnMZxDnWxS0zZs1RV46mdTs=; b=YI4ZdUmP40rsW5Ks NJcWgtAg2QJNOOTyu/ENwjhwqJt1nv1iOEHlNGZn5B6YQ+DJZMfihlIwNqU7Rr7x SHMYu89s4hNLlIqP8ZNJO0rYn4j0jXYRzu49szplusxFwoHWlac4sMz8162cIuWG HPIVMHPcCvrWWeiE9Xky9ZnfuaiG3mr2JDC9tr4YQvBcT3VuFufiG1pHTwSv/b9o /sgB5spSLIFe0a91ZH2qDAxQYs4R6IxvV021cdPz2+I/83R/Yo/Uhz+d9743VG8j scGkCZ/NLE38OW3yIrBWrq7/W/BuG0dMCni3SA+RqmmeU0psf7dgwrZrr1ftnF9w X6voXg== 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 4gk559s8ee-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:57:46 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38dbf293831so12184705a91.3 for ; Wed, 09 Sep 2026 07:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965865; x=1789570665; 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=Fq8iT09hiZxF4vzzjyqQsnMZxDnWxS0zZs1RV46mdTs=; b=LupoDbVk5MwAgMZQfQYdFF5QMmkw0aCDjQYDQxGM/etp3bT+OgvXxrctUuKAiCjsvG gKAJGcrz9Y3045UVe0nAHfo0Gofcts/MGLcBRQ5aoNVwBlNbnfMMJeTtXvffabq8NINz R5F0ynK/yuLMlQs7rMPjqfaW4xVLt1FZmnhyARf6jA/Yng2Ly85IJugoe/iYZVe1Iko2 Exc4jj3FCAhVMkpZg1nx7y9Ls67THQZriEYxBKKnLtQn/xA0BRpLXXWaslay8kzLLu/l 7eM6h5jl6EFzzkvnS52WJDenUd0yXcDfSzptoTnlNOpRSmn7m5QATaaxjt3WBjyLlXB8 Lf0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965865; x=1789570665; 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=Fq8iT09hiZxF4vzzjyqQsnMZxDnWxS0zZs1RV46mdTs=; b=P9i0/AhwJMvZ961J5ZpHr/wD6m35d6gpJTZZX6Yf8qgiPVVkJU3Of9qTSTjLUgAB5h Z0c4vA9inhO0Exx19z5hKOiCG+h5si1CwuexNYxkufgFoLHcGkL96813YxsrN/IumM2d v43u2OMq9faPOXXjrl+hSdbdJXcLvgu0p6trUg7tXOZ3HPnEP5dJ045/1izZC8I0nuZd 9Qs56kKIfKKnaHDHVCECQPzS6iRADh6cyMVvTkMwcGKCiB3mzrP+BmyMoUbkqzzRLZln w9fVlwiuqPARMCDhAOGufYrVuOpYFpKJW9jwyETSFWGFCHtUunh/jjcUMym6iW8h7zY+ xkfA== X-Forwarded-Encrypted: i=1; AKwUvBxKKtqWP4f7RBLoR66LcKXTSTTINk7oVhMH/M/GuEwe84oHTYx/vWxZ3/yyMkjOQELofZ6i94G/T/oyRd4=@vger.kernel.org X-Gm-Message-State: AFuF++mJgYeinsNLv0veGmrVm+CmsKcKiHhG9IBR+8k5S3dQY4Om+opa D31lOWmbUq02D51RRUEYgT0novM93pl68Oa06e9+dshsPl3YdeBP9JbkBJE8apY3K6/qMNmDFgp 8GfkLw69WeGX5BwdLTKOwWWTxSfRXlev5jVBBi53ojh1Ctecn/Zaruw8ApKlYVbJI6pA= X-Gm-Gg: AYBFou3dvaAc22dPC26pjx8OPGt24U0PFPxouszcCfoqy5s/bcJtVkNgeiIt/XLgbxi hFfGCSaORDDJCDSPTeXG0DQsN0nIzIYU7v0c+Ukfa2rLYCq34TVoq86wVi469XowhnlcYRyamNZ +P/O14SNZBxzifeqPNrZ1cEjk83ZAenCVDRyu160KgQKcMOwIQlDQts0SysPKH+XkNOw7IPd0vm Oy3ev379DXnIi68a1gg1uw8KXf8cGawqaccwZjIYCp665UMky5h4pZKYCc0zu7OfmNfrjCmilvB QRt/GFz/kQlOMQ2sSlnZg6bo3ne58lycNonCgXHNy435HNcWwf8RHhbxu/uNZLlezh7g2lX7kDa Qi1tzNjE3myyvkHejgQGhyYKxN0B7ROAaHF0= X-Received: by 2002:a17:90a:d647:b0:38e:70d5:b12d with SMTP id 98e67ed59e1d1-39b261074camr51442587a91.6.1788965865266; Wed, 09 Sep 2026 07:57:45 -0700 (PDT) X-Received: by 2002:a17:90a:d647:b0:38e:70d5:b12d with SMTP id 98e67ed59e1d1-39b261074camr51442504a91.6.1788965864683; Wed, 09 Sep 2026 07:57:44 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.57.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:57:44 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:09 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-2-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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 , Daniel J Blueman , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788965840; l=8764; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=rBSCWNkR0ZpYrQr0eAPLkf2cHifsomeJt8xFTUOnFYM=; b=K/Lj7YG24W3fzZU+9ctu2PVyyOlhpVXcLlRgV4BJGXaZOZa6OjTmf9wU0GWHcVgFLtYGDIC55 wjhOBL2Zb5pC3Ym1yctIKv8FXKVY+SV1wK1kVSKLqFRxO88R6wdcKXv X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Authority-Analysis: v=2.4 cv=KP1qylFo c=1 sm=1 tr=0 ts=6aa173ea 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=NEAV23lmAAAA:8 a=t9ty7G3lAAAA:8 a=EUspDBNiAAAA:8 a=r1hn0TSvdY8t6IrHqhQA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 a=Vxmtnl_E_bksehYqCbjh:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-ORIG-GUID: sVCF7pefhhe-6f3UNiqvtchm7I3wW7J6 X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX13bMWpbZ/5Jz RqlZEaRuptYpq7em1auXy4RDR6PjeRN23e9lKa7IYJffhpfmQknMF19kdyE7HaQsQbbRHcBKeuQ r4M8PWx5oGBS1CzvUn9ojya2rzo+VE0= X-Proofpoint-GUID: sVCF7pefhhe-6f3UNiqvtchm7I3wW7J6 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfXxylgh7gXw9gk wONT2wmWLhGAbXa0F9ya0Zjg7ja1B7swFD15AKE491iYIw7CWaYy4E/wa/L78yQ9kTPYDzi2/Vh ruKMJKOXXzD92QpfKVAwnx6MnvJkWjvbJZJB0DeUGdpTRU4oK6gNTFRJD2A+WD6P9T+QXUsU8ZE KNrwXX+E4BvZve/0nBGTg7v4v+W/ya16XcHa4NMuRy+U0a7cH7vHuMHO0Iy/ofBcjbQS6Ix/3OL baJcR9f/TDyHlvwEVZt01J8/DxDSR0wdMxm8HUi5bIoKj4Lz/OGvelkr+Ns28kD4ooq1upaKHBB 5ly1bkLI/8AbiHHhKQ8zuZNDiETMp2ygf1LcUDAcEYo6hYs8oREY1DXEzVMX4htk1QpmQ0kI5SQ WtdwJZ63IPsI/SVQFEVn0SFhyrJRmUnVKBnT7bNd/0C+9hkokhWUkPr4uM5VfEMjg1Oc7pPRc90 YXg76K3Xie/t2+/4KJw== 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 adultscore=0 spamscore=0 malwarescore=0 suspectscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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. Given a soc with address-cells and size-cells as 2, update the video-codec "reg" accordingly. This patch depends-on: https://github.com/devicetree-org/dt-schema/pull/207 Tested-by: Daniel J Blueman Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- .../bindings/media/qcom,sm8550-iris.yaml | 118 ++++++++++++-----= ---- 1 file changed, 67 insertions(+), 51 deletions(-) diff --git a/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml = b/Documentation/devicetree/bindings/media/qcom,sm8550-iris.yaml index 0400ca1bff05dcef6b742c3fbf77e38adca9f280..dd80526838f1193f4c9105793ae= 4bf4fe0755ec2 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: @@ -150,70 +150,86 @@ examples: #include #include =20 - video-codec@aa00000 { - compatible =3D "qcom,sm8550-iris"; - reg =3D <0x0aa00000 0xf0000>; - interrupts =3D ; + soc { + #address-cells =3D <2>; + #size-cells =3D <2>; =20 - power-domains =3D <&videocc VIDEO_CC_MVS0C_GDSC>, - <&videocc VIDEO_CC_MVS0_GDSC>, - <&rpmhpd RPMHPD_MXC>, - <&rpmhpd RPMHPD_MMCX>; - power-domain-names =3D "venus", "vcodec0", "mxc", "mmcx"; + video-codec@aa00000 { + compatible =3D "qcom,sm8550-iris"; + reg =3D <0x0 0x0aa00000 0x0 0xf0000>; + interrupts =3D ; =20 - clocks =3D <&gcc GCC_VIDEO_AXI0_CLK>, - <&videocc VIDEO_CC_MVS0C_CLK>, - <&videocc VIDEO_CC_MVS0_CLK>; - clock-names =3D "iface", "core", "vcodec0_core"; + power-domains =3D <&videocc VIDEO_CC_MVS0C_GDSC>, + <&videocc VIDEO_CC_MVS0_GDSC>, + <&rpmhpd RPMHPD_MXC>, + <&rpmhpd RPMHPD_MMCX>; + power-domain-names =3D "venus", "vcodec0", "mxc", "mmcx"; =20 - interconnects =3D <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS - &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ALWAYS>, - <&mmss_noc MASTER_VIDEO QCOM_ICC_TAG_ALWAYS - &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>; - interconnect-names =3D "cpu-cfg", "video-mem"; + clocks =3D <&gcc GCC_VIDEO_AXI0_CLK>, + <&videocc VIDEO_CC_MVS0C_CLK>, + <&videocc VIDEO_CC_MVS0_CLK>; + clock-names =3D "iface", "core", "vcodec0_core"; =20 - memory-region =3D <&video_mem>; + interconnects =3D <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALW= AYS + &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ALWA= YS>, + <&mmss_noc MASTER_VIDEO QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>; + interconnect-names =3D "cpu-cfg", "video-mem"; =20 - resets =3D <&gcc GCC_VIDEO_AXI0_CLK_ARES>; - reset-names =3D "bus"; + memory-region =3D <&video_mem>; =20 - iommus =3D <&apps_smmu 0x1940 0x0000>, - <&apps_smmu 0x1947 0x0000>; - dma-coherent; + resets =3D <&gcc GCC_VIDEO_AXI0_CLK_ARES>; + reset-names =3D "bus"; =20 - operating-points-v2 =3D <&iris_opp_table>; + dma-coherent; =20 - iris_opp_table: opp-table { - compatible =3D "operating-points-v2"; + operating-points-v2 =3D <&iris_opp_table>; =20 - opp-240000000 { - opp-hz =3D /bits/ 64 <240000000>; - required-opps =3D <&rpmhpd_opp_svs>, - <&rpmhpd_opp_low_svs>; - }; - - opp-338000000 { - opp-hz =3D /bits/ 64 <338000000>; - required-opps =3D <&rpmhpd_opp_svs>, - <&rpmhpd_opp_svs>; - }; + #address-cells =3D <1>; + #size-cells =3D <1>; + dma-ranges =3D <0x0 0x0 0x0 0xe0000000>; =20 - opp-366000000 { - opp-hz =3D /bits/ 64 <366000000>; - required-opps =3D <&rpmhpd_opp_svs_l1>, - <&rpmhpd_opp_svs_l1>; + non-pixel { + iommus =3D <&apps_smmu 0x1940 0x0>; + iommu-ranges =3D <0x25800000 0xba800000>; }; =20 - opp-444000000 { - opp-hz =3D /bits/ 64 <444000000>; - required-opps =3D <&rpmhpd_opp_turbo>, - <&rpmhpd_opp_turbo>; + pixel { + iommus =3D <&apps_smmu 0x1947 0x0>; }; =20 - opp-533333334 { - opp-hz =3D /bits/ 64 <533333334>; - required-opps =3D <&rpmhpd_opp_turbo_l1>, - <&rpmhpd_opp_turbo_l1>; + iris_opp_table: opp-table { + compatible =3D "operating-points-v2"; + + opp-240000000 { + opp-hz =3D /bits/ 64 <240000000>; + required-opps =3D <&rpmhpd_opp_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-338000000 { + opp-hz =3D /bits/ 64 <338000000>; + required-opps =3D <&rpmhpd_opp_svs>, + <&rpmhpd_opp_svs>; + }; + + opp-366000000 { + opp-hz =3D /bits/ 64 <366000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs_l1>; + }; + + opp-444000000 { + opp-hz =3D /bits/ 64 <444000000>; + required-opps =3D <&rpmhpd_opp_turbo>, + <&rpmhpd_opp_turbo>; + }; + + opp-533333334 { + opp-hz =3D /bits/ 64 <533333334>; + required-opps =3D <&rpmhpd_opp_turbo_l1>, + <&rpmhpd_opp_turbo_l1>; + }; }; }; }; --=20 2.34.1 From nobody Fri Sep 25 18:25:35 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 0E7FB579835 for ; Wed, 9 Sep 2026 14:57: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=1788965879; cv=none; b=pN2WBwRD22kkcgMvVoGa8ZAfsfHjR5yJUkN4QPijrIsfinAq9x2onAKA1e3HaAz+/AwWhmt2dxyJ7IMvy3Y6twL8cMq3gs+77PbjIA3J6D7L5r0/LtlKYjlTwOYcsH1/qY2JAmhOGbtpNwRdDf/LH24NmrhemZ7zb5sKh2/cuOU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965879; c=relaxed/simple; bh=7baRWPtsYeoomfoQ8Y6a+HLrwsbvQXalHqJXcSV2Ywo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dKRWy6+k/RO3utrlknEPbYWl1DYBp6XXIYfhgJard/JvvfO6rycu6W17uEFusiaccyEcig0AwkUAzcx25lsdWmF6deIck9m+w6FbS56bDbTlxzMtPC6UdabAhHBdHmzR6PoNSzKqWRihbxUqyOqcb6SR1/hvVZDo5gmSD8ZRpc0= 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=ip2gGDTv; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=a0fvmH3S; 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="ip2gGDTv"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="a0fvmH3S" 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 689BU5o42019239 for ; Wed, 9 Sep 2026 14:57:55 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= f9qEpNa8CHpShSLw8mXVHMyc74jKi920RkbKw5rTbvA=; b=ip2gGDTvFinRy6jC tqU5BsQjhlqU5sRwGHel8JhaqTfgt5Kroe8aMNGStHvBI329n++95SvybCY/Owa7 N4/dnStnFcv1ABgKgUyG1LzCHtmu5yV+M2QRjTjLQJOr2FsEKXhwdMFYskHHzJGH fLV+bAbayAQGdIkAiHQipQVjl9KmAzrxdqTvL23ojo4EgfAewbIGNS5CfxpuMPtl dKmsg09ipoYUBqSngewmtzdsJBJC7MC5hESkAQNvo1kKahHF3Uk5vhjaLPRrH5Te C+HRZ/HNw2h3Yy7CZ3mg0WaU+KfqylbKQC5UdQwxNdT8qAEYv955uKrdrPpbwJ11 E+gu4Q== Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gk62x8ysa-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:57:54 +0000 (GMT) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-39b77130a7fso5182924a91.2 for ; Wed, 09 Sep 2026 07:57:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965874; x=1789570674; 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=f9qEpNa8CHpShSLw8mXVHMyc74jKi920RkbKw5rTbvA=; b=a0fvmH3S+S6nu1PtNh9aWb1wCmQ9d2bTRJO04i5fKoSNA8Xmf6M2nn1idpRQbBKTf8 o+qFkAwNLQEb/nWpsV4L1SpK7P3s2mKZMyEBHFXqtDJaxtBRyEeFqLNnhXXbNgqzdHB1 Rox9YPL0qG/3kkHh+00yC/4gsU697E7KNHRDbvL0L6/yPIxPPiW5uxePc5Zy7PkZ3lVw FO6AzT8fXb8Upla2ksw7/UK5U1S36eXgPaaLPL3daXB48k8cFP1RwCKM+P42FNiT2hd/ vSrarY0stowLryPKOAoFL4KdUZ8JF3T2KGQPqKXTkZfwtJIwP9/XJcRTM57i9nzA7Wu4 I5Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965874; x=1789570674; 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=f9qEpNa8CHpShSLw8mXVHMyc74jKi920RkbKw5rTbvA=; b=AUD9MxVU65+BxHMOf2DjqCPe7fBSno9rx7EljngzX+JAuVBFteU/9jTX2igPOxBjia doGhX3/c1D8aAul2f0xGQlc7gwx0C0yAnNq3ClofIsLkttXfxKWN/CZCHaxlRBV6kEMx C83Ix219ps6TShGK+xh4qloKNnCLr3IVqxVi/AGHx2ljB/dO/HqoxAY50EzAjMfJawR2 xDUU7lAGK06vIzJnK1OzLwQXoXilpdMpkQNlJ4c6J6rcSqOPryb0rsFRSEem5cXdSKNQ V8TLS10g5lZYk0A8OWhAI3B2dCc0S3Q1xn2MnsfRsriU+n7O0s5G9my5A3FRez6lowHj 6qiw== X-Forwarded-Encrypted: i=1; AKwUvBxINgBe+9ID1E/bG8AHeBgLqDcaAosT8cCbjl4aFEks75jRqRKGWF/0gpetgmvxa1SadfibfgBtiYIdw7Q=@vger.kernel.org X-Gm-Message-State: AFuF++noZwhq5Lud6piyaW9cTNVLUTtcTXQsWqepd/rZSdM3Gj4sxrb6 o34/8MpLBCoWdzvgKwCu1qjDPcH7vePev8Oml1t6+0KYjgVad/Fns9D4/BUsolYccy4vqVZcjnH gUzX0XN7brPgVwRf9SCDeRKSQaJwijmI9ToCVJ98tm/jes1A9a1GAyzzALVzExAeEUC8= X-Gm-Gg: AYBFou0JxfIh01K9v0IZAfs6KS0GwEPZobn9phx4UpTEMt7bDOe5ygQd4n08QN9qnXN 5WLXx9tSnLok7dNMV/aBHOj7AT5bMzjN9J6XAdBYkYOVcqptdxiLPHEbKx5uHaTxxvaYq5ESAOC SecmE5YcXiMNEc28oAXnQt6Mwtbwxs975loO/NAfChGYngyE7mx1p6y28c6+PErdqUBBnc2hYzt p2V35OaMmp+dMXY15Ciz3CPRW56o0LaL6zL9JIvc2APSUeVrLywM39Dwqs538ksekzMEKH8lwK6 pB9qGxFPYEQS1AtW1twdPkhUO4T0gs1tnYW+MTW0Gk1x4re22RasahMKPnlDa3u0rdYtTBQATSH +L29Hq5398oVm/02TAMJBKa+JFyZGbbylmoc= X-Received: by 2002:a17:90b:1c8b:b0:398:9bd5:490c with SMTP id 98e67ed59e1d1-39b26214502mr49656971a91.19.1788965873614; Wed, 09 Sep 2026 07:57:53 -0700 (PDT) X-Received: by 2002:a17:90b:1c8b:b0:398:9bd5:490c with SMTP id 98e67ed59e1d1-39b26214502mr49656870a91.19.1788965872743; Wed, 09 Sep 2026 07:57:52 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.57.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:57:51 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:10 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-3-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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=1788965840; l=10560; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=7baRWPtsYeoomfoQ8Y6a+HLrwsbvQXalHqJXcSV2Ywo=; b=wMPqHjQStGdq3SxFx4FiOXY/hk/KpHO4stFT21e0LrwZ8n8wbdZp5elE0r8zgcnBy50JGCv6F q/lUKU845ZyCA0ZowVM+1LvrCwvY2T6yKi5QnoIJ/rBmCg3L0oNlgfM X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX9zqq3dEXBoH/ bc0GaEUeQ5PvcbfG+d3hQ5qhBsF0tAsw8vHlFz/wHueCqdiUj8vneiA0qylxDlhMAuFsho9w+l5 npAX5A+Mg1LVgk/I61W3k8fbHJxyjcg= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX8BocueNMV0hr qKue/u/bK3DlHf0z/VBXMhJnCtANqZFVC8rEkfYvC2hJ4Yapg/BM0XtHsUw7Z2c8BSiiSvBHJIz bBVAwBRf57LhDIKQyWKm+DtitvXzmO/OdU36475KKJnwOme0go3drolanHwOzMQQkg6RRSzsBDm nUF+W0ZcpyEKarmu0rwrj9eqkGEKZrlgqrxDBkfuW9vvmrTL3BRSqAfBZbrpXij78t6gfk2zL3h 15BJoAM1mBNw17L03VpiJmdmnqNs4dG8dVVwuPVElih6EvSqweg1e/287X9wja857qykJ/z4jYd wX9C10//SIgwwbz/J3TdJtFDqXmMS1poRYqJDMwDJb7Tb8HRqaJ6lcRcRJehaoYJ9u2fx2Ym5kR +tBbfOy3/oO41Tt6Ha0u4jP3oREgNPL4tUqfWqvLB/QTi3irQYsjvhs04E/EMNwDu/LkmqAA53D /9NVCEBHN9ZWFLviYGg== X-Authority-Analysis: v=2.4 cv=UeFhjqSN c=1 sm=1 tr=0 ts=6aa173f2 cx=c_pps a=vVfyC5vLCtgYJKYeQD43oA==: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=NEAV23lmAAAA:8 a=EUspDBNiAAAA:8 a=X0Cxp8Bg5y9jhwFTGxEA:9 a=QEXdDO2ut3YA:10 a=rl5im9kqc5Lf4LNbBjHf:22 a=Vxmtnl_E_bksehYqCbjh:22 X-Proofpoint-ORIG-GUID: UgrLmqRGAQji4LpF_pmSFdJY_74tATum X-Proofpoint-GUID: UgrLmqRGAQji4LpF_pmSFdJY_74tATum 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 adultscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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. Given a soc with address-cells and size-cells as 2, update the video-codec "reg" accordingly. This patch depends-on: https://github.com/devicetree-org/dt-schema/pull/207 Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- .../bindings/media/qcom,sm8750-iris.yaml | 187 +++++++++++------= ---- 1 file changed, 101 insertions(+), 86 deletions(-) diff --git a/Documentation/devicetree/bindings/media/qcom,sm8750-iris.yaml = b/Documentation/devicetree/bindings/media/qcom,sm8750-iris.yaml index c42d3470bdac796cc878090e65becf6b62bd80ca..eafd8654092468e4422de65c12f= ae8606babbd32 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 @@ -92,95 +91,111 @@ examples: #include #include =20 - video-codec@aa00000 { - compatible =3D "qcom,sm8750-iris"; - reg =3D <0x0aa00000 0xf0000>; - - clocks =3D <&gcc GCC_VIDEO_AXI0_CLK>, - <&videocc_mvs0c_clk>, - <&videocc_mvs0_clk>, - <&gcc GCC_VIDEO_AXI1_CLK>, - <&videocc_mvs0c_freerun_clk>, - <&videocc_mvs0_freerun_clk>; - clock-names =3D "iface", - "core", - "vcodec0_core", - "iface1", - "core_freerun", - "vcodec0_core_freerun"; - - dma-coherent; - iommus =3D <&apps_smmu 0x1940 0>, - <&apps_smmu 0x1947 0>; - - interconnects =3D <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ACTIVE_= ONLY - &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTIVE_O= NLY>, - <&mmss_noc MASTER_VIDEO_MVP QCOM_ICC_TAG_ALWAYS - &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>; - interconnect-names =3D "cpu-cfg", - "video-mem"; - - interrupts =3D ; - - operating-points-v2 =3D <&iris_opp_table>; - - memory-region =3D <&video_mem>; - - power-domains =3D <&videocc_mvs0c_gdsc>, - <&videocc_mvs0_gdsc>, - <&rpmhpd RPMHPD_MXC>, - <&rpmhpd RPMHPD_MMCX>; - power-domain-names =3D "venus", - "vcodec0", - "mxc", - "mmcx"; - - resets =3D <&gcc GCC_VIDEO_AXI0_CLK_ARES>, - <&gcc GCC_VIDEO_AXI1_CLK_ARES>, - <&videocc_mvs0c_freerun_clk_ares>, - <&videocc_mvs0_freerun_clk_ares>; - reset-names =3D "bus0", - "bus1", - "core", - "vcodec0_core"; - - iris_opp_table: opp-table { - compatible =3D "operating-points-v2"; - - opp-240000000 { - opp-hz =3D /bits/ 64 <240000000>; - required-opps =3D <&rpmhpd_opp_low_svs_d1>, - <&rpmhpd_opp_low_svs_d1>; + soc { + #address-cells =3D <2>; + #size-cells =3D <2>; + + video-codec@aa00000 { + compatible =3D "qcom,sm8750-iris"; + reg =3D <0x0 0x0aa00000 0x0 0xf0000>; + + clocks =3D <&gcc GCC_VIDEO_AXI0_CLK>, + <&videocc_mvs0c_clk>, + <&videocc_mvs0_clk>, + <&gcc GCC_VIDEO_AXI1_CLK>, + <&videocc_mvs0c_freerun_clk>, + <&videocc_mvs0_freerun_clk>; + clock-names =3D "iface", + "core", + "vcodec0_core", + "iface1", + "core_freerun", + "vcodec0_core_freerun"; + + dma-coherent; + + interconnects =3D <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ACT= IVE_ONLY + &config_noc SLAVE_VENUS_CFG QCOM_ICC_TAG_ACTI= VE_ONLY>, + <&mmss_noc MASTER_VIDEO_MVP QCOM_ICC_TAG_ALWAYS + &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>; + interconnect-names =3D "cpu-cfg", + "video-mem"; + + interrupts =3D ; + + operating-points-v2 =3D <&iris_opp_table>; + + memory-region =3D <&video_mem>; + + power-domains =3D <&videocc_mvs0c_gdsc>, + <&videocc_mvs0_gdsc>, + <&rpmhpd RPMHPD_MXC>, + <&rpmhpd RPMHPD_MMCX>; + power-domain-names =3D "venus", + "vcodec0", + "mxc", + "mmcx"; + + resets =3D <&gcc GCC_VIDEO_AXI0_CLK_ARES>, + <&gcc GCC_VIDEO_AXI1_CLK_ARES>, + <&videocc_mvs0c_freerun_clk_ares>, + <&videocc_mvs0_freerun_clk_ares>; + reset-names =3D "bus0", + "bus1", + "core", + "vcodec0_core"; + + #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>; }; =20 - opp-338000000 { - opp-hz =3D /bits/ 64 <338000000>; - required-opps =3D <&rpmhpd_opp_low_svs>, - <&rpmhpd_opp_low_svs>; + pixel { + iommus =3D <&apps_smmu 0x1947 0x0>; }; =20 - opp-420000000 { - opp-hz =3D /bits/ 64 <420000000>; - required-opps =3D <&rpmhpd_opp_svs>, - <&rpmhpd_opp_svs>; - }; - - opp-444000000 { - opp-hz =3D /bits/ 64 <444000000>; - required-opps =3D <&rpmhpd_opp_svs_l1>, - <&rpmhpd_opp_svs_l1>; - }; - - opp-533333334 { - opp-hz =3D /bits/ 64 <533333334>; - required-opps =3D <&rpmhpd_opp_nom>, - <&rpmhpd_opp_nom>; - }; - - opp-630000000 { - opp-hz =3D /bits/ 64 <630000000>; - required-opps =3D <&rpmhpd_opp_turbo>, - <&rpmhpd_opp_turbo>; + iris_opp_table: opp-table { + compatible =3D "operating-points-v2"; + + opp-240000000 { + opp-hz =3D /bits/ 64 <240000000>; + required-opps =3D <&rpmhpd_opp_low_svs_d1>, + <&rpmhpd_opp_low_svs_d1>; + }; + + opp-338000000 { + opp-hz =3D /bits/ 64 <338000000>; + required-opps =3D <&rpmhpd_opp_low_svs>, + <&rpmhpd_opp_low_svs>; + }; + + opp-420000000 { + opp-hz =3D /bits/ 64 <420000000>; + required-opps =3D <&rpmhpd_opp_svs>, + <&rpmhpd_opp_svs>; + }; + + opp-444000000 { + opp-hz =3D /bits/ 64 <444000000>; + required-opps =3D <&rpmhpd_opp_svs_l1>, + <&rpmhpd_opp_svs_l1>; + }; + + opp-533333334 { + opp-hz =3D /bits/ 64 <533333334>; + required-opps =3D <&rpmhpd_opp_nom>, + <&rpmhpd_opp_nom>; + }; + + opp-630000000 { + opp-hz =3D /bits/ 64 <630000000>; + required-opps =3D <&rpmhpd_opp_turbo>, + <&rpmhpd_opp_turbo>; + }; }; }; }; --=20 2.34.1 From nobody Fri Sep 25 18:25:35 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 188D95581FC for ; Wed, 9 Sep 2026 14:58: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=1788965886; cv=none; b=AL76288PbMYpFojLT+OKwSBrcWMdghLAgBeagnS1KUasFBpDTc2+juTEHBPgSGvTLoipJBRSrUhAAfrOGJIBvj+avE6WIgnRLQhR9hjjboyDipal46wx9LpCLrYxQT/yYNZYDxs1TB1t0PrNFqrwLWfqlG8b4zHu0HeeVDUBmpw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965886; c=relaxed/simple; bh=PnyhyXsK/uKdrS8E0sDYZofAuweW5PtRkPRa36gAFh8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YIpOCqwjs+cOU0mFsYVzadov5OdMs+il2OGbSy5rThY21SRqIZFS4LzUKbkpycriGRd1XrEifuYUPlqF6RHfQiGYXPhg8h8iRdnzvBXEqZ7/93EJLPW8vSHZSboGuPkSICYThV3EvGgV+P80PkO7V6ZPorkMXNf9rgwDk66Spk4= 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=B06ahjVV; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bxyRpu6X; 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="B06ahjVV"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bxyRpu6X" 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 689BU0Hb1809804 for ; Wed, 9 Sep 2026 14:58: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= w4mHrMNwv2XiFKZ4wSaQxIr6rcxOi2dXJs6ooQxgIb4=; b=B06ahjVVEr64lARM u8vS0jTMdgSXQauJaNDFDb7gCw9k9Jzp6s6gPljKH3uFnx4uocdk4vI4L7laLImA Qw9MrjaEdTZVSjVxwK25Ge0QzX+sr09Zj0ypdP7t4fZtN/uTIQhcmYcjbbWDmFHT UWKc34jxqC0dlwurcWSzoex/yzn9wIy93H7sz4p8sKHhnQKQOjhReaTMdMJpZE7c nIOAaVFrDctc3Mbh4uo0oRfHYEsBX9nDLH/980U4nrQletSeCRtfRcJkl6jE7+8+ biNoULO2swasBpBNrBWkvEqOa2wa9yEwCD+zWlCruX2OZEG4J5TwtsoP+FNuQDsk 6t3/cg== Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gk4xj19dn-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:58:02 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-8623e5d4279so7369260b3a.1 for ; Wed, 09 Sep 2026 07:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965882; x=1789570682; 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=w4mHrMNwv2XiFKZ4wSaQxIr6rcxOi2dXJs6ooQxgIb4=; b=bxyRpu6XP2w7uaf4BvRRYce9FgP2vqSGUCkCOh5hkqSIDlSqtd+iHZzEl9RgK1gje7 br3lmchf4cnISMt3cMviBg+V07DfeeqlBxb82wJkfbmXQdnmjo7q9k73tZkB4NGy2INd Fd7N9wVgoAIihSeIIyLWdIEK1CY+DTYrnYp5BQXo6g+GYb+/3yl/aFrNmgcq2nTE3oNR gnGe1QE/BB3OdHp++ePaXfhUBtoNbyGx+Tk5fBH47iv0kaceYzA6CezvJB9DUHyH9JwR M1YMIJI6do2gFmdhTugDtZ1L+U6FiB/yH95xTUDmn6SdSK0iEp4IVpL43g7lli3d10WK 5hwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965882; x=1789570682; 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=w4mHrMNwv2XiFKZ4wSaQxIr6rcxOi2dXJs6ooQxgIb4=; b=HL689bsS2wC4U46FPY/4ECHcocXVqnbnbmdmWV2+BHOMvAshikA0f99pYIvX+9c9Yx rXufpyFyCGY6QElKH+u7JWon8FfZuzYX2Z3ZEdPY8tsl9vObFiWGV/ekUAUK5zXqXB/2 CSTltjzY2wsgjroi3+6R+pbeTq0SwRQiPxEchg8je5NQRnghNWHzTQSI9Cz30nYsdJdy nwjgHwKj83vW91+KMlHVZ4t3AVIWLQ7te3urp56pyWS9+4RsQocPrzRjJo0YrdKczUiU AYsO+ejPlQUKuqHo5usq1yqjohF9zBB2lN06Y12ZwB/5rN3OlKzHMVqQYeL8mK3mEZWk AdBA== X-Forwarded-Encrypted: i=1; AKwUvBypgb/9jur3XmXxx8nHIM1DPdxLl02KfaGtRAUmmT0msdd2iMbyefzIFhBrywzhd7AvAjArw2PepNr+TJc=@vger.kernel.org X-Gm-Message-State: AFuF++mhWY+ijeda5HVZUvT49jR2SIgZlb3ccDheHybAC+4e07IkmBRb DGCLcA3jDPUwwrvTUKi1Syl8PAkCp3wY/Prc3PglJ1xmD98WrZnC8z+1Wuw47itIax3QmwOmjvt yy1EGQSqCr9b6FImKdX/2fkd+TVuMpKZjDOBVzZN3gOJwisCBrvIZ0RwuYeTly3igdS8= X-Gm-Gg: AYBFou0KKPRcRBh+yJxOskIxwyY4uFE82vNS9tLjdpnNqm+nXx2ljD2ClSDfQ70TVKC IubsQU5XqSXCAsgYh/kOXlcy+mkn6TTS5GyRf7aKkQCACDQjZT80vCzEz3aqsTYSDDfU9/B4WE2 GRWa3bf7uvaY09jEkmFKugZhfyeHN6rslqff+f4dQfJPAjZZGaZcN31/j6jl4QugsIca+cskosK pAxsJBy24UU0IjY78jmQrEwuoxWhOfAwnTgjy9IhWSrZNJpTeI6tO+SdZyMUhZ8slzHYTlsZS47 dm5j3KS19p73G+RzV79O7RT5mju0+cvq3r7wieYB6M5EB6dr8plEdkYiaupyhQDDpG89mMaACj2 GgDlx05pFhEWeIjIFYLWWqfK7F3L7vdbPcYs= X-Received: by 2002:a05:6a21:6e04:b0:3cc:f008:8125 with SMTP id adf61e73a8af0-3da39cffb2amr58878709637.1.1788965881558; Wed, 09 Sep 2026 07:58:01 -0700 (PDT) X-Received: by 2002:a05:6a21:6e04:b0:3cc:f008:8125 with SMTP id adf61e73a8af0-3da39cffb2amr58878605637.1.1788965881031; Wed, 09 Sep 2026 07:58:01 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:58:00 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:11 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-4-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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=1788965840; l=5846; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=PnyhyXsK/uKdrS8E0sDYZofAuweW5PtRkPRa36gAFh8=; b=CIIS85QEWP00CNdqoHfAi6N5Mbyl5OiOTkszOZgBXEba/tiTYSzUYezZrj2BppyysJQtqhy8l zqG/sGicuwtAElZEBu1f0O/vxTfn0gZHGJlxA+SSorpfxXzDAbFsqTu X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX1sT9swKZDHdE 5/7diYr6AjExqlwGzu3RhgY4V6FB+bucCUi5jlSeAyrUQYXVlp9cVR7P5gljMWSPEBVt7EXCqNt 5M4gPzebsecDn9AgB6mI6izyCc2Hjko= X-Authority-Analysis: v=2.4 cv=J52aKgnS c=1 sm=1 tr=0 ts=6aa173fa cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==: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=VwQbUJbxAAAA:8 a=NEAV23lmAAAA:8 a=EUspDBNiAAAA:8 a=5d7BNXMnqyCmxenBVOsA:9 a=QEXdDO2ut3YA:10 a=OpyuDcXvxspvyRM73sMx:22 X-Proofpoint-ORIG-GUID: Kr0JD6vSDo0gNTGlPcVM7uGp-9GWoK17 X-Proofpoint-GUID: Kr0JD6vSDo0gNTGlPcVM7uGp-9GWoK17 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX/XV14XhLDbOf Lh0OYBcb/Pj/KFBRb5oYxZ7i7oFrvyD81Rd5xTIRkHE3lu47+tmcAj54uvYZ9ohmhslqfMoScqk vlEkGrlzOC1qjJcTVDB9V3J+X56IprgjAVuJ0hA5TeQA06SAQPspbpheyXRZG9iwPh6Umzbqt+Q pPCDlkYFqueRm1XmhHfnkEw7lnJlQewByDt/qSrc/i4aYCKbmQmm99ObgYrAFSTf2MxIEZG0cxf MQLIXtNHS4tgYMYin5RxoO7Ran1iyRRHr2D6NJv8sr+wMaRZQo3xoPtlI50mMBqMh0dszkBFQ9c wRRhmbhKGc5+7q32oCLkLulxHmI7ISM9HtMq/tshqNngNIDWg4gA+NsBfmB3b+cgs+WBGKJU68D MMJcbcBXt/mWhvYIULhrbv9wxD/Su1cPKCYukEGzkpUXIVyzM9p3mth7p0W9GRDmkKEI2zt/F2b M/lEMpZI9vRFRV6SZ8Q== 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 adultscore=0 malwarescore=0 suspectscore=0 impostorscore=0 bulkscore=0 clxscore=1015 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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". This patch depends-on: https://github.com/devicetree-org/dt-schema/pull/207 Suggested-by: Rob Herring Co-developed-by: Vishnu Reddy Signed-off-by: Vishnu Reddy Signed-off-by: Vikash Garodia --- drivers/iommu/of_iommu.c | 107 +++++++++++++++++++++++++++++++++++++++++++= ---- 1 file changed, 100 insertions(+), 7 deletions(-) diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c index a18bb60f6f3dfdba853b6e16dd2a8616f6a731c7..1b014666d6b8ee3beadbd77e2ec= 8a24459468652 100644 --- a/drivers/iommu/of_iommu.c +++ b/drivers/iommu/of_iommu.c @@ -190,6 +190,90 @@ 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, "failed to parse iommu-ranges\n"); + break; + } + + if (!length) + continue; + + list_for_each_entry(pos, &ranges, node) + if (pos->start > iova) + break; + + new =3D kmalloc_obj(*new); + if (!new) { + dev_err(dev, "kmalloc_obj() failed\n"); + continue; + } + + new->start =3D iova; + new->end =3D iova + length - 1; + 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 + 1 > next) + next =3D pos->end + 1; + + list_del(&pos->node); + kfree(pos); + } + + 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 +298,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 +314,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 +346,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 +356,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 18:25:35 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 06611568526 for ; Wed, 9 Sep 2026 14:58:11 +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=1788965893; cv=none; b=XIJ9Xl8xDvxHgifnH1DoQYliJKcc/wUcqdlRomyk7fupC9JwU0nWy3xIagy3Kdm3doRw6myOWwJdgSlwMMGgADrJZo04XUOwqvU0hkHU2fR+DuwKH4orjAnl2q/9NRGzReDT0d5Os2D/u5jB50eUH5/1sa5MiRnOBlSgU0HcfN8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965893; c=relaxed/simple; bh=2XMdrsIUb92+YcGk/72FitFJ4xeAJql1ugC0uKB/yVY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tVFUZNILUSt6HC3IDML16g5d8DERKVXCthougy0YFVKuxE5YbGWgTHnsFs1ECfXlCOIthcIjrTTEqp9jMvwNCheeRXVz9Gc+vT2FK6h4htLdg36FNnYN+t0JkF1eA2Ksi0ogvlnKxcndekZlcTK+zQxhhWxbIhnFXwKVQ7xtWwE= 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=TZlbeVFK; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=LGbSig/t; 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="TZlbeVFK"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="LGbSig/t" 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 689BU1gs1810006 for ; Wed, 9 Sep 2026 14:58:11 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= M6iRa0ga0M+/AMP/mz6QHW7CHXaKEVGssFfyq7rC5RU=; b=TZlbeVFKU147Giq6 ruFgCKqTD/lUSbHGFfhV3B+R9BznvoclYemXbORvHP3CE610gtDocXLtMlg0cwWY Sby9FkB8BjKbi/Qu+cmcmS+u03QGH+qnIBgYxlHSDolZWxaWTRFXLm0C6CoYbT6O b88WEl2nVwijp5x2gAjEuNcarV/8Iuhi9oNjXItr660rsyRnxk0eqWzaMpAbzRP9 HUalkoMHxEJzwf8ONzAQyV3urGRzUrLrOVQP8Z5OcVpakFJJjDRaUhyZGUZSEAXt TAgJ+rfmjQuUcdfgsoOZe/bBapcV/IWdMUFlSTFSrycqQO1YP/7gGgrK6RiP79Do Fr1rJA== 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 4gk4xj19eh-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:58:10 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38f283baf1fso7206096a91.3 for ; Wed, 09 Sep 2026 07:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965890; x=1789570690; 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=M6iRa0ga0M+/AMP/mz6QHW7CHXaKEVGssFfyq7rC5RU=; b=LGbSig/tLxlq4sH5QlPH20WeUs2wqgwDlOfQbJP32/SOxPCsWmVdiQG/LzRclJrGOt +DNlpN1/fVVD54w3ALdy5ro5Q1CKK33SFlC9AgU/B1z6i5TIKxTWOxIx4d9AE8rhsZyZ KZytJdOXg1xX4+BwLf16peBnbTxF/sR7c4o1pAWB+Z2wEfDGHOLxfo15O9J3+Is+2dvp WwnjTeW6lNsjabhGuAct4yZp9BaDOXXfX2KfWSb+VDeOA9TmL4kKO8L5/7sLkWrBXe/+ HxQQWAqyhkoW7dZ2lLslVI4iBOLxcRPTQJTMvyAZIqpVHtoCsk91w/3KJHiVe272vN/R mP4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965890; x=1789570690; 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=M6iRa0ga0M+/AMP/mz6QHW7CHXaKEVGssFfyq7rC5RU=; b=Z1mFvYYVtMh/MXNyoQrb9WDLiAnbKWtyVHqUOmN4E/5rFbfE8P/BLoCCnQrm1wBnko xitBHku/3JY1nHKh5QfptZS6yod8V51KDDxHdIs8zjvky3np8fiiqvLcOWHHSEd6kl1z I9RnMOB1u99XDrgtmOxveNvA8J+pxyKRQTbXAHUM09joA8XK+bmdkU+trR/bpNHCr6aV opaQkUTNJji8uqVB7dexoUywZ5QOM1bfJByeS6jeh86bDIMdYUZD+MMjiqL4vt+8R59J stiM1nodjHmhzVVz/Xb+1oGPhA8PYlyD/tjLF0VobukZ5+sOsHvY2EPRHUn61s/8AZe2 KfCA== X-Forwarded-Encrypted: i=1; AKwUvBwauDK8mxsiAqVXAA0Kv7U9p6C8GZr+CnzNzKKpbysYXJ06d3hTPRteUGMsLjE8vCBryb6UfLlCP4nPVWY=@vger.kernel.org X-Gm-Message-State: AFuF++nh4q9ZaogL111UpDsM4ZN8/QTLINOqh9Y89rnvzUfdrnUqjk6I lw5lBcgR0AtRrfjrE+q1QMgdARLb/6SsBn4OSS91l2yOW/U1RJnHKn+xm0Kv8KmeTyqDvqT1VQN znLqy/f6xYlBfX3xHu0VdFMwTi4vSpkS52yXltgU8RUR+ASKjX49i6cS5Vc+S8oGHfQc= X-Gm-Gg: AYBFou3mlQxdP7BRYta9Gb6tmEjtjZytQJQr0PxPDtL7Fbwxe7n936DlXVjvRGvxgnM JhuLzE/Uj5SC/t7QOoMMCZXV2kCxuLZQZCIUdxw3YW6a30IsxS57q/WaAFNAdm3FIrckwqJc5Hv 9sGMPPBc+H4LKJj9JzYZ+PqTq5yqaoSb34sN5chHHBri+xJNIdYD2zbmwQ2EhgnTzBKkqtGQBCY AcPrjEH3tZ7WWDh5U70Z9+5WNRx9Jz+xiqG4zMoAXyYrbFXpGstpLeyS7cB8dyLlOtEinJcVmYA 8FnSQI8AJTmh4koJm3QtNqJRRayT8yb8+aysD0Wm29qje4Jw+6evHQIslB7WPA253chPiYJGHwn X6HzYvrGt7qYwK0Xze3fTJM6gttvuE7zURSs= X-Received: by 2002:a17:90b:4984:b0:381:25ce:bcc2 with SMTP id 98e67ed59e1d1-39b26104798mr48890785a91.6.1788965889539; Wed, 09 Sep 2026 07:58:09 -0700 (PDT) X-Received: by 2002:a17:90b:4984:b0:381:25ce:bcc2 with SMTP id 98e67ed59e1d1-39b26104798mr48890710a91.6.1788965888914; Wed, 09 Sep 2026 07:58:08 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.58.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:58:08 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:12 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-5-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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 , Daniel J Blueman , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788965840; l=6051; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=2XMdrsIUb92+YcGk/72FitFJ4xeAJql1ugC0uKB/yVY=; b=PHmoiKXPJxt91Cg6YlJTHp9NCdRleO9pPr7DdHc6zhNOm5coV98cXKfouPIM/UGrr5dUCYE++ W6NnuOj29MoCciL7xysW4T2N83keBmtBUKQW4wyuWpWBJqjiHdmRA1w X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX1Ow8GC0iqLhI znE/3RpQO7OR1D5cAOBzXPeHanmlk/Hi3guvzM0dtyA9xIjkVvRcbcajKVnZFpd1DxPL7WKEZD/ soO15qqdExyJXuTO8F3eb4teEJWIXvM= X-Authority-Analysis: v=2.4 cv=J52aKgnS c=1 sm=1 tr=0 ts=6aa17402 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=rJkE3RaqiGZ5pbrm-msn:22 a=e5mUnYsNAAAA:8 a=t9ty7G3lAAAA:8 a=EUspDBNiAAAA:8 a=UWePQM47DRlDhC0KtsoA:9 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 a=Vxmtnl_E_bksehYqCbjh:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-ORIG-GUID: vbQ2vqagG-Q50H2MWK8yAxyXqzzwep_A X-Proofpoint-GUID: vbQ2vqagG-Q50H2MWK8yAxyXqzzwep_A X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX9eI2A1BTCm7B PE2mooxttAnBxB0T/TBg6OTX9SIS9RvznZRyoBZNrM8jz66K+xxhtUN3PU27+nIMkIjQeGGLgpM 7oqXcAfPumNZ/GHCi0D1+9oLc06NHDCRkdHR+T7xiYzNdzfDJs16itmguBTXeZ7EddftMHdZUfu 95o0+l314uumuCvEGjMOxZHFBj3bnSArt9tXQmXOWNlesg5xat1GFMnpH3QdW/11N64lv1FF//m 8RH7zJfiikoM9QwIrSWsBmq66tqEBM8CHDoILzczeEOKLvYQICa5hj1P16dUaRgum4TmuOjiPRx hP0PPwmY+pqaiH6OlEXLOewQlZk2V0ICgXKAq4Rg7nSy5HFljTiyvQGE4SCkvwlb9hTcH7+1trG B+y1UaDsfriKJyduMltLI9EN0N5TV12OYgToPcgDfstZvHIioyupUFs3XHRnntj8ZI6pTLqZsy/ ne2qr6/X7GY2y+D/t8A== 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 adultscore=0 malwarescore=0 suspectscore=0 impostorscore=0 bulkscore=0 clxscore=1015 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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(). Tested-by: Daniel J Blueman 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 18:25:35 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 37BE35540B0 for ; Wed, 9 Sep 2026 14:58: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=1788965900; cv=none; b=SiFiCcvSHeGORjd+PB5oaG/Kwq/RMnjnlhZCAJojcQRZKBG1nhqipB3bk02/iH/4hfhu0JWSjYKRp1hCqKRvLyjBNnrPdbxDSZrlvj0mDijGd840SLPmKXs5gmhikPJGiVS92ZQe83Treu3W2tjXQoMsZ3UWTyiCb4Tr85q5X6w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965900; c=relaxed/simple; bh=fqABz+QRgPQSuehU4mHZGuHjcg1K8k452p65GQ8Wh5k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oJ4rsrDnUWJWZbKs//Hl/mQPx82IVndY7NSXyhRHxQZQyNx0s+qXwLFWBSylXqHq8A0mC1KrCDVQCL8fzzx2B2YWofUmYpxhEovVjD+XaVxfv7gmj4SMjm/s03S4DEehlG1mKjTAHRQaspS81DJ6tCdB/i/9YEvWf4vMkC4kzy8= 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=C3VbZmSd; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Xe3QZ4NU; 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="C3VbZmSd"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Xe3QZ4NU" 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 689DIRsU2080978 for ; Wed, 9 Sep 2026 14:58: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= 3FXSLpfX1uuKQ48PVTJAV5lMhV6YqUrz9fFUADq20lE=; b=C3VbZmSdKULWga1P FJDHhtXTxE5Qr6AGkjiZ4mrtP6xHQzYbYv8v/pJqCLg7dDzhXn4YrOC8Pce1ZK4G 4s68dp0hc8xZGGgHUzTu0Ii5uA/AqGUloMFwKVd4bcDrcXAdQdq/KuFEUcLSe6+N L43XrEyZXpyP6dk4/hMp7quxw5ppZTTObdmkjV0WTLEUnNnB5PKWJONPMcSU5hdZ 2e1Deu1TL1SsHZ8WFYHn8XtD5eiLxFnVPyUqhjbEvPB1bbmZuOTLGsZI6U5GWQw0 D2y1TEVfBCgARU4ADJ331JIfl9suH3AgQ8J+PCsSS6hCCqLJkJsZMfEmL2Cn2ch3 mfwKjA== Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gk87r0fy6-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:58:18 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-8627258ef12so5091998b3a.2 for ; Wed, 09 Sep 2026 07:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965898; x=1789570698; 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=3FXSLpfX1uuKQ48PVTJAV5lMhV6YqUrz9fFUADq20lE=; b=Xe3QZ4NUyHGKFyzyThRjUw+ZKNpEQel0olwyeb1XpqX2LxIHTm0enJXvF3fofpwU9I IlxYfu/fPC63FRceiRbpsDM5rUapSHV6lQjjo0g7LwRGP+mn1nsVDAJTYweFdHBwkyUv bjA4ePjXQ+8OcH05R2hFjzJk7jZUaplzmOf0v3i7TOPrMjGl8xtES9H8Gh7+icvPBvN7 3B1XphyFvdVHVwjxuWR5Pa4nal7FmpwH0tMWXQrtFy0w26r62llhZaJ4OZcLzKqRzBpJ 4TfcKfAMHCgpz5/FaEgoMcUXNd4EulVlsuOTts3R0zvEuESolmDU1W/E98wBSX5ouT2k gJXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965898; x=1789570698; 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=3FXSLpfX1uuKQ48PVTJAV5lMhV6YqUrz9fFUADq20lE=; b=mLjYxdF1immbaXmftHInrVl4O0zkXthOIg2E63TDnrK1NaS8C5mYKg6rc46G6Jx+MZ s49zcfV0ogkgrAt7Ha5XAQsbmgp5+asMdkaOFMt08RMwT9GTDQgpjIV9hieTIPzzKOIk s/gUuGh50OivpOpZaLhG0eU/6/9kvcbAKC83Am+53iKhWBFCQWj4UobfbugTwcTO697l T0jnoryW1c8NS/pZN5Ro7Y8jjrJKODUaH0fLQ3klijUN5kqskNGXbMp56nEjHdJnJqOZ 01qaMhOCZ+WRVyGsE5gH296fC1ZE/F+mLKLMjVMOftG8uzEJ7YqTrCfhd3zljEsYLhTS Nn7A== X-Forwarded-Encrypted: i=1; AKwUvBwDghzvxe4gkQBS+OVEr98v1NRTxRldAYA/KHn2WjFBWeiStsj3b4SOIRChV9isgXoWgp+w3iXNFeufO9Q=@vger.kernel.org X-Gm-Message-State: AFuF++lhaoR0RMddVENO9D8wPNZYj7U1NM8DfidJlI3Qmg+MLb+5KNUT Ashc7X/xZYmF+jpo5Dxrie+9FXOIlqkBnSyX2D3H0P2cNdwOUgGhbrJ3VaY0yw9wzmbraO2V8Ez 2lcuNcs622U5OkLYS7wxCTg4gz3LBDIwArcqzUlT9Zp/co7yIwSVOZ6MZaBb0rUXv8q8= X-Gm-Gg: AYBFou2tT4h1bmVIi3bnB4Vb55a+ZuW6MaiL5BVxwiq6MJHi66hImXnmE6ge2AOQIv8 63WTWsfE/DZH0OwiNh9amMG7/TSI4zw4k7PbrD9UMrB1IG0BN383G3BlSlErjYQTgbjj5f95di5 dgEFEEuSVO+CPlaAAIsbqJbpN8177+R6Jit2DiXcVaoHNG4fIVBwh1vT4+cA7OnxuwfbiLVneNS qD8mjNi49duH6KrA2ypLvk4SQknXmG5Q5XzAOLaRo3BrBOeg9kVIxfo7lXa7fn17fr0cB8lxvMa jrp8kMloN9Z72Y2DphFztbNXGoMy9MvUvSAFGfksDAQtQkdFqH/MfiydWB7KegRcqfW03L0uo88 GlubcIS9GHoIB1z4ASWT+ZK5edEgCoQAfNhY= X-Received: by 2002:a05:6a21:6b02:b0:3da:3492:83d0 with SMTP id adf61e73a8af0-3da3a173d6cmr58825899637.23.1788965897715; Wed, 09 Sep 2026 07:58:17 -0700 (PDT) X-Received: by 2002:a05:6a21:6b02:b0:3da:3492:83d0 with SMTP id adf61e73a8af0-3da3a173d6cmr58825809637.23.1788965897160; Wed, 09 Sep 2026 07:58:17 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.58.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:58:16 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:13 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-6-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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 , Daniel J Blueman , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788965840; l=9298; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=fqABz+QRgPQSuehU4mHZGuHjcg1K8k452p65GQ8Wh5k=; b=nSkMGkc7UUvqzbrcKlJfJdOn3dhj9vie5jQrrGbRglKj1HkcAnyhx1n2VTK6r6psJSxkH0jlt GfptyPTI650D1uDjfEttc9RA6Q+ICqZOWn7kl4yKVgDSrT/rl38esWy X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Authority-Analysis: v=2.4 cv=AImJJIpd c=1 sm=1 tr=0 ts=6aa1740a cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==: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=t9ty7G3lAAAA:8 a=EUspDBNiAAAA:8 a=XoEKZCkTUFqVY0t_PIAA:9 a=QEXdDO2ut3YA:10 a=IoOABgeZipijB_acs4fv:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX0P+6ftAitg9z N3zX7kZ/Upyo/213Qo1RJNxnFi8UMKpeKPrMQb6pjm6QigOfLUhczfql4GiuVXIlN3l6wxw/rlX 7ClqT2vbv8e010BtLYCJvYAqj3LUXqewFcY4aHJVcyHVTi9o8ftShpMwFP3kg/ZhoIjHCSRoa5n KuG1fJ30+H7Nqe+J0g0hn0CG1oVziLMEv8Utzh1UDOVbPgxjLG/j7iUjAxq5+VIX+9uuav2UBEm o8hEqEIpQRDI7BbQCuETSimn+9EagIDMFLfoicZ1reFqvYdzPxk7QLpPjKpeL/5EBZJEDbv3Rz3 KLPlZgqbStfqJGfH4bofoEt/1o4sPcPyhE6vqqtQVR/UhY/OqpdD0J+9E7CrSg+kmmcWTBhy/Nh bpHX5fjC8ojmKx7hYBaiBh7VmRMiWkEjoDIh5pYl+OKEvuzQn4tiTEyLzyZViyvhgQhx4w9HqUQ bqNgD6o4fR4aW42DT5g== X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX466aHEfSHLtn yoXTUpV3wo4kOLs1kR9auA7CsJWfnjRyjFv6u5xXcKSbTE4XE+qf+p3MbthK5nHGrtX47ZhzbKM P7islyzx658Efa0H7ufNQeewonFD7Jk= X-Proofpoint-ORIG-GUID: Px9xb3fVssROq7vHgPf_sUo9J-5guFCC X-Proofpoint-GUID: Px9xb3fVssROq7vHgPf_sUo9J-5guFCC 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 phishscore=0 adultscore=0 bulkscore=0 suspectscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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. Tested-by: Daniel J Blueman 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 18:25:35 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 363EE57F74A for ; Wed, 9 Sep 2026 14:58:29 +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=1788965911; cv=none; b=OkDj5eDPK5q2Q2co7dreY6ceyLpkOK1bGAOKTLHnB2j6JnKA1pa0SZEytk7HxV8FyGCrv0Z70WOjCIokunzHoCPIhY6HWryOxEHWPCIdx4xcq0kiCcmkAmJMAwoCny024SFWOrFtWJueDEJdMC+3vVuqRkHWxAx8U9GxDJNavxA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965911; c=relaxed/simple; bh=P0mNJFeoCU6tU7rrQorPgkeC1RVweTgvH8tb7j9zhEk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V4vsUSWpcy2j1ACvI+jGTZ46BmK1F5a7uZiwlVInEmm1IFBAw9iNrAidjSbbVFa5avmmk/EVjc1dFun/pWR9YnGFgSgR59ymWYH2pIxfKmWaYcNWVRaSCobLgBK94hoZ9riH/W082EQGv+JML/urS64cSCSC5GhigSS+HLwFh1o= 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=UzGWXeH7; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=FnoD7aqs; 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="UzGWXeH7"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="FnoD7aqs" 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 689BU2Yk2019077 for ; Wed, 9 Sep 2026 14:58:28 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= qmdf/9peUPSB/yZJlznGcLTDuFu/YJIWa9uggXF29DI=; b=UzGWXeH7BgWZKVza sSwfqPaHnxfVnudesso6SrqOrGTuTaBTYW3xJOVlp2ni4fZKfE8j1P8pZ33SXt5A tkCiUI5V1zehilUFQ4y3DkwWFThvJr3vqQSUg+9L5ODxsW20bXasgt4qYnkU5O2G MHQgLgGxE5OJVOMddY2bflzFp0/mJVUklE6oEXB/39IlsbemWsekXGENHgGGq123 d5WewNan50vsZcjWD95+gZZBtXr7I34asae6Irx8TkaiScvcAVw5jyeGZdEXGA8S dEcNVw+jt/u02H/Lx1IU8PkgHOoY188+LwA4uylL6IXE0Bos+eh4wJJq943Pup3y JW86Xw== 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 4gk62x8yvq-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:58:28 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2d6fed0652bso72758725ad.2 for ; Wed, 09 Sep 2026 07:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965908; x=1789570708; 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=qmdf/9peUPSB/yZJlznGcLTDuFu/YJIWa9uggXF29DI=; b=FnoD7aqsT7ldW5S5w+/CFYUlFF86frc34FxDMDkA8XB3ylPMx+8Z24JMHYZsaSNgn6 O5zPQsIdPardhCKSHtQjrpsfqLLNd87sbS5Lr1lIaeMJRVtdOXJAsfJI3tpqJLLBrkfZ mrEsL/TsfWhCernZvW3UOjk5aEYMxMnVtzYRt3KDGTfNZojh8N03YCti9xyMDIXxkHzG IoXMvW2jy5mw5EcKSx65xnyYH9nXZkb75JqojN9Oyh2fh0rPMYyRNfvVLmstrjwIFxVy V4bfl5NMC9tybYiC7+HvFCMO/rtKR0xes7tzTNmg4cRuVCE+vRc58HfNDbAnOw09Y7sy c/aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965908; x=1789570708; 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=qmdf/9peUPSB/yZJlznGcLTDuFu/YJIWa9uggXF29DI=; b=c+mNI3XlCutKzT3t5YPuHybbuerLCVhHwEbsfk77xY7yP+/eU5tp0tnXCl8LYQ4v8w jYKhZyteCGF4d1XW68FYSDs/HfHAXFVIauQDTLA+nQaYbIBj+5FcuaqJbfPeg7ZIw3mi SXLNQkIKoXIXucU0mzWv8nwBhJaM7mbJiI7QM0nt4Ku/qUaPfcWUtgocQsSTSy3FUHFt /uGbL2UcWJi6BXkx7eNVBREpblTLl1l8cNWNKxq/fY5T3avZz0IV33sOMBsU+08O5hPD 7Au9eqpQuHybY7sPRSUph5nJlFpNk3t50332y1365CeIptDxytg6djSk01Z70gkxCTDH K1/w== X-Forwarded-Encrypted: i=1; AKwUvBztyYkv7asvdV3XHuEkNf+Eb3Vib53l/kaXRTghLUcGebZs4fPTd9SRTXrAIcW64BC0VP+2ZBQNRA3sDF8=@vger.kernel.org X-Gm-Message-State: AFuF++khodCIvAvJ0C3/PXB0Fyj1COntipU2ToB5fl8hAQHiKk+QQJ7s 2UX1ETDxvfRIBg/ydz6dT4G8EhHEhAEjuPvirUP5LMOowP0ipzR09QoFoCUn8ec1kKWWMHWjj+R 7F3AgW6l9jjdFcZGYS1fT2VXU7wAuvjuN5+XPMwHUaAsmfb0kDVylmxpL7a9gbC4SwT8= X-Gm-Gg: AYBFou0Sn23UmM9g7ybplVcB+iobD9t6yXTWqdUSxOSzQwCKef2o/0eFadG7DMekXnM h9uJYB0imNi9pkcVixFb7+xrd2G2q/Rak4hXesnZxPjukMkzvsHcpPW2v2kZzh3dnd/JTxmT6p2 gKJuVTaZVVjWTuEzy+kKKoFiEQwwYB4JP/b7tC3Ngm/VI+HcXHWxHZkBTmjS+JS9y/A63cPxZV+ nZ5DJ3zpKmo6BsUrpHs6R+YQs3whwl0+iGc7OwEYtfdeOBj0UYmLMvLE2IHE8gR19adiYPSXVNk 18Y1eiUmkkYa7aWCX74bOM3ghm1TqAZDUsdKVP7/qOb0NX0a1VUL1k90/0BEJT2Q9jq+tSX70iw YfaXNUWEobbfzBxHFCD8y9Iep5I4x4arw8Jo= X-Received: by 2002:a17:903:4685:b0:2ca:660:b1d with SMTP id d9443c01a7336-2db126d8c1bmr522698875ad.11.1788965907660; Wed, 09 Sep 2026 07:58:27 -0700 (PDT) X-Received: by 2002:a17:903:4685:b0:2ca:660:b1d with SMTP id d9443c01a7336-2db126d8c1bmr522697945ad.11.1788965907033; Wed, 09 Sep 2026 07:58:27 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:58:26 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:14 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-7-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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 , Daniel J Blueman , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788965841; l=1854; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=P0mNJFeoCU6tU7rrQorPgkeC1RVweTgvH8tb7j9zhEk=; b=cKL8bboU/o8pJ7st3/DmPUsCFBQx+gHEH1oyDjmqNJa6iQ4GPaKEavhxB97yy4sf3bpCIJ+O6 LQ+v/XQqxO7CPJV/MD7p0/6LCHQ6EZ31C1xYHZOnC449F3y8lAkD/0B X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfXzrRLaQds2kdC p1zOZp1FeUL3PUkCmAUenpHgtgBz1gMTFXof8ckprIF54CCOrY3rGAsQEVAbkbp8OEUrSS7d7r3 pPXaroK2GDM3zhJ4Iq8Jkd1wqf0xJDc= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX4r/hP8jAwosE /jcZh01c3mP/2yTTtt+Ze9SpEYZdjSJddAOAPMWqY+LuDM/s+j/3TWmcru8iY969kOuQHC5ZShQ s7PGE8VVHn7fxIemw8H4eajTQlXPAxUhiLYxGfZCX97t1srbgdKWE+RT5tiwD4UBNo3zEhNSH3r I+/7i87YrSVgSSCvJbLjeU7wp32oniDqJGjQqEauearqUqXgBh3pDKoQeAb5ATsxiY3qJZvldr2 Xhzwg7Nf+X+UItL1t43H2jHS0Ib9eNGt3G90McupJNVUqkdqdg2y1vUQuv0Wpvh+/bNQUhs9nnp MhFnaxcM+hasLzjdAUSrwri3ytvlkSasIMm+DUTvkRjX1sPVlWmVtzQ6EG7o8NiREu+WOszgkmO 8OxCEqaFIWqybnhPF2qaCBIddVxRBe/zkDh48X00GoF0s58e72W5h8OKfyRoCQKRtZyzNemvnrR 9JTrLOWqiRonPE+QLwg== X-Authority-Analysis: v=2.4 cv=UeFhjqSN c=1 sm=1 tr=0 ts=6aa17414 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=t9ty7G3lAAAA:8 a=EUspDBNiAAAA:8 a=1uU0fEruEEfCXXW2WGwA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-ORIG-GUID: xfWv7gQduf6cLBvdK-34NaAnD6I9QTF9 X-Proofpoint-GUID: xfWv7gQduf6cLBvdK-34NaAnD6I9QTF9 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 adultscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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(). Tested-by: Daniel J Blueman 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 18:25:35 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 4052A569F3C for ; Wed, 9 Sep 2026 14:58:37 +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=1788965920; cv=none; b=Gy4O2nsyCsXPKK/xuP9KqlwWZpDMuyw5udcLb7tbNWtVYxbYa8j/b9cmxNtcQdR8wuQaPAYvQTT67EO15edyle0cxfUF55YhXQ+4G55tp6ggnBiiVo1XxVPmtyK2il5ZfV6w/bUobwO8x5VqEr+XREYZTw+PH7akT+APx36zK9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965920; c=relaxed/simple; bh=XwODhyna4DectUOuJ15Yl0Y+2tOgaMf/Hivzbu9xLq4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=SeI3DcLAhaAZg1EUxtnFqgYPtf2g3sJaQQaynBzAvv71VTjIEu5A587UlNBIIADLSOewEoQpR6+fdgpilHUeQtcwcP9iEME4gzl98tFjglKHiLd6k8XSuElnlU0AKQObOD5/68xNb0gCYayWXRG+Iof4voE7HTLS/vSJUa06S5g= 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=PvupkXFT; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=KTS26Jq5; 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="PvupkXFT"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="KTS26Jq5" 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 689BU1Ot1809999 for ; Wed, 9 Sep 2026 14:58:37 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= uEUvJuRe81ULO0YbJNC5/wtMseuRglyE5RYVVpjuvu8=; b=PvupkXFT9qCn+/i8 eLU929ByApQPZuJV3MNCr8m9fPQ3rLqM1grC8ZIoCBv6zuLDHIC1Pxa/v6XcBo8o xcLXfFR2DNq9vfU0MOm2dD++KMoLKacP9zelACFeuIE16WwWOHxv/vEllSjMIX0D jysB7WK0ZdH8GYi6v5/K0/lIytcQ0ZDLDt42LQ8zmerr/8emQqqnvncFJZJgGvww 2Fja6f9q3l6XRjB/FE0muNMwU8gV1n4VSM2cAoAfXRmoF6fPHRCzHO0TRsx8surr pGzaahyu8xd5UF4C+XcCS5G7LY8T25B/ipur+riYua/MDyVRIlmsrzt4F2iITLWu sB6Mhg== 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 4gk4xj19gq-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:58:36 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-cc1b6f65dacso6652270a12.1 for ; Wed, 09 Sep 2026 07:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965916; x=1789570716; 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=uEUvJuRe81ULO0YbJNC5/wtMseuRglyE5RYVVpjuvu8=; b=KTS26Jq5GoJIVoASnAWy9BRLMu6P8wtspzxCPTGQEepdHfruJS0Vdp2p37c224wSE+ t2onQMFpNLVgtAa1MauBOpL65GtJL4vNutjW+yRZ3dVncfsOY5Qix/+4n4K7GlNEHSmV vivy5h/XC0aQbSCK2p9oNJE46fqS0nSaP8LfUXC6AEuCa9vsrOcmZhgDXymJYYGs3WFt ZQSgIuCGE34og8oAxEsVpgG9JhrO5qWlx15k2ErCHNHFnDjLO6/uhBSROuFAUDJIjUdE NwMltbwbVhENO4JWGc8OGQRxDfG9vjD4rU6wLKpwgL0MMi57kTvxR1/PMt3ye8ZC4iR9 x/2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965916; x=1789570716; 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=uEUvJuRe81ULO0YbJNC5/wtMseuRglyE5RYVVpjuvu8=; b=KXMMVKK+0lMFnOaVPEXPaKK8+KBBcFwJiex7plU8x1WUnBRDUXjAMjpvY84B1uinUE 1Mx8s0/NCoHB4/xzpKU5zizkLJczqfSwgl9eDhexNMJNdnbfjl9VpgKenWJeQP2subLe leb14L1Mmrt3uVPyNrNSahP9jZHx6D8hShNey3gebFPdY3yRkifWERIhb61y2Ji/7F6h 0f5BRhHtOABas0V5eNEuEWuPvcdlhk29jfqa+cuQ8+p0WaDBp5NFozzNsSBvY5KpMa8G WBswMkcy41mh6F2RZa3cDCIr9HGcefobI5cXbUjZhJJBkdW8HRRlNLCaNJAUX3jEZs+a FWIQ== X-Forwarded-Encrypted: i=1; AKwUvBz649svqkUw0cBUU3HFuN2UGywzjmlNA0mceKO7a6tZsg0dptPxP+HeCg8A7ZpXEFdiNX4G+JVgcEnnABc=@vger.kernel.org X-Gm-Message-State: AFuF++m8n7wlhAcRLHsHQ1cx/P85W7WcUjvpvYFkeAUUMKPs5XuFpr23 6srWRTiXB+6wMtZrzPmIs90y4zCfjfVamBF6k2lMaFqkOYo3EtFSVtp7CKL5DTxJbtkjrBxV3Hv /4WQWR4ctKTrvhtABf2DQAOQQiyORoID4dO57JXvu1YPIPCPbu3tEua71UT1B4HFBH/k= X-Gm-Gg: AYBFou3REM2gH2+5p/SPbJhnDp+2NJOmad1GQKMToiFlo7DTnIpm1KkRXV/JPYAFVvS Mj8yNMbzupWsbY8pwW0TGk2qP1niraHF3ID1hygM1blCRFWA1p+VJDpISyEqk1N7zBDbCJdvuTh kRNxCa9g0arjdSzKpyd++Bf589Xu6NrxAUOi/Ji5k3etbfpfkNi0PVI2cv+D1hZNU5QHKU9qfsE qagmKm05kY7NAYgPYCHnbhN4YyvrmY0OjxsrskDUPmFM7ol19xxsHzx8h4/J/QxY/pQTBAiCDZp Z9LiZj0tLOo88oEed7UElXj/gApxtbwRtWCvDYh4mG2WRzTTPG45hurtPf3vl3C9Ab/pZ+cqPFf trlpYYz5fsOzwDUIv/YXMds1ZEHbLKEi2Td0= X-Received: by 2002:a05:6a21:3a4a:b0:3d3:ad3c:49a7 with SMTP id adf61e73a8af0-3da3a1ae36fmr67066771637.21.1788965915628; Wed, 09 Sep 2026 07:58:35 -0700 (PDT) X-Received: by 2002:a05:6a21:3a4a:b0:3d3:ad3c:49a7 with SMTP id adf61e73a8af0-3da3a1ae36fmr67066676637.21.1788965914958; Wed, 09 Sep 2026 07:58:34 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:58:34 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:15 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-8-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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 , Daniel J Blueman , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788965841; l=3447; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=XwODhyna4DectUOuJ15Yl0Y+2tOgaMf/Hivzbu9xLq4=; b=+Mgk1YVXnAfOHtB6WnDI292rxl/A8NZEBjs0G0DsoxAHeSyrWsf/bNAxQ9J6IpJ2vjnsZNV+a WkiW01zRpEkB1NO5CKEwut2LCHFRXgvaJSgOLrkWPzOjCDlHYXwYm9a X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfXxLFpvfB7/nGI 1HI0YdfLlyk3LNdMjJ3zVY3C+jfQsNgfG3CpaXKuggIgd6HGH+PlohPlbhZTdnB9ayJEn+sCwyB DfLZR/UySR44pE1Znkh0p+hhKu2HCf8= X-Authority-Analysis: v=2.4 cv=J52aKgnS c=1 sm=1 tr=0 ts=6aa1741c 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=rJkE3RaqiGZ5pbrm-msn:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=t9ty7G3lAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=_Vgx9l1VpLgwpw_dHYaR:22 a=Vxmtnl_E_bksehYqCbjh:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-ORIG-GUID: TZqGI_N_uPDpqOy3Mdu0ZT34UcTHCDX2 X-Proofpoint-GUID: TZqGI_N_uPDpqOy3Mdu0ZT34UcTHCDX2 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX98JNXeQZ4PLs ROZDgY4hp13gPbnMOzuX2hH3Zm/kEC3W/PtOa2xftf9xrC1jvkX2xgvJiAEP93sAdwBxYFpmArB Bwd301U8jbeeJD5+Nfje1CKAXXFdqA3YTQuHjkiPiWf+TLITdwgT46G1tyY4oKIgy184WucMrTy Xqf2y9qnnp+FH5sHFsCW30UPUcpyzNzKn2AdZwW5yUbvJ4lEmgyXD/jmolNooIhqj2XwtXi16TP 6Y4Z9bdiJ2KVtz7hwDiJcFy4wkLAdF0XgpiWHtp8iKQqNQD2BG6QU2rd7jz95JGGQ/+/NSd7pHM HLOMilzvPDBWrcBF6iyVrpEpt0ww46p6Vsua9RiwzSqPIwEpKmAoj1NWzuMsI0Fo8KbPrjZJz75 sdIMFsuV9XVoLgO/nQB8prbbgn9SoLwpCKpIqwSSuZqVhdmGY9uwbF/BYykMvxuFlLCr6oHITzE hAhWelYBS7CDG/ZsfTw== 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 adultscore=0 malwarescore=0 suspectscore=0 impostorscore=0 bulkscore=0 clxscore=1015 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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. Tested-by: Daniel J Blueman 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 5e92645c5c3cd7f2491e8d76f51f583fdb34c98a..e1e0b7d91870f383bb5213033a3= 4e1dc29595368 100644 --- a/arch/arm64/boot/dts/qcom/hamoa.dtsi +++ b/arch/arm64/boot/dts/qcom/hamoa.dtsi @@ -5463,10 +5463,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 @@ -5474,6 +5476,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 18:25:35 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 75C965867E1 for ; Wed, 9 Sep 2026 14:58:46 +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=1788965928; cv=none; b=SHcPBPGjMiDq3yNQdcVropbQGJygSvnD5mrmqBwK0fHR6dgtwTt6C8G+EJCwjEcudWkPqSqtZ+H7baZML9MeAGe0qFAWEFBjVY6a0FFavHSOl7y46XadVhKIUOQjYWkFeYrO5Y7imJVmZ2NMP+jtRsvFqK9a+Qzls0eRBTsdEjI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965928; c=relaxed/simple; bh=K4XNWtbzRvEKvAJ18ki+8idGw4qkk9tCrpK/rO+5fUI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PJ5ySWimyL61lt1ZWgaT/H7KQmx+3bXsQ6Rtzu4awyALXy5a5fAnBi8Kvpjpttgxzk3VlVorRapd7ojjUwa/cwSPzKYNT0tae4eZ9jYj2/nJ2w3vgYmyPNsy5nOnqBPV5y7/+JF0qeiddFkh924yMEaQ7m75izrVFHHid0LOULo= 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=Zbk5YLXI; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Bk0IKND6; 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="Zbk5YLXI"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Bk0IKND6" 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 689BU2gf2019091 for ; Wed, 9 Sep 2026 14:58:45 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= 6TkjXMbTRYfhy2Z+xX5QJ7eGMI4OkrgGqEbV8HW2cNY=; b=Zbk5YLXIY3bV6oYt kaWfLkmu/QALr0Sv8Y1SjUAgTEuQvCc9tlIro329B2xlZNC2GxYyNxJEuVzXqi+w /Drli0AtWthIiVlaH4XyVkbCIUpc8Y7M5swSBfi9xOsA5dxJCRj4FmHQ3Be893mH yh4Fxy3NIUocmE/M148rzzaC1GdfFtgJqcKDn1rNbdEDh8A5hJkikVWTk8Cx8Mmd AJPFUmvnbj428OoQDAtYFNJYH1oDUXynB8+/pkT7+2QM96C0oQ9zFz3WUL0ILeA9 f9GI+XYDjGyE7ryRv2v/TxxCDZbAr1VPLA1GWMSvKQIhVonpZcAnE8zzdxX7cPL0 PV51tw== Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gk62x8yxd-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:58:45 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-cc39363cc88so6224022a12.0 for ; Wed, 09 Sep 2026 07:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965924; x=1789570724; 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=6TkjXMbTRYfhy2Z+xX5QJ7eGMI4OkrgGqEbV8HW2cNY=; b=Bk0IKND6+HRe989H6uR+SxGGEZNAwS/urXICcOYpMQz85aVd4SXEXXljOyHy3nhKz4 +rCxNIJisTkvI1lk+OUdJPTsXqZnCYcFeoEjtxkBRUy0A/U4wgqXg5CZka+ozKoTeRFN NX6/fPxcEBfdGGv9ffqs/mnShQcjt+3Vx3WknY/483VFYG+po8XSSCZRMwPe/EJd9W4a A/h7IWg7Q2kW7kQhXjpPD+N9EorAIuLvG7tG/Da1cLJB/F97EJUZ546jJP5SV6ZmHYTx ko8/iO5nH2VewK+bwgt7zYOLPzqZJ8w9cVS1N4T/xz83PW9rVqcZgR2PHsGvVgUfbKDa G8sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965924; x=1789570724; 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=6TkjXMbTRYfhy2Z+xX5QJ7eGMI4OkrgGqEbV8HW2cNY=; b=XmdNHCeGSKVxUjfaHfXGk44t2qg2E+tSbebUVHpsbngu7+2G5ar93/NGKgWpdQpfo+ jKLUX6Vr42vxtV4hR/eNh0BmpCXrZULI1VgtmIfQM3neIzp37ZE3XPg/ai7LwgS1FTX9 uf1zQ6RJpr0UZzN6izZHhp1JkLZg3KEuAczKQOG2enE35OekmuyLp3kSLkF8DLwIz337 fUYLFvFLbDkmGpECfwNDjUHrzTezCprMqFmMRcdnjUVy+hEqO8jIxKARQp7EbCxbTABw BPUQKRX1y0gUU0ZUSJoXZJ9twQXG1aDvUqXKlKUYigK1xdjmR/f4eFF4YCIZIoMX03JJ h06Q== X-Forwarded-Encrypted: i=1; AKwUvBytJyaXBXh704PS21XitVm8g5g7dsY4UNaRKANqXxTSoL6lZHrdrBbi/iYLNd8E6rcAzLssWvyiyzew/60=@vger.kernel.org X-Gm-Message-State: AFuF++kR1bVdjhz0Sm8I65hFmc61gAG2RtEo5rDevVsNg6o09Kd7wyJc SJAMYBpKFXbuA8Lz5t3OITB6Qa4k/PWCuRqZ/WiAdNut6bKSdmIGWrvOwM82olVD/Bs0oHQ4weP Zd+cst63fFXQo68H6jqL1FrZXnjinvH380jRmGDktQqcwHMKiQZuAOCJ56Yue0+ahZOI= X-Gm-Gg: AYBFou2kkMEThl373SlPbA0hF4Z48kZzdYEeHx0GIJOBSpVZUyK8WJe8NVJwxai0P49 10GMkLUhNHZJQOMS+3VnQU4UqK913wWeZ1u3ksn/xY+/GlRlncpBbVWXp49Y21sGuy/Gzf5JPY9 BG+DvkCjdn2hmZRBuRtLm2YBLpzHu5oquthIdweT+6EAmcffq3Zx5/OphusfH+VxwWKoaPlorlb W8JnjQ5XwGSq5WgViNed5O73Nq5F/LOu9ncc9RaxN8h4Z1hzk6sNQTQzoCf7eP7n0XUrEaIgcY7 yIZjsFdKzUVE6jV4+YUEDgdWqKv6LpM1teI7IUS9kDFL0R+0pH61ApheqvJgTlvh51K8qLofIRc S28Urn8AxCqwvJczSVXVrEMCtaGWKdF+F5Hg= X-Received: by 2002:a05:6a20:a108:b0:3cc:45cc:c401 with SMTP id adf61e73a8af0-3da39ff4c0amr48206703637.13.1788965923774; Wed, 09 Sep 2026 07:58:43 -0700 (PDT) X-Received: by 2002:a05:6a20:a108:b0:3cc:45cc:c401 with SMTP id adf61e73a8af0-3da39ff4c0amr48206592637.13.1788965923112; Wed, 09 Sep 2026 07:58:43 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.58.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:58:42 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:16 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-9-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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 , Daniel J Blueman , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788965841; l=3343; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=K4XNWtbzRvEKvAJ18ki+8idGw4qkk9tCrpK/rO+5fUI=; b=qNy70wYTnF2gPu1+iaM60CrEXqDMznNg4WSU8fzYZXb1jK9El7jaBv1JT8eTO1tHFebFdX6dR jsmQduocHsiBJDX76zp/jRycc+OovnyiFPYMh50if94HrM/aOZJUbHo X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfXxTE8y91ypViU I+YNUVr6bBLPfSIdAJ9+bCuSTazekv6MH2fS0mTS+XWy59qoIl2SJ93vE8zDv9cICsFkgtd3QxZ Q6J6OokwY2/2G1OKxPeQH2a6533H2UE= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfXzYe9Vf0vsSg8 14Te3z0DryLvKWhreXIhs6AMkJOsZT3hB/5I2n3Pc3osePQNkRQ7kNEEpwdcTrB2oAwnj13DKoh ry4N+kevKHbPtWgG7xjMi7v9oe91Q7kF+vFnaJXOLgAZ/vTA2Le5LJzs3iAyyW0arVAHpMaDpNB pnse+IZFpmA1wYJjIN1eUu0/yniGekPsgxSSZqQCefGi9aEF+i1au399tIoSZG1HqaIHLGHlp9L MzU66kbQlcoPmzcDOBBWp6SCCmkV9oIwjkItlubxewkeKAGmDn205piCgRaEYNztD/XD+sBbMJS QjypJFdTL8QgBw6LlfEleiMDcvi+qUmBY4FdJQJenPWaOswKvDIKhkf+lGjiKxu+ZskG+z14yIv yBYvIWBs6RJtWy5EH9mfEx1Te8FxHhJaYvnrmNQMDvXNst83Gug/WDTlCirIMsJpY7crZS0PWgD nj+86QmXlQbN4wiURQQ== X-Authority-Analysis: v=2.4 cv=UeFhjqSN c=1 sm=1 tr=0 ts=6aa17425 cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==: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=t9ty7G3lAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 a=Vxmtnl_E_bksehYqCbjh:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-ORIG-GUID: u5cYZ2VMwtXdsP8kmZXU2TE90_BAv_xx X-Proofpoint-GUID: u5cYZ2VMwtXdsP8kmZXU2TE90_BAv_xx 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 adultscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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. Tested-by: Daniel J Blueman 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 0e701e709235c6e0a5efd7f8447dfa6ef6f6e21f..38bc5b483007ad797daaf37527b= 4759bc8924a2f 100644 --- a/arch/arm64/boot/dts/qcom/sm8550.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8550.dtsi @@ -3691,8 +3691,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 /* @@ -3702,6 +3700,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 18:25:35 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 73B2A56C657 for ; Wed, 9 Sep 2026 14:58:53 +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=1788965934; cv=none; b=KT5dzabxrL0vdfyVQ4FFmbFfnqu8yNOoU7MgZsl7vBj0ydF1XfJMggLaPVx4YOI/p2rNBELpTycjX4fbB+q25oZ1AQoWEkFyYpDxJ5DX4B49bxaD1fJSV7YQ3zz2rEu83jFBeKSAphLoH9Nv9hTaEhyv4GTlLL82gqawPkc1R1o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965934; c=relaxed/simple; bh=nYlHwC6PKpfUPCQFPEdwMq/Ct3VZxMxSmtdDkckeGT8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lxQdl8o9g0YKGwqYALpcH6yV8Qp0zQdHTBdZ9Khe70M7hWd+mVtBEpIOWgheJc6APC+7CgbZC2QCMI+dAPn7w2+Yz2UUYW78+ecP0J3qLm2YdUwCOEmaFkI9KzNHuESHZ5ujjjyMoK/07iRM/RRbdlab3VDn4cDusFKWxfMz+sY= 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=VqpS/Z1z; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=gT/nbFId; 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="VqpS/Z1z"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="gT/nbFId" 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 689BU2Os2018943 for ; Wed, 9 Sep 2026 14:58:52 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= P1NS02MIUiZWRkHxOc0gR/eQgS1BhxaJu4QXKOfECR4=; b=VqpS/Z1z8WzRIEx8 TzAM0QfQkHJ2p0D16mQgfW3fsApDBvZLRr+DCahCxyEkpFq2Fh4EFJ5HrIroDBXC 23q9mJqSEeDfHg5qmOa2SqMz5EuMEuhgVRs7fGzswNB0jkJAvPzJBB6XB6hylxQL GJXDSygRwxwy1NpE5uucNJiVeOdea2XcSYbJljmF6oVpV4Dm9yKawpvCab5l2++P agNz3MU0SxZm0tZa2O7+28XOQUTtE3hBqYHWX+EEA+Ip3ljCIVnbUmPSasPe726Z naFEKThmcz8iHv51YdBBZQlNDM+vFhhPxGjl2YnfH0V3GsPzc9gx8qz4w2hs8xoq rvvsQw== 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 4gk62x8yxx-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:58:52 +0000 (GMT) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-cc44d708055so9977328a12.0 for ; Wed, 09 Sep 2026 07:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965931; x=1789570731; 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=P1NS02MIUiZWRkHxOc0gR/eQgS1BhxaJu4QXKOfECR4=; b=gT/nbFIduXPahFoBUn65Buwx7RSA7af+20g1pOEOiHCh0KH55Wau4/msrDJCV/AyRj SsrSAk6B+9JLVlpp8cBVwI3pLr1LyzJ712qwhgVDjYvn7d2M/MvuM0+v0usYoeqsjAuw cDNJ0GNTrM8K6mzhLpnrZn/e/osmAkYMdq1acaQbvkjHM7RysJr/oJ95+97ghfY16HUq N++8CR6TPqV/NqUPiwtOe47ygBQYHe4icmEruPT8tbP87TDzU8wxUQCFMDqkcDhQ+Jwq U5cMaSPQYQs7cQFO5MHyFT3Q3Hsqu57gNawOQ/lgv6iKTLg3t07437taje+3unm9IXGl C6nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965931; x=1789570731; 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=P1NS02MIUiZWRkHxOc0gR/eQgS1BhxaJu4QXKOfECR4=; b=ODNHAHnFwb87CTlBztE6l/1rPw5bDuLxThBvc3qYfwlQ+sh0G9uw+DFG0DwITAluSF ueQVTrD/D5jE2V9L6jg9Hz5UUVNqhV1JSVlSGOzTRArCslirdlc2LjoIessntYuasJqn 55vrhlnIIZcOSsmXjnWx4TUd1JDgLavrXuKsqmnJZqarKH9iXHn72i/T8oUaImZQhRTT twmLn+sbms+pFJVt00l4gsAegZtcZM+Ckf3yqfTXhcb8jeyamaiLAmoT3XRCCDjzdyMv p5kVJkj6I89jPAD5MlLLtDoGoZKM7ufdrDX5UMblToCcqziSUeX/MWaGUx7hO1Pt5loa +J7w== X-Forwarded-Encrypted: i=1; AKwUvByuXmQYSiCECzcaWlQXMwbPH7Kn104QmW9Ox/zDFPPbXhcGkCnv5wEjx8Eie174bqq+IB8gou5KjX6r6uc=@vger.kernel.org X-Gm-Message-State: AFuF++ld4tI6MYJ1mxNH6qaaRgVO69DPqFt3nxpoTTIIuHYQ1N2qSTh5 PHXMXS3/uAoVbhq7g68XNV2Y8mDsViBcv6MzQgidMTYbZg8ETZUS/jtuNM6VS75gvruzjCkirX0 0+HZZBjmpdYuEhXRqrrr2q/PVsN2WCGG+DG8k0GyItI/mZvSECuGAKhHNLKqWcLD5NFU= X-Gm-Gg: AYBFou2a4bvNajSpGll3wCFTcjmxJYFwT/QKIgbksMtuy9BFKeB0k67Cb1Fu2/jUOzw hZDwzpy83JSil74hiqUrqbebaaYBsvO5M7SmP5ClYrinEHhsDmwuvilFc04pMGjUzO8MSsBZcDF WHcBGpFWz8i0sDnc2+a7aVxR9h3/ExzApMjalekSGfEsWqxWX0DHKMeZIKQfL3e+Ck7mOK2CbCB +oFSDhCJ2En7rmla4zUpBthvk/0XUaGheGm5+y+FWlxtB2lSXhqj5CzffDThcGgkSc3hb7ahrqX Nhh02+mJJfbwdKSOAMd2C3G5cXB0NFSxmHwvLJV6ccuuJ40kJANozeHeZHra+wOFF1Np6pvUDbp bB1ia239IyT5X9Ayg+XDKtTrEfiHGk6HU2Wo= X-Received: by 2002:a05:6a21:32a2:b0:3cd:3e77:1dcd with SMTP id adf61e73a8af0-3da39d18cd8mr53688417637.1.1788965931392; Wed, 09 Sep 2026 07:58:51 -0700 (PDT) X-Received: by 2002:a05:6a21:32a2:b0:3cd:3e77:1dcd with SMTP id adf61e73a8af0-3da39d18cd8mr53688366637.1.1788965930967; Wed, 09 Sep 2026 07:58:50 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:58:50 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:17 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-10-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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 , Daniel J Blueman , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788965841; l=3265; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=nYlHwC6PKpfUPCQFPEdwMq/Ct3VZxMxSmtdDkckeGT8=; b=TJg9jPW+LtEtoQPVLGk7bkpFtL3R6/FJZVqPXa5SHK6hi1G3HPDBiRrVpSEykLC2USjw2SuR0 7usvYl/9ejuCaFydP4EkjJpaliOsB3TSM0itCPBuuWLWfJEF62LJLBu X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX4V1FkWtsA0Zf M4Lu6deas8hbS0YL7WL5ezwR5mJTifo3GbOdLlXsHI0F5n6kFDCcRZ5tqlus5UK5KCxZn42YxRy v2IFlUddWNrMKn/L/VRAddsPFsD8Ce4= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX8HkG5cGL9pNi IZ6iLAEmUcMP/Agqe+nVthqXYPXdAU7VxLvPtvNSPw22BNuUYA+x7QoxuuNgp3lLwRmuBfWCOiD Py26Fqt0pXMezaqbAbANdKhzzWazjZ0qCrTd9gkGc0ZIrVYHwbI/O3HnEbb2uHJ/DrrE1FBn5ta bosGrrAEvvTySXL8Am05v1IgpQwgr3x22gensf/myBW3XXvHpQcdGq55Gr/v3GiGZMCZpLrEA4S WFAOimb9fsNFzEU682zZaSwQtg0WIsg31UDvu0Xh5OqTEbwundzPMoXWIKFo6SqLzMTrcWGQlow 1fIaStTAPT6IeN9pW7i3KdlhK3zsVbigEDmxEnQH7Kkdt/bfXzkTXizlFJ/7raaUNWMm5DzWyAJ l6fCFipuKFFumenihG9F2Ndsvr4jBy2Ng0qNWPvFs4vocjro2UJbum4IooMPDpb/g/Q+qOUyglx PVrp7E8kaWM+xpLskYw== X-Authority-Analysis: v=2.4 cv=UeFhjqSN c=1 sm=1 tr=0 ts=6aa1742c 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=gowsoOTTUOVcmtlkKump:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=t9ty7G3lAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=x9snwWr2DeNwDh03kgHS:22 a=Vxmtnl_E_bksehYqCbjh:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-ORIG-GUID: pgapXm-WtT4G5odQ7QtnaoRcmGIoO_qJ X-Proofpoint-GUID: pgapXm-WtT4G5odQ7QtnaoRcmGIoO_qJ 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 adultscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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. Tested-by: Daniel J Blueman 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 18:25:35 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 88DF056E054 for ; Wed, 9 Sep 2026 14:59:01 +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=1788965943; cv=none; b=CIn+KBmUx8+0qWt8aw8HBbTE9+mRiyM92FwEEgUXxX0u6V2UzB4elLQXrbRy9bkLSBUTh1ziOr4zDbC9p3xN7b+wKppnH3Qofz00KaEePDzXg6rsoJxK6hKAnQes9AIskuCgbzSLxET54P5/FfNGLbG8yq5+orIFOgUccG7FG1Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965943; c=relaxed/simple; bh=/1teOhA20hCJgYxu+FMnrEPT3m7d/lo/ggYIye05njM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=S72dSBn6ihLCnX6/bY/mvWM5TXIHSdiuWB/bgb0OGr0uxt4w1OnFOj09CtBenN7v5369K+rAysOCuglu1uQnxH70udBvHSrtOwWNPchEiDUBKlnJOjtqJ1mczF9RGIFfWwSqfflOs+2/5pn74OrFS0KL1wsKsCGJiDZEAciZDkY= 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=RuyevDIl; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=DC/3pdjn; 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="RuyevDIl"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="DC/3pdjn" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 689BUFB32171930 for ; Wed, 9 Sep 2026 14:59:00 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= VAnppm8BS9dp5bk+vJP1d1kj3Ulc8PbpFSD7K9/Pqp0=; b=RuyevDIlRM+eJ8dh YxW2dKxgddor27dwwS3klgfe0TJvC0CbXeEcHhIcswyYoJPDtAhMUWLSBfzUNYNM aybiOHrvQq1VxBNqKjtiIRPIyio7YAqHv6PDoCDq98XzIC+NLW2nCVLdy9LpoPkO +VH17WFEtCPNp61FemktFwlXMv5aVg8oICJdmdwAhgnH7lUkSH5c8ARvWNeuRb7B juiEGEmTA/DpI9ZY9NyuSb+8QCn9XT4DQiK9VAIqFOUHjbEsAkaPiPx1MYfvdRDq Ay2tIZlwPYcIlIHpTjb8oXMVlm0S/cgEDu9OMyWwsgbsIxrrI9fi8hU/Xc5EQA78 YS5Glw== 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 4gk5rgh2tj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:59:00 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2d7443e0f0bso92596565ad.1 for ; Wed, 09 Sep 2026 07:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965939; x=1789570739; 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=VAnppm8BS9dp5bk+vJP1d1kj3Ulc8PbpFSD7K9/Pqp0=; b=DC/3pdjn0xv/lY3tClXPtN6ybyqpSqBj+AcJmP7W/gGTQQfjWCvNtHuutSL85Tkm1K UPNOHFIASv/tC5Vks6s/RG2JHC79fXjYmeO6cC/GesywTOYbmLNOuevsv4TnrZ9MQobt /xAtBKqnBmcT1R0azkJRFotlljgSp8mNo7ZBQoW5i4fGEyXcWa4/pakEanbx7yl0ShZk /crb+6UW76yjb34uMy7cFXg4qREd/13Q8fJanI0XjWCYlG7EZGduYJefxp1Br+kQt8Yy GiigN7MotzEpzGGfNhMmFD39+YBEKE5BEGEWFeYpzjYWy1edWnrtiFjFHslL2O7tydas gAPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965939; x=1789570739; 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=VAnppm8BS9dp5bk+vJP1d1kj3Ulc8PbpFSD7K9/Pqp0=; b=Xx5vH2MZe0t6T9UK/nHKeYRXyBMimz8Wc3GxuXjr6tyJjsDqdcDoEDOFuVyLfFO+5w AyCJCO3m6mvBDI3Ks36fkFXoxrbynHGe78kOCVfwlqUlb9+GFBtCmnT5yaABi8Nkgy+f 8ODxitlbcEGOflvpoJTWuitMk+i6Ptk9/2MgZdHpyqxVOCJdj5Eh8FTxAsYPt/tyjID0 vZvAf4U2Xt/ra69i+m483TdhwcTlOd5WtI5vxN+gQqLKx6kOvbE38ukp7RoWu50cwUX1 ukA6eZE8KzL1yM9eTJmobDrJM43hAl91EkEfM5NmGGIZBLUppQXfSH10MdQnTI7V/6d6 35bA== X-Forwarded-Encrypted: i=1; AKwUvBzpWpul9kdfFq1DKt2RZ0lxSewc7xHsE0zAxwLUfXetBXRYLhDsOflCZEYaeSjRVzRfjL8quXmPGan6zvY=@vger.kernel.org X-Gm-Message-State: AFuF++lAGDOlGqejnN0G3ykDK4F6v0ZJ9d5j6reI6h+0rFVDXG8NHaAO uLeoI+FK3SbZCbsIyAGzf9Oj6PJlFfIPoCmkNisVL2ASeV9m4gCfh9xA6D8CbtQxwRMtP449IWM 11f+l5w4j1qWURYFOcJ/rweHm0sLOpRJtIMDDMplG1G3R4BB1542BWKJ0HUPnZ+RPb5E= X-Gm-Gg: AYBFou05zB8tY3zKsl6/B625OvK0ywo6ONP2Scu+IYOdRvYxdQvix1mWx81yZyPy3KU foq4LmGASnRcjdQiuHyLcUhz1wKp36sD28YexnU8SRfqni6J9HjJVguHzNAMwqq99+aDnyGx+P8 vmXLB199Vy3iboK4qPHg1BMeFW8lft+UCikuql5YjijFgVETTU9YItZ00Iti0OWckXPmj+VW/Qw Pr2noecAnXPP032Gu4pRmslEO2Ho9574208v6GShwiWGXWu8A1SknGjHvqWR7XNHHqWGPyITxRW TXrq0I3YbbfizpuCa8+h+SAojeiqdAis1MH13IOseZAoOTnRXIJgo+rByPywFJZVjrgj1Wgkqhx EsBPFB/XEHYIf7uqSsdHFP5lPPxLEwc0uRYA= X-Received: by 2002:a17:903:acc:b0:2db:5c0a:f184 with SMTP id d9443c01a7336-2dd07a948f5mr23818355ad.17.1788965939246; Wed, 09 Sep 2026 07:58:59 -0700 (PDT) X-Received: by 2002:a17:903:acc:b0:2db:5c0a:f184 with SMTP id d9443c01a7336-2dd07a948f5mr23817785ad.17.1788965938729; Wed, 09 Sep 2026 07:58:58 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.58.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:58:58 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:18 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-11-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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 , Daniel J Blueman , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788965841; l=3265; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=/1teOhA20hCJgYxu+FMnrEPT3m7d/lo/ggYIye05njM=; b=8Odt4O/LMqPtscLT30dGvcgksj3rw9xIE/GdNxCwiui0QqK2AycOstvYdYhEHh8K/Eh/oJHxA C7QqibYMiUyCRN7rfHtMMQzyfWNu+beMhX+5ynLGkkou5t69Ech3bcB X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX/Qxnrqj6b9gE GUzgdYckTKQN2Z80uREEfSv7oyPMBmoqXjteE2V5N+X3rCsp5cThAJ6IEax+JxZrpfBJnV9OAN1 8KMg2U4jvCC+U8f3IvVSkywGmpb11xo= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX5puUR5/DYe7e fZU01axNjschWUN9dIqP7L/UI1VRmPRVN8IWp3SvdzcC2fcAwyTwyXoP6C9uZqyaurx4Lavilnd VgMa/CGOBldnpWWEmZQa5IAUDmi61r+8A9GO44AZDOqMBN0/usglmJwocwfHj6/dL7N4dVA4Eb5 DtumrCabWpsZjRPmQbA1L9loRj8k+9BFpsGbOvmSsZOrfhOglBrhB/RZQMDy1rqGL389rg+0hBh /Yvh67xal9LqJT5jMQ8gZmVYV9i0DzX3MgUydql4LCXaGnqeA/iibzCuGOEM/Wd2sP3cowtpXKl i1wBqYCGVx+TH26otHhsw+M1ACuhs0JZ3K/WGDqoPC9rAHHbmMq34zZkkk0UEaTXO+BplGSus4S yv/aQh0GKhue2kLNH2iwCHm1wfWTzOV+bFsP38zNrwdJEx0VNIobqQRDUfswz8vyV8amXJm7T6n qDkp9HGmzqbMKvEKWhQ== X-Authority-Analysis: v=2.4 cv=B6qJFutM c=1 sm=1 tr=0 ts=6aa17434 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=_glEPmIy2e8OvE2BGh3C:22 a=e5mUnYsNAAAA:8 a=VwQbUJbxAAAA:8 a=t9ty7G3lAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 a=Vxmtnl_E_bksehYqCbjh:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-GUID: yhmFZFxnRIJoFVmqEnJ9BhZPBaMv-urR X-Proofpoint-ORIG-GUID: yhmFZFxnRIJoFVmqEnJ9BhZPBaMv-urR 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 spamscore=0 adultscore=0 malwarescore=0 bulkscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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. Tested-by: Daniel J Blueman 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 cfe39f923224f6c9af0a1b15a84f2fefb90d53d5..e4ad5960c97850693064f5dccec= 9b27cb75f3987 100644 --- a/arch/arm64/boot/dts/qcom/monaco.dtsi +++ b/arch/arm64/boot/dts/qcom/monaco.dtsi @@ -5404,12 +5404,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 18:25:35 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 E3D7458E2AF for ; Wed, 9 Sep 2026 14:59:09 +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=1788965952; cv=none; b=teXhiE5MmPfU85/CFLtz4pF14F9u+ooN3U5hIrhtrENXn/cikk2t2UyFm3/Pukhd1ELfpuKV0+FHh2XZGlovroQkOKKmXG1FwqbTw9fJx6hsIQUJcs0obCAQHRvLyZiPYK2O1hL5mwmXFM0lvieq5bz7zxYZpzdu58iB6yOVewc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965952; c=relaxed/simple; bh=StvgNw+pe2omeRrHk3YDQ6MIS0/aEVQbNU4SMSBkStc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=U2C58gcNqD4N8C317/xjdVAxPPOv9l5jeAjCDX3uw6ahLBinXPIfALH/vLlUWzgHTQgJA3usHWcxW+1/b7gYsWKvt+e/Kn0A2h1HhZ+SV4ANHAjKgNM4A1QQ2UfS/7LRUeQ9KaltHPJ5mBTqW9On4L1zTZj0yhWDNZNPTgtSyLs= 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=Ivr9YxH7; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=M//FmHuS; 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="Ivr9YxH7"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="M//FmHuS" 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 689BUQ152376525 for ; Wed, 9 Sep 2026 14:59:09 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= BwY5ExWkZyWwE89sG5pR6kP1iflIUkO/ZodZnwri+kc=; b=Ivr9YxH7qjz7TFd7 PPE6qaKTy63Q1+zY8AVilirKheZNz/of55OSehtZ+CSR45s91teD8CocsE/MftOE t2Yvft1JPgkD1Pb6bR62FtFIuJUM/t7I9n10M5SAR5/To9X12bMKWrbHefjPRUUk YwECt2ZvQ5KwQyf/Fod9l3jL0yZ8bJO4FbJStq2sPnYcE8eh+fYjJzKbee9unQ0B Q2fOsmgXzNsdMqSSnqqliBb/z/sxuZlTqXIRb5JzCdL6u6DvKraQEnj+Dyjod8bF pKrBO/0QVAxI10BoHGCepbs0rabt9wbVjjaSsKcoPxKEkjQbl1igtdU7bAha+7vB 4sbIhw== Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4gk5ru13c3-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:59:08 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-cc39363cc88so6224514a12.0 for ; Wed, 09 Sep 2026 07:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965947; x=1789570747; 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=BwY5ExWkZyWwE89sG5pR6kP1iflIUkO/ZodZnwri+kc=; b=M//FmHuSWeO+6MSVPaJ4i6L9kT7aQh+/2urVeXohMqMAxU2JkxzPdPfbZB1BFmIo87 YL34u8EpTAAy9sdsel5DHkPAdDgHWF0qtp5sLAY54+uOQvnkAzQDcVUcDoYD4/ECAUeI zcUfqPAlICtDtubfzWIuEohepVFziLvIbDmbZ86qXo1rdG9/XctdJgYAQKgH0SLkT6P+ OCV9bZaHjGxQDG7myMJI7B/uIz0J2lQJE2TNqgb4TGVEJVe7bQosNijQJ9XYAiyyCxzk WKRU/9lW5xLwPIG/eqSV1fW0FCKG5Lt0uvpJpjsRokCxIPf9g29QnXAJwGw5G6BcvHNS NVsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965947; x=1789570747; 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=BwY5ExWkZyWwE89sG5pR6kP1iflIUkO/ZodZnwri+kc=; b=D38jrokfS5PRXG4xYFSJ9WSE/g7px96NACd8E+4yKnMiMKbPjZobIkO5Ui/UQMzZEm alB3hQW++xMUjiAaolor2MBKZvDQfXbop0WACUHRsfOpzltTKh3nEEBT9ZOPp2Zhh0ek /dAWsylGS33wqHw+ShF2+l8A0UGc551YtyZAHWTmTQS04tarosljO33U0Kdnq4lg8r+1 pWLVWOliamC6lawbDvJ5UGvMP7XbPXUygrmcg30NnrN5XyxV3mA2j5T/uY3Kwa0xQAo1 DyKaN9pWmH/gNfeMRw/7kPs7ooYWIORoeGJMFp4xUQzunSKLPzfyUx0slkE06uHB+UCI uRIg== X-Forwarded-Encrypted: i=1; AKwUvBwbDebhvvV1nFpzpyj/H6N7YyqIDUJVI7FR8YJyPp6QUeZ+C2ibmTtxODukkicWAqdPsWrlyl93y3eN5mY=@vger.kernel.org X-Gm-Message-State: AFuF++lNx+BG/2GmIhXaSdfiICSFJwtObvLl1l3FM/RLMIz77di18R+g Uq7svJ4PL4JU3vApiP1dgZEsqt0IjQwLf3RPfLsjbzPBSy8bUyiL4kQZzOxS6rKkgADnaj8gFf/ k9g6ibQfIsBtidnUTNUip7ctHtGrZfoDqQA15HTqLwd6g0lY9sypczKMKEvTcpzupLss= X-Gm-Gg: AYBFou0aZangREKooR60F30n3pqBArrRRvkfjGB+RSZ6d2nhtLI+wbHbDxAWi7V/eV8 WdVln0Xp+KTK+JEYqgt3WhZu9On1vqnjLo4ju6Z5aoDf7F3dp0jW5tH5CI0tpIR9e+AIrFDv7TD +C4V8pZ1PSuw8QoSpnJ24gibXad4d1XUT8FGFSh0Yvu9rmuWmr6+9mBPhjsdxRvlDokY5A/v9+f 8L2Fzl7nJ8UhmqtT0In0RExfMvnezicyPvQG21jAeG99+Aj2ZrwvC0aBgsW7n034AC3+SLomfn+ KywUH+MUJDPnl3xQZjQeO7/qoqPGTmsdJqr4TcVQi/DlqqyAhbQirphCQGeJ/G1Pp38uZiHYIP8 U1mANxrFfIjcEmF5aMA7DbEZbusZ8KPH6oKg= X-Received: by 2002:a05:6a20:9389:b0:3d7:eb3e:1c58 with SMTP id adf61e73a8af0-3da39d13c08mr59841839637.8.1788965947370; Wed, 09 Sep 2026 07:59:07 -0700 (PDT) X-Received: by 2002:a05:6a20:9389:b0:3d7:eb3e:1c58 with SMTP id adf61e73a8af0-3da39d13c08mr59841748637.8.1788965946852; Wed, 09 Sep 2026 07:59:06 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.58.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:59:06 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:19 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-12-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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 , Daniel J Blueman , Vishnu Reddy X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1788965841; l=3422; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=StvgNw+pe2omeRrHk3YDQ6MIS0/aEVQbNU4SMSBkStc=; b=b/mUTIVBUglZDbnOFxIiJehQ/XrYuF7nJRGrtjY1XZlBH+TGoQWrJUEEG7WCGnRhkWGD8Db05 o0SQiVdLKb3CZ907/VF0Dkm8PNycJxIskf9osuYA80mt1p4b3ZzgLgR X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Authority-Analysis: v=2.4 cv=M+997Sws c=1 sm=1 tr=0 ts=6aa1743c cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==: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=t9ty7G3lAAAA:8 a=EUspDBNiAAAA:8 a=w7pRem5UOBajBC5HA0sA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 a=Vxmtnl_E_bksehYqCbjh:22 a=CsAS6f0m0zARWR-uHzm3:22 X-Proofpoint-GUID: nNe5w4fmFbxBrN3ly-0H6P-jDMe2pF9B X-Proofpoint-ORIG-GUID: nNe5w4fmFbxBrN3ly-0H6P-jDMe2pF9B X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX65uQEhhxFrQG jgIqwUID3JAuG6dh1zZP3S0VF7YSGykF8cRsRN27c1qFR4pe6cPZ4Vaz24aXbu+87ZI6JL+9Ttj np1poQvgJng0ETojJ2CYV+RZkZ4NLU4= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX2OQUVFHd9Fa7 vSdq0aJH3fpGF9r+0OjNUWiXLuAym5PS1OXFv20EeA0lVTT/xpJv+ps0DP2HdACkkU9ZvEj3yEB pBYclIk+FqjhLrN2fX1h1cGCRjlNCxAqvf+rSjSV50kKrFXedqnGQc5rK+jhQnCdD74DhlH/HFv CTAuHVI8K/RWMLq0Hg6L5jtaJWmfJuzkSEgBzui4NRIoEP/XxMFpq5hiV0ObQqqTcGFyEXx0RQA Np2Db6qekphAYR2N4BHyVPo6RLrtK/tP6EUiZau/61XvOjhNLms2UR8hst818EjBY8rQYYM0YiJ nYhfGFYCqg2mNuU+Nyid0KmcxDdM3Va75zLL2w8cO9nALKI8tVp8j/hpWMm3dgTuGBTjipdfIz3 DBA1wOm//AaiZBUGPFaadsOVldVJumIUSd7+n/NvdU9lhTjrIg/Ac6LGSKdNuMMZVQpCDcByc9C dsv42C0m7ujIWwp7Z5w== 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 spamscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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. Tested-by: Daniel J Blueman 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 b679fd8afb7d533f2ca42316cea6fb34997feb75..97dad9c7f7fc47451d14620700a= a5ec9ff0d09aa 100644 --- a/arch/arm64/boot/dts/qcom/sm8650.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8650.dtsi @@ -5275,11 +5275,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 @@ -5287,6 +5288,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 18:25:35 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 60137579801 for ; Wed, 9 Sep 2026 14:59:17 +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=1788965959; cv=none; b=EWHSgng5xgyq2wCmvlz133nTl6QbLv6BWfMTX04yFZ57+Z+hV/5LXYor80Yz/zP9aS/7A+PtqJUoSWUBC23PSrGrHQXrZyqWFvydStU0kUwecVYyBVsrWwggZ4utpUtAS1oEzoDb8+thqHt2tIdsKQPww/OF0T5el77Mx83XSqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1788965959; c=relaxed/simple; bh=h2XojM5tefCf9ICzxKvMGK1x/tP3acL7PRQ2mqf0kt0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GHBsPbrQ6Tt8UjSbkyS4mFdQ5MkVe45XrUb8cvWdW4dds9ycTuv6QJR2RT0NdIiTGQUU8ZP1JX/XZR4kOWKfsTnebZcJa1mjpOKpxKAj5OhKrzr9iXJ7jc/Vnu1zCz8ZiFY4Gz/9JmUPK5V/x4QWRsGwsW3dwKrtAmS4aDL+nXs= 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=cG76sAtg; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Q/GtJnjT; 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="cG76sAtg"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Q/GtJnjT" 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 689BUCUq1183802 for ; Wed, 9 Sep 2026 14:59:16 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= W9fTRtJ5G9UzjN4GJu0Gi6NH567IxpYmlV8JOuz/pKA=; b=cG76sAtg904gnYo7 8h/mIbiYmC5fPv3UpMdgj89vPmE+bUwtIZiML2rkSVfGPjPmpTnJbc22GtI2QxiA 82AKxv0f9EbwNeUE7YfoeEI0oNGO0VvD/nc5393QzREtHt+oPnG3MyGMVEqOtQIv HnteATK2u8jVJwIZCy3Co6jtXZjzNG7JHC+kIeA4Y5FvGzMK5bI12GPMErLqm/yU fAAlsCzOyjCy9TaozQlXxFlD/mv7gbjN8Wsnmw10co5VW4gHtUfaQWFMn9r385kZ hA9SQ1lxFii7Gx1J0dUyqLmZnN/ex8lPm8UptFEE/OhSYkVO6riNojURfHA/wH/4 uJ622g== 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 4gk559s8nn-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 09 Sep 2026 14:59:16 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-39512608fb1so12540591a91.1 for ; Wed, 09 Sep 2026 07:59:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1788965955; x=1789570755; 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=W9fTRtJ5G9UzjN4GJu0Gi6NH567IxpYmlV8JOuz/pKA=; b=Q/GtJnjTrm+Sy4N/hDrrtn5tcSpdYtl4sMIcDMOaveaqSuKcRty9nUXFN+/uzFvcJx 1j1/sDJ2niSI2TpjurYkmGTRd9cdq3kohYYvzcX8UrG3uDAp/M6xnqQYhRDochHBmUQR 1OrGRDKmm6yeRFjMefDMgn8HCT3GGpc5VU41NUyLX1epbBiPF1PSHncq+yXS8nV/lfJt yc2FpFUFH9bajk5Y029iaPZntQi9wQ63aW5rZw+boynHSmzkRA225jWa4U5MhijQtmLc ajT8PUrQ+B4l95IVv9DWt4PhCtSsLPVLbHfDC2RRAmx3m1WSJp7oB6fOfvI/9Uq/+ozU cPMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788965955; x=1789570755; 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=W9fTRtJ5G9UzjN4GJu0Gi6NH567IxpYmlV8JOuz/pKA=; b=RM87TccWLmOFtMF2DKLrfqXmvEXuqNcVHXl/PWptU7/ZIsID/zAYvTBt24yTdwpBTn /+5NLZ1ojxRxDGcqtGByHdTy8ZfUauk3dBf6t4uilPb1k9gciHMCKY7xuRZPQIWc1htv rBnSS1EiWnE2KBkEO8ueeo8vFPX0vuCItLYHA59Zq1xYxMdQuIOT9QbRj50ZMYrLEnHD 1LPdQZc/NyJlnU1rqj6/srywPV5vJEzN7TNotXMvYcc6My9rDUn8cl35Zzx5fnRqXmoH Ix1m0cSSGHnNuRpIsyzr93r4p3bHTJWdzNvti9dqX0gpt7572Djue6MlPDqnisA90/O8 h10Q== X-Forwarded-Encrypted: i=1; AKwUvBxH74J7DCdsXx7Y8cyCgwmklUGLkmg9XDW6DdRfsrMEVZf0Q5peKj7ocL6+B8ZHHZxyrre5kLyHy0fBy8Q=@vger.kernel.org X-Gm-Message-State: AFuF++mj3ERQE/fMUCO2+RiCPo9mB000KpFDA5BYrTtxgbZgXsspIktz 3GtWZ8fuhfMsIuu+pJ4KT69bUE//nOy+7UxEdX+sQEiPm7KLicuHEOhAwLgqVMgzRCPEV9N6kqt S5d5EsOF7de2bKAMf4n/zJa7B4ZOhAVOSeArmuoBUvmqNinPLedmrv/xJAQq3DlrTqCg= X-Gm-Gg: AYBFou0PMWdRdYjSdKEn0QSo9dpLAEM9qdDg5YG0Zo1GSLRk2JM16qkiCqW+/xBvj1V KQ22WEw4tYhuObF+LVEBBO42eC+5BowkJvOlRk+xS6M8FhXGJZdqjNInb3qkM5/AmXxG96yrBuO wi9DBhuZVWh22kcR7j4dnliM4U23+71i4qxpTvGVhAPkE/Btt616XMgB4UpOn8H5CjaWIlC/KYm fflQEagvZpn/N0bPlxv4NIGTmYLxvvIMtlo/x2/uVgCx7AREwQ2hRe9r0Bd2f1uv7zB4QV2z8Kb 2+2r61rnf1dPHKcYGCDF/NXoum6g8368OTLK1MlVS6CSAo1YjInYS3MoUWQgstj0650GjllEdJ5 jed2pnancU4bqkA7DFsdChE39JHQEXfrr8Hk= X-Received: by 2002:a17:90a:d647:b0:38e:70d5:b12d with SMTP id 98e67ed59e1d1-39b261074camr51452922a91.6.1788965955143; Wed, 09 Sep 2026 07:59:15 -0700 (PDT) X-Received: by 2002:a17:90a:d647:b0:38e:70d5:b12d with SMTP id 98e67ed59e1d1-39b261074camr51452855a91.6.1788965954599; Wed, 09 Sep 2026 07:59:14 -0700 (PDT) Received: from hu-vgarodia-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3339b608409sm51270766eec.21.2026.09.09.07.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Sep 2026 07:59:14 -0700 (PDT) From: Vikash Garodia Date: Wed, 09 Sep 2026 20:27:20 +0530 Subject: [PATCH v3 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: <20260909-vpu_iommu_iova_handling-v3-13-2fe43ae45495@oss.qualcomm.com> References: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@oss.qualcomm.com> In-Reply-To: <20260909-vpu_iommu_iova_handling-v3-0-2fe43ae45495@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 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=1788965841; l=3606; i=vikash.garodia@oss.qualcomm.com; s=20241104; h=from:subject:message-id; bh=h2XojM5tefCf9ICzxKvMGK1x/tP3acL7PRQ2mqf0kt0=; b=Kizq253lj7QjfHJcnZ7zy9OA4yO8Dh9a8KxZYx/V9gYA4sy2zQ1areBnDS5fsCu8+pwV2uVEA PJpTNoIXdMQAujK3uD8kMmy+UpOgKipk6Oe/Z7QuEv3nHDcQBS/VIZK X-Developer-Key: i=vikash.garodia@oss.qualcomm.com; a=ed25519; pk=LY9Eqp4KiHWxzGNKGHbwRFEJOfRCSzG/rxQNmvZvaKE= X-Authority-Analysis: v=2.4 cv=KP1qylFo c=1 sm=1 tr=0 ts=6aa17444 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=yx91gb_oNiZeI1HMLzn7: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: DpuaDoga9pIiZlxWT0H3kvChIvekSdp_ X-Proofpoint-Spam-Info: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX6vfY+dumK6eX yElfFzjT6ZzLklzD+GeKD6sR7twKj/IVb3/80HHD5MQ0ytKjBgdTNM+R6VHp8ixF04p5x5oS4BH mm/0r7jWdqQwmQZgupbUj7nnvRv4qTI= X-Proofpoint-GUID: DpuaDoga9pIiZlxWT0H3kvChIvekSdp_ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTA5MDE2NyBTYWx0ZWRfX83j4FvWAeXe1 csoxQ+DuD+SbmYzMnT34jOXFLkUwSvEa55jYcvDyeVcqCQgtreXo0Utg+jwJMuUxfFoXFEPgsUr Lk8c0qu76sJAOSIBv0UYmQBZuJEuWe7bGN/7dSm7V/rJ2pzVWmspM/RYJTSwmijNLJ5Ei/TNw+u dBXsYKmje6qFelu1953XWezUy419EDdXqS4w/E05mlRVjsocFXVauRlO2reN6XLSwB//tohOAqj nJbS5R7mrVDOncEqTnSJppPJnsXxU79FCm/6ZI9BppmTX5EC/99VEq2ihr4x4DNyw4R2Pc/i03k euwEHbGL7VJIZKzkChYUqtrMUChhNPpU5pKDF04iZFIZ/oJ2pvfCh4dN0aKLgr54CLB52iWOfN+ kMArFG0DB8VklFhrbpkf3c8/sFNKuIzm1Ht6O52Y2Jv7VU+R6GKkKAnVG2oJPRUcJzWRwBWyhtt ztJah3P0Ab73dw7md/Q== 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-08_03,2026-09-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 adultscore=0 spamscore=0 malwarescore=0 suspectscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2609090167 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 eb3a6990ec30ba3ca1c3fe468ffdb4e9df00174d..206ac22cab2c0dfabc1ca5f619f= 598e4823776de 100644 --- a/arch/arm64/boot/dts/qcom/sm8750.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi @@ -3026,8 +3026,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>, @@ -3060,6 +3058,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 @@ -3067,6 +3069,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