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 B03F23ACF01 for ; Wed, 21 Jan 2026 05:54:27 +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=1768974869; cv=none; b=DOd5IXe1VoH648/iUgwoi4M1SgGaHKOgzTNEh4NLHceDoNoT5eQ8g4+YjiWPNHBHiitekBU9jBNyEun1pDby3iEUXgUQYD76RoVwj44hZcEdykfMHVjr+QwdUOr5Ok5rOPCPHIqq2hpnrVacEonYZ9JgWM7XPDuQuOiv9e6nIYs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768974869; c=relaxed/simple; bh=DNJDXPsUt1J6+u92cF2N8JlAKwnB9iuDYqHcttTUOfw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Mazge4gEYe4QJkib8ZzXQdNfCuOnXTnIYyzurwD2m6njr3qdX4AvZH3+t1UxJUd+cdTBZyGS4PgzSODlZI7qrzS+AY5Al9F/oY56er1SSqgVH8+e3dXLiYudpt2UcVWC25tJKzmb2JcGO7M8QeEWZSGF7AGXP+zidCmYBRjXWjU= 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=Jt1LPo/6; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=XM7X81Re; 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="Jt1LPo/6"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="XM7X81Re" 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 60L4XUEW3229040 for ; Wed, 21 Jan 2026 05:54:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=i6pPJkWRpzv2QmUHeIdBG2n9cDFr3LIvlRj x88PG7Hc=; b=Jt1LPo/6GqID9N4RIA0mWo/j9ZD9Poyk88nQpaBlfz5auBymK+D b8jFsABx5Y1J2nl6bZ1rKwUrh8URnBSdDpRX01qNhzsEXHOGc/kUDG7K184I3xNl QsFaErXX5JAC8sYcz18pjrxo4IYT3ZqOg0CbZrhEn4BvbcZQ/C6toqUqWc58nM4v Q/tLejPQIcfvpwPmzeLraoyUJXvDvvJWKtKeCf7wC3G8eCHNpBkYuU+HbO9yDoEH vLxDeK99Id+k2xJTuhwZ7gql4cPiwXc0BAE4KrCxUUKhirYn3sI8W/rdVmcwangp bAWCemOO7han5bR/4MdnEzxkilD+y5XnowA== 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 4btqvp86xy-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 21 Jan 2026 05:54:25 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-81f3f3af760so10714174b3a.1 for ; Tue, 20 Jan 2026 21:54:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1768974865; x=1769579665; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=i6pPJkWRpzv2QmUHeIdBG2n9cDFr3LIvlRjx88PG7Hc=; b=XM7X81Rezj1Qhge5TJXuWhP+YNfDa7wZ7G8Zu7wNTxhhcAFQP25BDU3/K4pgi5Nj4R 3v87wV3aYusFTepG7s6MO+X+KmWayrcsr888yPFps/fF0uFJdJhrT06jXihO5iROBTUL dUIxVO1SSaaXsmaTkE5H8SGe+KcHGj+ok8z+CMLeEPv/WEiCMPXATUuxHAt+ihnTTz8U 5kZGN6fXCnTle8hgOHRpOnVMuFJOyChNX4UjKn64yTVAYcmBXZyMuj7XEYFGMClfOhSX Z26ceZU7Y4An0zRDlf0UjEUWnbr6satP7Zd8yj14YccvkSgbpK7BJHcJ3p07OR4w3//s 5NWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768974865; x=1769579665; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=i6pPJkWRpzv2QmUHeIdBG2n9cDFr3LIvlRjx88PG7Hc=; b=ndyTVkmIg8NltyXI68O0fkrVNZA3y9ohNn4gaWO3CEDkpz7Sx3sRo9Ov5LxSTdNlEc 60NruRHHNPLXgam0ah3wlWzU59vfoF2mMeGK9KZWqq9mGiNuhHPx6niwIoMRlhW5I1oP OGoHFIh6XyAoD0f8ioIJeHwYIYZCVyVBrj+Ycd254eHI7BHRCQtFV3A7fJIoNUjU9eHi UzrV3i34Hzl1ocW5vWU0lzi8lr+uwCXE9oDNr9+ILQM0m3YTKXG2+B0MkH0RIEtVQlRW lnkSxaYwhwn2qO1MlP8mmy8Mg9p+vUffN/F4KX3a/BGcnRmmDXtRweW15mjk1z6el0pF /Kgw== X-Forwarded-Encrypted: i=1; AJvYcCUNlD/N29/SxNbXfg54VnaPEIZ9UyZ5wCttzZq9OfQYW3R8MncspMHNBTuKgneWt+Vr7C64yGPPVvd8VcQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyJFg+c4Z1U/iRwwRIgtCEijlzmpncuqZ9dsHWIluX/o1hnqm9Y Btcc+mB+9IJltpUHjfMOdeOpfQ/eKR9SwwoFJSC//CCJQ+DmG95kqu3fdtDI4dKQawORbrdHZ1o 5swSV3ysMquWEdLdG+qqcxKg0aFmTY7XNeggdtCeKI7Qhz2TgGlOp1ExBVL+AodaCOCnX1sH39D Y= X-Gm-Gg: AZuq6aJc6vQDLFT9VhON2m1AqAKaqENmyzTXomfluLab4c26fM3/Ohywfm2KqZjRnjW jOxk/trIvHXjuwyqOTEc8ccplVM8WjgS53/fafkW1RgbNUXaKCyMi4geWUZRjvOtRSOd6W78lpn 5HBZNy5rOSHig5dliPEoENRIBJjeIbGWdjbL9iSaCRnEj7yDcZeJ9qH/HRmNMrXs90R2noNRWA4 cyZ6Sv2VmCWcL6dZppZJbyXWj7fGJ4EPbJ3FBf/xjkmB2BQjqVwM8RhBVEuOlKTWP78p5gc7wEl DVFGWkXaNS6AcP6eQa0+Z/XL7bAw2AFcTc+hgGQzC0Kd/QyCkWCATc07LYAbFbT02lwpqnpxL+x bTMNlG25BXtwktkphpt9bKAqM/aoYjpQgO48xKEAvsT1d X-Received: by 2002:a05:6a00:8016:b0:81f:4ea7:91db with SMTP id d2e1a72fcca58-81fa01b95d6mr15826215b3a.26.1768974864888; Tue, 20 Jan 2026 21:54:24 -0800 (PST) X-Received: by 2002:a05:6a00:8016:b0:81f:4ea7:91db with SMTP id d2e1a72fcca58-81fa01b95d6mr15826192b3a.26.1768974864282; Tue, 20 Jan 2026 21:54:24 -0800 (PST) Received: from hu-vjitta-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-81fa1278061sm13831927b3a.44.2026.01.20.21.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jan 2026 21:54:24 -0800 (PST) From: Vijayanand Jitta To: robin.murphy@arm.com, will@kernel.org, joro@8bytes.org, robh@kernel.org, dmitry.baryshkov@oss.qualcomm.com, konrad.dybcio@oss.qualcomm.com, bjorn.andersson@oss.qualcomm.com, bod@kernel.org, conor+dt@kernel.org, krzk+dt@kernel.org, prakash.gupta@oss.qualcomm.com, vikash.garodia@oss.qualcomm.com Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Vijayanand Jitta Subject: [PATCH v6 0/3] of: parsing of multi #{iommu,msi}-cells in maps Date: Wed, 21 Jan 2026 11:23:57 +0530 Message-Id: <20260121055400.937856-1-vijayanand.jitta@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: uGokXXJH6GDifLyGY1k12PFpS7RUXOyG X-Proofpoint-ORIG-GUID: uGokXXJH6GDifLyGY1k12PFpS7RUXOyG X-Authority-Analysis: v=2.4 cv=cdPfb3DM c=1 sm=1 tr=0 ts=69706a12 cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=COk6AnOGAAAA:8 a=EUspDBNiAAAA:8 a=NEAV23lmAAAA:8 a=bPDH9HW4QdDYPu8zaOwA:9 a=IoOABgeZipijB_acs4fv:22 a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTIxMDA0NiBTYWx0ZWRfX6loaw5+74xng W/20Pl1o9L1uEPXN1KIZkDaaAZjr+UqFPag3ueCCNefzq5wdlJf7cuPR2JzO6J0T+qaLvXXXK5x qokAiK0qHwSDei/dA2YhmYGGTkOowbwvw+S4OSDZUM8sTsbVtB3+2MAJFwdZA/6aAF74NaAa8jI VOibzdNaeok0n1/yIVfy/PcGjbwoMT6E5rIWSAfcnq3YV+5jil26YngzZRliqjA8WSyfWAZjEBc Fkd0lagVd2RSSP7B+LODxifud5ykY/rd3vesX4970renj8feOmpXMB+/RqitV1fsWcjrXA/nMOc EeKUYk/XbVX5cvFgxxFHJV/xxi2541XcDwpA2NBfC0XitA+HtWCo31+lOL8eZjYdhhPtp4lv8aN ri3krMd7ObGa+er6oTg6C4kF4kFuP/RUPf8Ljyr9Ptk58n0UeIADG6Z60z1ZoLCYwePoAt9n8VD CJCfhUsIyjDW+UnRqsw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.20,FMLib:17.12.100.49 definitions=2026-01-21_01,2026-01-20_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 bulkscore=0 adultscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 spamscore=0 suspectscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601210046 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. The motivation for this patchset originates from the multi-map use case described in V1, which will be addressed in a subsequent series once the current fixes for iommu-cell handling are concluded. These changes have been tested on QEMU for the arm64 architecture. We plan to perform more extensive testing based on community feedback. [1] https://lore.kernel.org/all/20250627-video_cb-v3-0-51e18c0ffbce@quicinc.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: 1) Added Reviewed-by tag. 2) 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: 1) Added Reviewed-by tag. 2) 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: 1) Incorporated the patches from Robin that does the clean implementation. 2) 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 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 | 5 +- drivers/iommu/of_iommu.c | 12 +- drivers/irqchip/irq-gic-its-msi-parent.c | 2 +- drivers/of/base.c | 146 +++++++++++++++++------ drivers/of/irq.c | 3 +- drivers/pci/controller/dwc/pci-imx6.c | 14 ++- drivers/pci/controller/pcie-apple.c | 5 +- drivers/xen/grant-dma-ops.c | 21 ++-- include/linux/of.h | 44 ++++++- 9 files changed, 179 insertions(+), 73 deletions(-) -- 2.34.1