From mboxrd@z Thu Jan 1 00:00:00 1970 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 5238634A797 for ; Tue, 10 Feb 2026 10:12:27 +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=1770718349; cv=none; b=BMGP2MU2SG7zpzjRY7J/X5Av+C0+v3n+AMzbL0s3rnwCGRQGcjESEKyBKdhzf9XK9/bY8DwBklhuKGiHCYSHL3rzC2wHOAUU/HcWQdBeiLhHrPpjT7ndS3m2HNxKLh/O9EGfxJyNdwRUvnejxwdCvjO5NKkHzY00fmvRxgHvSpg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770718349; c=relaxed/simple; bh=n9MmhsmrBg06BwA9AXyf4JpudzLUwtCHossabGgbLMc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=FYun7ABJfGKMYWVNttLpfjZCS/1J3y2A1DPer3AO6CYZNXp0LBRN0Tb5ejSQ5NmE3dMGuu49gvSDFcFBSwBZZNNknc0Y3zYo4gTf5dTI7LYzi8d1PMCYyzgSzNivfM88eMe23/j7UY282DpSlpfS7rxdNSVFtPS3MltG7gV8zGQ= 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=Sq7PEECP; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=HHQ0DL1K; 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="Sq7PEECP"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="HHQ0DL1K" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61A7Z1gf2169132 for ; Tue, 10 Feb 2026 10:12: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=3RJbkaXw9v1cGG0O6WIj+UDLPbuhKlUrIHP wBJQe9Vw=; b=Sq7PEECPH4B7zT49pxF1eT6alhcgovIMyJw7VB0hGXn4X3JzMbg /WbqLxe3FgATOqFDo27DmSHaCgZ3C0XcIe9RaULHZIlQjIxPF3Ainc6evYUrqZMJ fkbxjdtEkmXXawnQ3MckMQK26/aNoKtYFshD9FQMkYKNdoMjW5MBOEXPUz9Byy1+ 9DySGwUHb9Wpqtz/2Rl36ehY8J/BYbu4ERMweaBTTU/v+LAUui1UK8mR3vioMAwX df00hViWp18Aj5KtxrsHht+yfYb1XaJ5ypZkmzEgf6gk/Yf52/0aYKHpGS96ZJEW 7N+HD5zqeH7nlz/ePyLRJCRAyDcNanwGtnQ== 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 4c80drrhkj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 10 Feb 2026 10:12:26 +0000 (GMT) Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-8216fece04cso6229386b3a.0 for ; Tue, 10 Feb 2026 02:12:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770718346; x=1771323146; 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=3RJbkaXw9v1cGG0O6WIj+UDLPbuhKlUrIHPwBJQe9Vw=; b=HHQ0DL1KSwdfOhheOLY8UMbG13O+wJv1rjL/YYgoJjVUnbHtDR2NTLbMQuHpbo/tXt QYgTW74lj7nvP0XYaK/S11cqxp+iiQEC6JvV12V1+648lBrPbTm+XmjuRqJumR4oL67W qRFy+HzMaRAdoBgWkHfB34mp/25Hj9G40T80N1xBrIp5w3VFiKNuKCVtbNCtVWzBnxbc bIVNZw6yraJVohz9xFf3BTYoI7ZcfTACQxtyz91BUxTXRZUAwYZBCGuU2OvMUTfT1Bcr LBZoulS1RWU/wqq+0+grFNgmjGiSQCTSb3jPYxlYoWOzv/SM4K71Ui5GOV4DEJdDTm/Z VX3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770718346; x=1771323146; 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=3RJbkaXw9v1cGG0O6WIj+UDLPbuhKlUrIHPwBJQe9Vw=; b=fUQ17cEPMh93i5GI9rARyKawwla6IdyjANHs2mABHOq7YjA600PW+lzeDyAllSbws7 Dk0/Qi4fXbTVP8KEKY8LCRn7nhFej2IFQnLc0ZA1B4owjLYHT3OnUmRI6GARpZWCtv4n oJVPQ9eyMqtXTbJHqqDUW9wMu5tlF1+9T/Rf55IYYJ2WmGlCdiV16SEPhaE6G8jn7z8/ 6VDSIvr4VLb1CePP2Vzke2+z/sGkJyZFLq5egAoBHBVivrb7kI0kOxC9aGLiKVy56UpJ s8c0PJ70kW6HSHryBcec0FAodIrB34jQlyPMNqz8s3wfjw3EathDdU0L7GEuKGRtmpYm vrFA== X-Forwarded-Encrypted: i=1; AJvYcCWdxv17vKHSWhga9Ad4nISXjWQf+fHnJf5FjmVkkGvShGikjva59PfwTu+iRpOgNaZ8KhREBfkEY0i4C0w=@vger.kernel.org X-Gm-Message-State: AOJu0YxDOoup4n36OEXmIadr19Uy8EPtZBzKxJY0Hkc6N98O0J0eyNP2 XUtmgAcuRVCf+42Wvwtx6qLG5hHwyE/Nxuvf6ffxQ5zheUk/DhrRDpcbwX0aMUCkdUALEyDYND6 J5caLIcGc5m85bjvIHTE81ntY8xcpuMai1Gcgv0cMfboJqO9/zaEoWrMbJQodhq50l9M= X-Gm-Gg: AZuq6aIvv8RwmQSqvn+tMzX6YNcBmJIlA9sc0KcqpBtWAeiy8BtHFkzpke2XT7jkTu0 vJma8ABXNbkBkrRTfYzCxuwBfkL6w1RWtsTx9heYytKpMOF3k8XpsgSTVZn+z/kUnH6WNy8J/u5 HppXvF2u2p3q2fzy+hlj84MA57czOqpWczJcLMFwmk8wvxAjxXju95NXl8KfN0yq4ISz9qW8F+6 IIk5zn/GFV/REo6eE+jr9aIPzZQpne5HXJ9fNrCV3i38vflHxGgB6+k3BOkbyUGXJiT+hiYhvCW 8Vos5hHb1MZap6IzTyfpjciW9xourr9I7q63BJ3zK04eYfG7MwaEGWwJzOd0YCf6Lnef8qM1IRD jFkYRQecdLX0LV3GL1wXl/Wy2rI0wkJA1+pSkiFU9bLyZSwObpzH0WlNU X-Received: by 2002:a05:6a00:f93:b0:823:5729:a125 with SMTP id d2e1a72fcca58-824877f7ed0mr1584362b3a.30.1770718345728; Tue, 10 Feb 2026 02:12:25 -0800 (PST) X-Received: by 2002:a05:6a00:f93:b0:823:5729:a125 with SMTP id d2e1a72fcca58-824877f7ed0mr1584341b3a.30.1770718345233; Tue, 10 Feb 2026 02:12:25 -0800 (PST) Received: from hu-vjitta-hyd.qualcomm.com ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82441884b75sm14380940b3a.39.2026.02.10.02.12.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Feb 2026 02:12: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 v7 0/3] of: parsing of multi #{iommu,msi}-cells in maps Date: Tue, 10 Feb 2026 15:41:54 +0530 Message-Id: <20260210101157.2145113-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-Spam-Details-Enc: AW1haW4tMjYwMjEwMDA4NCBTYWx0ZWRfXzXfwvMrjeEZw fRI4aaZnxtPIkm7H4l8QCgiOmEhqFk1nacFHYI/z3MCQi3C5ZbP2MJCRaxKNjo9lLt3Bi05USV1 KhF1jQa6aHQ0fC1o/mQ9zfBJJm8EQqhheuu2ez3ZrE91ClWm1pa5ZobXVv7oKVAVUGK7QgEavL7 YKFOd4XAMx6GVALrqf9AfuqLoHrBbmhvqGcsdiVVJQw18PHsvDnhesS0lFydFFBvpQevFhIoXkB yJQaXK4zPMqDFT0JNhvnNfD0j3hrwmaOCDkSboC2aXlVwa3OTuL9r9fuZCkLyck7cg/CmAZa1zp 2+S0C21ohKah4W2E3E9jahECMf0Aa0CM0X87zscqepmOzMVmoQRrOBtN5HOoIKB6NI2vo6R5vus ZudezuRf59iTHVFsNSUV8N0MNCE273KEAX9F2s0XmBgD4QfXCRfhVqRBg6Zn0O28BgD1YOPjMZH afyYUXPogWVWrofi5wA== X-Authority-Analysis: v=2.4 cv=fd+gCkQF c=1 sm=1 tr=0 ts=698b048a cx=c_pps a=m5Vt/hrsBiPMCU0y4gIsQw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe: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-ORIG-GUID: ghQdUQg1z0mMN6QY0cYFJdLYmWYT0qUt X-Proofpoint-GUID: ghQdUQg1z0mMN6QY0cYFJdLYmWYT0qUt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-09_01,2026-02-09_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602100084 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/ 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: 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 | 3 +- drivers/iommu/of_iommu.c | 6 +- drivers/irqchip/irq-gic-its-msi-parent.c | 2 +- drivers/of/base.c | 148 +++++++++++++++++------ drivers/of/irq.c | 3 +- drivers/pci/controller/dwc/pci-imx6.c | 12 +- drivers/pci/controller/pcie-apple.c | 5 +- drivers/xen/grant-dma-ops.c | 3 +- include/linux/of.h | 33 ++++- 9 files changed, 152 insertions(+), 63 deletions(-) -- 2.34.1