From patchwork Fri Apr 4 19:01:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 878342 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2088.outbound.protection.outlook.com [40.107.21.88]) (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 A220917A318; Fri, 4 Apr 2025 19:02:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743793330; cv=fail; b=O7KLVhSUen8s6Fb2f/LoqlsIgS9wsPMQqcLHadlKF24kcYpMPNwl2xK/I6nAfZDjkWPqDAEhGsoIDqCI9dLNTwmeLU1EAkj7kqmdrZePinKUbHZxdyR/eVfyDDCSfuLyMovuDrApMrPSQZR4u+IUhBeE7vl8xurPJjQBuEvw/Oc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743793330; c=relaxed/simple; bh=jis4uAlk2Y8+00RUPuARjfibBzjm61NUigLnBik7ARw=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=Ak7m7+eetMX9ve2j3CEAz89mW+D11sanJhNyoxFoqbtagk90Kr3OruH3wwj9gFxg3j84ElEoX1O884VNWLWG21hTxc5YCGdSbWXYONUNgeMWLVWjo4KpVJAqmo2IE3VDivc+zauFJFSSOkbN26LmwhBp4FklbBWgyiE5BHiB6eI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=hfueyeLo; arc=fail smtp.client-ip=40.107.21.88 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="hfueyeLo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=dlSnfbD2Owtbow1LlCa9udVaZ6JdWRUVeDw3nZypsMyz+j7YpBI465CsE0dbtEFk/ZMJ7xkqctoYbhodOWfnvM7RqJbxGbPpbFgVYNoZuRzWZASA0VUVOSEH35OnAMve1ruPusPy5EZOspJ9c2xfSvboOgjbLsvnQQzRNtPs73fxS2njT6VYUWpPEMOJ8pmYJIC/au75xc2WBrG2WvmHsLfvSofw9hs1ew7RHV8Iv8ruYTgw35S/creKazEIGJt4Fq74EwWWrNABxTaASIZQSZEeEIJBb6lwOCQ+IOkTiALaLpuzuYNCgyyrAQotDdY7nbWXhnDCyiPN/stCA9WFQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=mGHcDy0qLXRPv9bDtIJ2M7IEz1TWHDvcXEwtams7Bbg=; b=gqvzD3MR/BycDxMcr6+tA7ORBxU6E+uVeX3fHaMYjp13BWeqUT3A3vFgBFDOY13Z74LO4eFLXRLJc9c4Qzw4zapuc1W/2Z9uQt/jbf58Bo6oZqyrk7TZiq0M2/PZlbppgFPzLPXGowLnPW3GMB8XMdIPXZlE4pow0626BAVC31a3mGykyo2bpnS9czAmxKtdeaVmhxEomHcEmaSR22GDLrbS5otvBVU1dXkitOdr8sJAdtVQgtms7wL284lQlWVN0s4BnnFHGEXGYUBZf82zCzaiYzqIbjWsEaokp67mkGETL1E35HIgOWzyWe+7GpiA52QFIfdT78I64phEeDAyaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mGHcDy0qLXRPv9bDtIJ2M7IEz1TWHDvcXEwtams7Bbg=; b=hfueyeLoZBKmyGTUCQO2kVpdhJxh6JRujb+AG/pf44BhTj0YmLYQdw5yY/jyc80L0/5ee6xsEseOgTmcwNE/atavGOtwC3G8OTMksWq3GLYnfQCmrysUuk/s21OTmwhCGaFsZ6Se43FxYZWgYKSrH7dHwoQTn9kqVyNu4URNTi6bOPgJex6hnyHLWLOt0XNcJAJns1fuvCG5kXIhA6muU7dkhWaxtqNSqupl/57Bjum9g3m+9WGfDaU0+ygtoYvayYDht/Qi8qvzNwZg+QgdKQAC8QLsMI2qhuLVjK16XQzHm2cAAaqxp6ihd9TxeCxIrn8ktvvZIrpLOS4riW7SMg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by VI1PR04MB6957.eurprd04.prod.outlook.com (2603:10a6:803:135::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.49; Fri, 4 Apr 2025 19:02:06 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%2]) with mapi id 15.20.8534.048; Fri, 4 Apr 2025 19:02:05 +0000 From: Frank Li Date: Fri, 04 Apr 2025 15:01:06 -0400 Subject: [PATCH v16 05/15] irqchip/gic-v3-its: Add support for device tree msi-map and msi-mask Message-Id: <20250404-ep-msi-v16-5-d4919d68c0d0@nxp.com> References: <20250404-ep-msi-v16-0-d4919d68c0d0@nxp.com> In-Reply-To: <20250404-ep-msi-v16-0-d4919d68c0d0@nxp.com> To: Kishon Vijay Abraham I , "Rafael J. Wysocki" , Thomas Gleixner , Anup Patel , Kishon Vijay Abraham I , Marc Zyngier , Greg Kroah-Hartman , "Rafael J. Wysocki" , Danilo Krummrich , Manivannan Sadhasivam , =?utf-8?q?Krzysz?= =?utf-8?q?tof_Wilczy=C5=84ski?= , Kishon Vijay Abraham I , Bjorn Helgaas , Arnd Bergmann , Shuah Khan , Richard Zhu , Lucas Stach , Lorenzo Pieralisi , Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Krzysztof Kozlowski , Conor Dooley Cc: Niklas Cassel , dlemoal@kernel.org, jdmason@kudzu.us, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org, linux-kselftest@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1743793288; l=1711; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=jis4uAlk2Y8+00RUPuARjfibBzjm61NUigLnBik7ARw=; b=NIrp1x98RNU/VYfQH3F+6l6UhgVDtBKI+BJrKl2sxCA+z0mTsJy3fupe5ZFv8HWumNiZC8M6D oQZ7Hxe8SBTD+Y7TrRGCbfpPTsgrL+8odIJbbQIia40ydA1YnD2XGJB X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: PH8P222CA0011.NAMP222.PROD.OUTLOOK.COM (2603:10b6:510:2d7::35) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VI1PR04MB6957:EE_ X-MS-Office365-Filtering-Correlation-Id: c51245c6-d72a-4213-f970-08dd73ab3129 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|1800799024|366016|7416014|376014|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?pqEPm7+dQcV0uA5bYxHDYByjzl/bHOP?= =?utf-8?q?r0lOybP05Bgwq66PcsB2dMm1jyEYvHYyQjlQ2C/YuS+SC+DZl7FlQ2Bj7zbRROWOH?= =?utf-8?q?FgIBttAYppguFoFpy7ae1p14nkJDsGHNAByexIesmwA4q+xnbGkBrv6DveU2Tq/nu?= =?utf-8?q?S96Isc/9AxVEoVCE4DgWMjhUL5aoAc9rRv+Iu2TTKWY8TINbdKZFNaojjdzvh7siH?= =?utf-8?q?RECwNeLdCRFRDWeunQyqHnmeGLEy3qHmmmXgSKOd67CdsHc0bpvAojLqEtb2PyL8H?= =?utf-8?q?3+EIM09oLgZ7u8ZcBY6oqNPIXYirDJy2SdJEqBOEPT9DyF6IaN6A4I0Oi0d3tGxta?= =?utf-8?q?1sPfzFLi8odkNhzi7C14+0aVwog8fkhaAt8qgj9cacieOQqlQ6/ndIE2UhYni3fPs?= =?utf-8?q?DJXMhDoEb0W/cxOEgn06s0Be1XSwRvGrEUmkD5spDb97Il7umbu9SLx2ii4KxyCHQ?= =?utf-8?q?T4FrE5X9nZWcCjk9buW51M3tvJ3IiwSHNIkKaSBWFWBIEu/24F7ZOwDr0npz5yUm9?= =?utf-8?q?2nFVnwhWmMGWKdn3I/P5hPgK9Q16rCnBvwLNxzUO00wMe13vjKienrmI/a8ac62kn?= =?utf-8?q?KId3FOK92K+gVJ8okXQZDlNMbLQOLQfknRyUUR7f2VmVKpXzdUra8Ufub/Lg7KM8C?= =?utf-8?q?c/Zck1KyhQhoOUFK91JCHcC0uiCtlqA2ckTNUOMnkpLtFeY+yqcl+PLdSsGS57ami?= =?utf-8?q?p5HqdIairbqqyrn97IQED75IJu3JqhZKXDWZKI5HgegtM/JKOMNBuAjDSg4EHu/ND?= =?utf-8?q?dY5zyeSP3bkSlevDhjhrIigbu09U4AEmLKMeBhgeVsZ47hry7ymxqt4vabBxKxCq7?= =?utf-8?q?V0PkMvJhdPzKEI+mmbACwHU8xWrpFiucWulOmyH/63fbN+1VjDnii/MZhw5+6DGWa?= =?utf-8?q?ucCB6OZHxyy2Ypx+sIBtZfci4B/vgZEkici7/TzWilVpYsqYx7igX9a6CRedNdnHd?= =?utf-8?q?i0an5o5BNP3ZdcCPhyI6e92UI/Uit7lN1WTFoR/HSi1AQi5UYAwM8IDq+JwMR44Kq?= =?utf-8?q?u3WAUQOZnH2jT/2ykZsX2+3Ygmp+8x6Wr30SPXCOq9tT1CtmXLoxPHde3hruihZ0B?= =?utf-8?q?I/fdhHXT59P7zF3ALijlci9IH8WuRz6KaZtP3TzoTfPMGufO0njxnvMmHdXSnluJS?= =?utf-8?q?lNg7oh0c5RpuELQcZvoLViZboISMpr3jmRi43ubyTed8DS3seVXy0tsexl8LJOGNm?= =?utf-8?q?kFbOKYfPzYoCk+qM1GlO5t+LLyIiR/G6eanEtUOz8N7Za2w+9o2w5+1L9DQli9/uO?= =?utf-8?q?6whdusUiT6IQ6AWZbcGpR/SRB3NspmZUZmdftxgeNhTBva859f/vesBZsEtwwFIlV?= =?utf-8?q?QhihSg3U1lUurcGEeEyW6hcGAsrpcTJWUhbv3Ii010FtEi1cc7un//gIBJlWMDPMv?= =?utf-8?q?LZ1M0XerJ3QdZxGg7+4E4kll60qTlhkzg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB9642.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(52116014)(1800799024)(366016)(7416014)(376014)(921020)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?9CAbQ6uaPpfcvK8JzZ7Cl8QgxuDm?= =?utf-8?q?aYIp8Av6pk/QsjVeiNiXhxngmRO1fqvKV5aC+DdCbrKTNxDqGaa06GjwR+mMn5k6O?= =?utf-8?q?zoTnPbh8QOPQl1lDsQDiFmo6vF38nP6M61wPbPaF/cjN3fcUaBZOEplzwqBuKzNzq?= =?utf-8?q?iY8jYbFEL+5jLzHc1FJ8R5SsAcSx1NZ600rK20bJuVSUuKvR/r1lz8P5JSi1c1fLb?= =?utf-8?q?CHsTR+MuarReeQLhjVsF3q45rzFjwP0T302BHRw/NOuivpukLLUmc81qjRDT/Rfgw?= =?utf-8?q?5BVJ8WFsUNJzKhYsZvBgDmsZWs8BZ51l7CqmRZpYedZD4t4e0Xk8nkxVCZnE6tbm6?= =?utf-8?q?1WRGLXjL/8rJgyTaJeNBxJ2r/usJifMXjYHiiF5gipGfs79TPlu5KGsz3hN7qseH1?= =?utf-8?q?htrhkRCSu4fBKDvTMAYnFIUeK1B224rqjsbazT3W3BO7DDlt0uioR41aVK6ZaJvIc?= =?utf-8?q?acn7S1JxwhGjGOtnoGcnOW2IK9kbgfoLoWjpDc8VJHLGcpoicWyNqh6dNlG+nITIX?= =?utf-8?q?uhH5fLS7Hsb4z5rv49UlRIh/pEre2L8zQ58UJ1o8u8ZDMadg4/bLKDv1iAnujE0ba?= =?utf-8?q?aeSJq9mDRvUnqaAUR9q0j0/cMTQ8+gRcABte70zobvrlex/cVwsABmzqn7Dsglg8P?= =?utf-8?q?usAHw52J+takekfsmIK7izenl099LWc5iPVeoj3zDWDtM9qi2rQoOm+qUAyid6tIY?= =?utf-8?q?WTekhsGNKoPVS/Q3c3hYp/D/pA7XtDu29GSo3r6OXMWZpe0MZVuQiYLnH8rK7r8Ym?= =?utf-8?q?VQzmGpnXRnfh9UwOxDCqjD0UA5UF7b5HR/OtlBcfcmoYVXa32I4JBEcToMIN3NiPS?= =?utf-8?q?QFd/bKEODdBhdrnzxJ2zkLBH6rolioIiVDbDQfyQQ/sfH8VDtI4bp1rL2TPQRKvFK?= =?utf-8?q?BmIxON/ecADXRwViKSZDWGNrvWbLPEBNOKLlLAmkKLIK9BXeQIhzKPtZYEQUxRBqI?= =?utf-8?q?8wUJyOBbOqMJGqWJGXIsTEpIj5sVswy6zlxPDWejKmsgJF3E6Pt3aCT8jOKVdwGp2?= =?utf-8?q?xQi/QjdQzgKHm10l2TV0D91/9++KsT0Vyl4JfxZq+5dlYPAjxnrhpEDg84LIXDV96?= =?utf-8?q?pxvgQbz/sCnIKq4gcCysJAzki+tzH/VBQl6TWuBzE2ozvBvcbFaiVUvw//59sxTY1?= =?utf-8?q?WozJOck3nMa8Lg9Emm3y8BXebNa2cMABtiim+RiXUXQ8TioNrdU0Rh1XlrtXE2fnP?= =?utf-8?q?670HExmymfXQdhsWTfsV/XA8AeYQCAownTXUCY7C+a04kYT6+xTsmrimmzP0GLuxJ?= =?utf-8?q?qbTI8QAy7ZJ3EMnSHlblPO+6teKb5R5Y1OmarTJVSFeEq0F9REzMe66FVGBNrvvBY?= =?utf-8?q?2elDWQEk7QRX8DExA7Bicpq05LjbvgkKcx9nVZU0hT8kTHtDmlDiw9J/Ft/5Bn2z+?= =?utf-8?q?bXygRkLc/UA1Q+I/j7c56R//58DiebYRTEk2w8b7SO9h0VilaIKPD0AUSCRzvA2Du?= =?utf-8?q?ICTFrQ4RuyKUW6+n6SmeCn9kQrD6x9eiWgJdT6muGfSikrbHbGqSk7WI=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c51245c6-d72a-4213-f970-08dd73ab3129 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Apr 2025 19:02:05.8855 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fuSFpjWfPJ4M+10/5xEwYolW4AQFZ+cZ26aEl9kiiMgtSjSwenTcxvEofEj6g6pEOGUmHzFjg9t0+MJH4MGxnw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6957 Some platform devices create child devices dynamically and require the parent device's msi-map to map device IDs to actual sideband information. A typical use case is using ITS as a PCIe Endpoint Controller(EPC)'s doorbell function, where PCI hosts send TLP memory writes to the EP controller. The EP controller converts these writes to AXI transactions and appends platform-specific sideband information. EPC's DTS will provide such information by msi-map and msi-mask. A simplified dts as pcie-ep@10000000 { ... msi-map = <0 &its 0xc 8>; ^^^ 0xc is implement defined sideband information, which append to AXI write transaction. ^ 0 is function index. msi-mask = <0x7> } Check msi-map if msi-parent missed to keep compatility with existed system. Signed-off-by: Frank Li --- change from v15 to v16 - remove ascii figures in commit message change from v14 to v15 - none change from v13 to v14 new patch --- drivers/irqchip/irq-gic-v3-its-msi-parent.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/irqchip/irq-gic-v3-its-msi-parent.c b/drivers/irqchip/irq-gic-v3-its-msi-parent.c index bdb04c8081480..68f9ba4085ce5 100644 --- a/drivers/irqchip/irq-gic-v3-its-msi-parent.c +++ b/drivers/irqchip/irq-gic-v3-its-msi-parent.c @@ -118,6 +118,14 @@ static int of_pmsi_get_dev_id(struct irq_domain *domain, struct device *dev, index++; } while (!ret); + if (ret) { + struct device_node *np = NULL; + + ret = of_map_id(dev->of_node, dev->id, "msi-map", "msi-map-mask", &np, dev_id); + if (np) + of_node_put(np); + } + return ret; }