From mboxrd@z Thu Jan 1 00:00:00 1970 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 44345303A12 for ; Sun, 8 Mar 2026 19:34:10 +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=1772998451; cv=none; b=Zr6NaAq4/RRNgpY9+96e6Qbk7WSbq6uslSyeYfDzTZaLh292sE3kzW/p55WbJuC8c6uPtG57wdtSb/yDgAUbZ7aWp4xUDGwLcdE7d0hjOnsQlKansUumb7+1oNi94d5U+hJuCWzSNf2AquO3B/DaGPFgQhQdbm7rME1e3l2W3V4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772998451; c=relaxed/simple; bh=PtTdudtjBZ/xPMrnHDRK1H9Z6n/XjfTDJSglqtupcDI=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=Lu84W1xPT/mGZRdba/MCVoObqrqz9N/s4LWBumwa2u8m8Je1Mbz044LBZBQBs5Stlb4Oa+6vI/jqbYaglkH3/A7iWlxRgvZ96PKdT64VnUArw5nsqqeRFrGaJQh88TGaQvDSaLwg+FyMXcmxf3LgggtE1sn7Oq5xZ1l2Zu62XNw= 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=Iz5I4QQh; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Yx/0Jqkv; 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="Iz5I4QQh"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Yx/0Jqkv" 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 6288jQKY1311694 for ; Sun, 8 Mar 2026 19:34:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=DNMdCDB4m/JS2Eqb4Zd/0G 6oEd9rQSbuN+RA5pJMqjw=; b=Iz5I4QQh+5X+EdI7ZbWYkCwMd0XsXKEgZSSk7u fZ9Y3l6+S7LKgAOi7D3AfsdoMASdDUtGTK7RZzHvs5t01JfUzEaojPuJ6bMc9ofc 2/bd2VGoUOQMpwJRFzwOorskgCxsdkMtTQplIHuOzWjx8AvvZ9lxxJMGtGLNxgSn anN7DXhtVfkGW27Ex2TmfG1rL90bMyaGXdzyW12WT3YHHeNaHtVQP07xfglcjK+U 3Hq+dgArnD8ScoB11PW9t66PZ9SMoa2utjEkZ1vtKayFBjoNbGSTSExpPj7knnQH KyxIdiH5oJAi7giVdLeW41AZ3NV+Hguvx/+DxBT7wj64Xk/A== Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4crbkxu27v-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 08 Mar 2026 19:34:09 +0000 (GMT) Received: by mail-pg1-f200.google.com with SMTP id 41be03b00d2f7-c7385a1476aso2454632a12.2 for ; Sun, 08 Mar 2026 12:34:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1772998448; x=1773603248; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=DNMdCDB4m/JS2Eqb4Zd/0G6oEd9rQSbuN+RA5pJMqjw=; b=Yx/0JqkvQUSPveBKs3O8kovCl+BlxHe8F5WqxoTpKnUsLilouTgezVJ08H8cw8W5kD VnSdufS0GclvmSvH469bjGCdfE9ym08FvZ9K47zvQjX7Y2vg25BcxhoxIAkgLFHeLVlA NDNSY/F5H1B2k5uwCGfPopKWwxZlFP0Gwh36MNF8p4rmY91IBV0auVjs9cs9ctonrCwm 5gwDsWLmtMlJ+v/4NvLh0Q2cn0p7P0UPkV/P7LNsB0UqoOp+li6bgE53yrgvnlE9OUUj TF2w3g/tzSgSrl2pde2hSj3VTJJyrZRc/IMqzkmeytLkJDmxBK1n35kGimpHs9WffewN ApQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772998448; x=1773603248; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DNMdCDB4m/JS2Eqb4Zd/0G6oEd9rQSbuN+RA5pJMqjw=; b=E9/0SrhNX/QnIbUAjI80aQGVyuZ6EeDRKWMy0T/vBuS6Otp+pFA73Vhv6htucaxjNO ex2e9/t+Pnh2TUUOYrCk8Q6aRO6ofjYeMcZ+m5hc6kohUI2jtqEVDwB0gw9vBzTHSGUy VsoPD6I/1Pw1cVRPgcDHFT0j+HgyUuI41aeboRo/8wt86n3BxLO6jA+6L6n4BT778Bv+ MFr/juho/SLvkgZus9k5HgSj8HutnVrH+mD8CDgLp/jehS/Rqg503tu3+Jc+eZlrsXm3 P77EjaqBwGFyMqrpFamxFH01fDdC/swUCIfkFaEmMR19anuWIx5Q6rZqpEsENYi/wIz2 PuhQ== X-Forwarded-Encrypted: i=1; AJvYcCVz5za2kcfiUbZu8xLoIxMAqj7kl/SmwRRP+SZTUsmONs7C1L3U2YZg48uN+wb2SgMOsNtdIoZU0Q8m@vger.kernel.org X-Gm-Message-State: AOJu0YwGzI9V+L6D/1/SV7QH78Xyzcz4XwTLW+WRZZ29VrYVPXxmmDfi Rkh5fhKN4gddbDvxwGYKjXnmLVvazO65rPY2XAYOdiySGuvsQ2kqQwAO6VEJpUTbCw3VOIp0anx ClDFFzQz7LUg0oGDDumedt1dsj4ISwag3GMGmxkkyn0+xIGDQDBBPVUO5igIBebJu X-Gm-Gg: ATEYQzzlYbvoR67qim3wj8SQdslLjoxbMVahCR0B1UNjjSwJxJQD1hP1xyJvr6iZy3M aIETx7zMOu/PKczrWq/INQOB8PZR5JiZNjl1CMlPalW6yAqD6qIVmtIND38uSirAAh3cDb5dR6o LgabE3WOPE2FI7FaK/SfBS76a+2sYMHPNjma3C1nW0mgVu6ZRZKK1So430F2VGoVKJTb2VMhfKS YWlrJZX/PNu6bTWIBniH1eS6kax9fMp4q5YviceV7RBCPpxAUwb7D7AnUGidYHNJhcBJLEa+zig 6vNE1JHc/DX4Af0ujlElJ8udfkshak8ALzITPKuIGu55jOlnL9j/OAojFWrI5OU8maEY9vphjTv j6VA7DhSi8iWd+oUCXOnN25A1GSiRDXI0LQ7v4L3gInzazcakAy3itZtd X-Received: by 2002:a05:6a00:4b53:b0:829:6f9f:ea3b with SMTP id d2e1a72fcca58-829a2e3d086mr8046013b3a.20.1772998447764; Sun, 08 Mar 2026 12:34:07 -0700 (PDT) X-Received: by 2002:a05:6a00:4b53:b0:829:6f9f:ea3b with SMTP id d2e1a72fcca58-829a2e3d086mr8045981b3a.20.1772998447234; Sun, 08 Mar 2026 12:34:07 -0700 (PDT) Received: from hu-vjitta-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-829a4676593sm7818909b3a.28.2026.03.08.12.33.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Mar 2026 12:34:06 -0700 (PDT) From: Vijayanand Jitta Subject: [PATCH v10 0/3] of: parsing of multi #{iommu,msi}-cells in maps Date: Mon, 09 Mar 2026 01:03:36 +0530 Message-Id: <20260309-parse_iommu_cells-v10-0-c62fcaa5a1d8@oss.qualcomm.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIABDPrWkC/32NUQ6CMBBEr0L225KWKgpf3sMQUpZVNgGKXSEaw t2tHMCfSWYy82YFocAkUCYrBFpY2I/RGH1IADs3PkhxGwPIdJZrq42aXBCq2Q/DXCP1vSiD1p7 zi6OmcRB3U6A7v3forYq+Y3n58Nk/luKX/qMthdLq2JoGiRBPZK5eJH3OrsfYSqNAtW3bF4mVr Ue6AAAA To: Nipun Gupta , Nikhil Agarwal , Joerg Roedel , Will Deacon , Robin Murphy , Marc Zyngier , Lorenzo Pieralisi , Thomas Gleixner , Saravana Kannan , Richard Zhu , Lucas Stach , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Manivannan Sadhasivam , Bjorn Helgaas , Frank Li , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , Dmitry Baryshkov , Konrad Dybcio , Bjorn Andersson , Rob Herring , Conor Dooley , Krzysztof Kozlowski , Prakash Gupta , Vikash Garodia Cc: linux-kernel@vger.kernel.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, imx@lists.linux.dev, xen-devel@lists.xenproject.org, linux-arm-msm@vger.kernel.org, Vijayanand Jitta , Charan Teja Kalla X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772998436; l=4795; i=vijayanand.jitta@oss.qualcomm.com; s=20260301; h=from:subject:message-id; bh=PtTdudtjBZ/xPMrnHDRK1H9Z6n/XjfTDJSglqtupcDI=; b=EBb8Dk6BIlgjCH0Fqcmr+R/Zem16FjzSLlrw2KGhDvNxeYgPJwLHInLgJNWKtbmBgHLkCc5NK xDxh7Np2VUaB9ZsluGW3jBruuRfE5BZGHAei8UQe3BXzG9rX5bRMd84 X-Developer-Key: i=vijayanand.jitta@oss.qualcomm.com; a=ed25519; pk=Lpi7Cs3wHe8KZtqvyci7FTOLzsKpEHKGCaPNZw+1zRI= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMzA4MDE4MSBTYWx0ZWRfX0gbK1fd98MKG Y7cw1YDuYMSbYxJbQZQV/Ae+9dTI2Gspo/CFNQ7+AL9tQwJnBqfXgBZ2GKiTJY0XXKx11K646d4 mpuTLXoJtjA3JfJbziqUc5Bxz2coA7udtEHrSMpgb7MMta+RC16dziULjLuHl5Erwk8DUkVNRgW a6p52D2lJoEUARd0MTeAs7Pz0U+yUFCeySdyPWtqP5jKhal0ursjnljTDAwPGfP1gaSBwtXPTjy T73ftrpfm96iH3VVcqwJNk9i0dUhZh+HBivbvfaRMi76iWs3YgyukbXqkSyYUa+OowwKvmLS5Vk 4N8bAyudgmFY/tjWr9qn86Ubb+xdjLVXXP3eXIb9qL06o40Q5SyAz0O+lsplard8dHHIPDJtgD5 7gOyeD02zIupQMu8kPLNc2BR90TNCVRZmma+Ky/wuaIuSGJdNKqU7Ctbs5RypZMM0grsDFdjjF2 XbDZnQdwvsV80qLTj3w== X-Proofpoint-ORIG-GUID: degK7OdI0nU9DycQhR46H1HKnW0ykVqx X-Proofpoint-GUID: degK7OdI0nU9DycQhR46H1HKnW0ykVqx X-Authority-Analysis: v=2.4 cv=LOprgZW9 c=1 sm=1 tr=0 ts=69adcf31 cx=c_pps a=oF/VQ+ItUULfLr/lQ2/icg==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Yq5XynenixoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=VwQbUJbxAAAA:8 a=COk6AnOGAAAA:8 a=EUspDBNiAAAA:8 a=NEAV23lmAAAA:8 a=hUMMoPFcHhpVZiwYRzIA:9 a=QEXdDO2ut3YA:10 a=3WC7DwWrALyhR5TkjVHa:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-03-08_05,2026-03-06_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 malwarescore=0 adultscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2602130000 definitions=main-2603080181 So far our parsing of {iommu,msi}-map properites has always blindly assumed that the output specifiers will always have exactly 1 cell. This typically does happen to be the case, but is not actually enforced (and the PCI msi-map binding even explicitly states support for 0 or 1 cells) - as a result we've now ended up with dodgy DTs out in the field which depend on this behaviour to map a 1-cell specifier for a 2-cell provider, despite that being bogus per the bindings themselves. Since there is some potential use[1] in being able to map at least single input IDs to multi-cell output specifiers (and properly support 0-cell outputs as well), add support for properly parsing and using the target nodes' #cells values, albeit with the unfortunate complication of still having to work around expectations of the old behaviour too. -- Robin. Unlike single #{}-cell, it is complex to establish a linear relation between input 'id' and output specifier for multi-cell properties, thus it is always expected that len never going to be > 1. These changes have been tested on QEMU for the arm64 architecture. [1] https://lore.kernel.org/all/20250627-video_cb-v3-0-51e18c0ffbce@quicinc.com/ V10: - Move of_map_iommu_id()/of_map_msi_id() from include/linux/of.h to drivers/of/base.c as out-of-line helpers per feedback from Marc Zyngier and Rob Herring. - Add kernel-doc to document both helpers for discoverability and usage clarity. - Fix of_map_msi_id() wrapper and all its callers (cdx_msi.c, irq-gic-its-msi-parent.c, drivers/of/irq.c) to correctly use the new struct of_phandle_args-based API with proper of_node_put() handling as per feeback from Dmitry. Link to v9: https://lore.kernel.org/r/20260301-parse_iommu_cells-v9-0-4d1bceecc5e1@oss.qualcomm.com V9: - Updated TO/CC list based on feedback to include all relevant maintainers. - No functional changes to the patches themselves. Link to V8: https://lore.kernel.org/all/20260226074245.3098486-1-vijayanand.jitta@oss.qualcomm.com/ V8: - Removed mentions of of_map_args from commit message to match code. Link to V7: https://lore.kernel.org/all/20260210101157.2145113-1-vijayanand.jitta@oss.qualcomm.com/ V7: - Removed of_map_id_args structure and replaced it with of_phandle_args as suggested by Dmitry. Link to V6: https://lore.kernel.org/all/20260121055400.937856-1-vijayanand.jitta@oss.qualcomm.com/ V6: - Fixed build error reported by kernel test bot. Link to V5: https://lore.kernel.org/all/20260118181125.1436036-1-vijayanand.jitta@oss.qualcomm.com/ V5: - Fixed Build Warnings. - Raised PR for iommu-map dtschema: https://github.com/devicetree-org/dt-schema/pull/184 Link to V4: https://lore.kernel.org/all/20251231114257.2382820-1-vijayanand.jitta@oss.qualcomm.com/ V4: - Added Reviewed-by tag. - Resolved warnings reported by kernel test bot, minor code reorganization. Link to V3: https://lore.kernel.org/all/20251221213602.2413124-1-vijayanand.jitta@oss.qualcomm.com/ V3: - Added Reviewed-by tag. - Updated of_map_id_args struct as a wrapper to of_phandle_args and added comment description as suggested by Rob Herring. Link to V2: https://lore.kernel.org/all/20251204095530.8627-1-vijayanand.jitta@oss.qualcomm.com/ V2: - Incorporated the patches from Robin that does the clean implementation. - Dropped the patches the were adding multi-map support from this series as suggested. V1: https://lore.kernel.org/all/cover.1762235099.git.charan.kalla@oss.qualcomm.com/ RFC: https://lore.kernel.org/all/20250928171718.436440-1-charan.kalla@oss.qualcomm.com/#r Signed-off-by: Vijayanand Jitta --- --- Charan Teja Kalla (1): of: factor arguments passed to of_map_id() into a struct Robin Murphy (2): of: Add convenience wrappers for of_map_id() of: Respect #{iommu,msi}-cells in maps drivers/cdx/cdx_msi.c | 6 +- drivers/iommu/of_iommu.c | 6 +- drivers/irqchip/irq-gic-its-msi-parent.c | 11 +- drivers/of/base.c | 202 ++++++++++++++++++++++++------- drivers/of/irq.c | 9 +- drivers/pci/controller/dwc/pci-imx6.c | 18 ++- drivers/pci/controller/pcie-apple.c | 6 +- drivers/xen/grant-dma-ops.c | 5 +- include/linux/of.h | 28 ++++- 9 files changed, 222 insertions(+), 69 deletions(-) --- base-commit: 3fa5e5702a82d259897bd7e209469bc06368bf31 change-id: 20260301-parse_iommu_cells-1c33768aebba Best regards, -- Vijayanand Jitta