From patchwork Wed Dec 4 23:25:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13894445 Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2076.outbound.protection.outlook.com [40.107.241.76]) (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 3FF29207DF3 for ; Wed, 4 Dec 2024 23:26:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733354781; cv=fail; b=R15u8jOoGlNqYuUMrNbCx086imGVzxgFbs6y1W+1Zhb6KnKs4cPBtDBGr+LvKQFpypTluIogBpp2PAka+mNKpAmQItCCL5wr1fc2f0/RqfYW/6JO+dQGuk27G9dbeTluR26NAlTZ25kWHHpodG8eD+7nRJ4UyuQtzMjY1mHJr+4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733354781; c=relaxed/simple; bh=ndCsNl7CzN6Fgn0Kp89Q1LtC1gKv1xdWwtoLPsqn874=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=EUxsUXcH3+wfPD+aCXDwmD3IveynCMfxVlxxNJYMaDt10dkH8mYAh+P8Eoa+jILcfPkNYJcKaY0r9ukyD6stnpikEtwOcXAddA4ACPLVKR9S9gKIys40QUp6PuVRbeBDiVEfrD6yBVMi/0qQDrsR0nEVS++VDJY4nSnRAriRCp8= 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=YtKU66a5; arc=fail smtp.client-ip=40.107.241.76 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="YtKU66a5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ri/3bUT8PAjDEBOg16+ZSnbyo91nwBiA58G8LUlW66N/33v5JU7jPpoebDND+VH2KfBJahEF1WVYEer5WVOEohscdSb9nbpnKPw053Yjrtco62VE75ikkK+Wyyz+puydVKqxIGP951iXGW9YopHrV9ZEeQzXmUQYYTt0ZnPEtYZAizeD0eNODezdlxP7337LWpmNHp9szBEltg3S90WwVJeXDOFCQVxEFFQKdZ4cmD/Pijme9aNKnVruSZd9svwHFdIssq7aHeqf/jX5YkM24yJpDdYGo+6qyDqqUbnTf32SAFQ5XTjpcYhndTk4g0Tbjy1TsV7BuAg1nMwOFuD+Ng== 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=Au0gmyzBByXMX9kk9x9rwBQKfT1Y9pshosRUmRms4M0=; b=dDtgM0MGUz7VgRMOGC/xW0u6i4uMA3m5jzLU9nALRxoTMWRfT41fiv+N3VnopmiQx5amkSvXc50b+v9div6HDIf7F5kwBfthZn7RFjr2H5t35hmPIoaSFLXLCykQJ7oZq9TqRmd0RJAOUOffZGbwMAEvqhu7asltaB4hxLkz4EnM5XBMudD84ew350PrBgGGFZAPwCWDLXoaqmRVfPmxCUPubKJrdW6MDhc/ZHyNxvKYnEtErX1EHlD7I1iMFYj5VRbMd3MIGulV82Qv0+/kNLxAe/Cp+scXXYyk7TcpqZEAWJAL5rvBHqmncPXmBx45omi9TW1OlFncZx4WwOhAtA== 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=Au0gmyzBByXMX9kk9x9rwBQKfT1Y9pshosRUmRms4M0=; b=YtKU66a5GS0a1qw7qb+5T9q8ljR/jz7h3sqRb65BxB/TEaG7FcRsJQ1Eiv9bf7VivJGMKonEfWcmNuyUphPk/Oah87UOCvnodADpF5+qxzqySGY0FtEc00KnPwE5WCGFifG941VcmCC3U6dNMEGbdUwbFa+UIOAumZ7u7eEhaWnkTgpbl5D5vrYYCsK/FdMPZRKHPBRA9fYdjhD0RKmJER/kHlNmuUwRGiZcG3buZQ2nUdxH6rRprlSpo9U90yHNtN2EVFI+CM5spTZJtm7iL0vWXQMc99J5N1s75nu3H4neUdN3jYCeID9YhBI+Y0Qft7wXT+21UjS+OKvDbrDGIQ== 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 DU4PR04MB11006.eurprd04.prod.outlook.com (2603:10a6:10:58a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.11; Wed, 4 Dec 2024 23:26:14 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%5]) with mapi id 15.20.8230.010; Wed, 4 Dec 2024 23:26:14 +0000 From: Frank Li Subject: [PATCH v10 0/7] PCI: EP: Add RC-to-EP doorbell with platform MSI controller Date: Wed, 04 Dec 2024 18:25:50 -0500 Message-Id: <20241204-ep-msi-v10-0-87c378dbcd6d@nxp.com> X-B4-Tracking: v=1; b=H4sIAP7kUGcC/13PS27DIBCA4atErEvF8Car3qPKAhhoWMS27MpKF fnuwZGC7S5nxPdreJApjSVN5Hx6kDHNZSp9VwdgHycSr777SbRgXRDOuAQGjKaB3qZCbZDRByE ChETq42FMudxfpe9Lna9l+u3Hv1d4Fuv2nVDvxCwoozFhtM6DjuC/uvvwGfsbWQOz3CEBDcmKD Bj0HJ0L3B6R2hAw25CqyIN0CiJDxswR6R0C3pCuSKrsDOdJRP7vPLNHsiFTEUofjfc5II9HZPd IN2Qr0hmytjkjhHBEbkOciYbc+ifNMESRQSFuaFmWJ7ORz5XZAQAA To: Manivannan Sadhasivam , =?utf-8?q?Krzy?= =?utf-8?q?sztof_Wilczy=C5=84ski?= , Kishon Vijay Abraham I , Bjorn Helgaas , Arnd Bergmann , Greg Kroah-Hartman , "Rafael J. Wysocki" , Thomas Gleixner , Anup Patel , Marc Zyngier Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, imx@lists.linux.dev, Niklas Cassel , dlemoal@kernel.org, jdmason@kudzu.us, linux-arm-kernel@lists.infradead.org, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1733354769; l=8442; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=ndCsNl7CzN6Fgn0Kp89Q1LtC1gKv1xdWwtoLPsqn874=; b=ILm4DKj5EZzMS+iAluuDbx4E4V+D6/l9gx92p+0d8AMpI66uZjgjwWMoIqN+6TI0mXU7m2A4c d3dl8btJIsnDsP2DMiqTK/mkp0Zi3UHq+b7Jt1ekpCvFj9d9H2uDrNZ X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0031.namprd05.prod.outlook.com (2603:10b6:a03:33f::6) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DU4PR04MB11006:EE_ X-MS-Office365-Filtering-Correlation-Id: 5cf8f125-e4c2-4b1b-9c03-08dd14bb0b84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|7416014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?NafJgLTPh7dlJbX4COfIDOwRmtLuLPv?= =?utf-8?q?Yap6nlesm7jjn71NCzeeFmiGKYvuXtgAHZGixpkiY2rvXOX6YQcySzmJQ4TFo4Dxh?= =?utf-8?q?7jVHuNCNnIQUzReVXATDArCrCQi072ecNChxgrKm0rau7fBRP8tZ2CD/wZ5H0+X2M?= =?utf-8?q?6OCL8WwzqlK4kV6EqwQnoWi5ovWUbGtA3OsKs5jcEzAIxJTW6GliaWIDX1MErdL21?= =?utf-8?q?g9A0yutRdSY07LXg3NJeahiJWAaTxSnQATsZxDJ62xYCBzLGsqEIoHROgkIfQT3kV?= =?utf-8?q?NcQQXH8FHUoGpZQ5DTiOi6b6a5QhKN8A1C7uvstbOCSwo+8/2YeJxvOcABbNMd2VH?= =?utf-8?q?FtLv3uL9BraL9jGVzAR9RA1uHwjiSb3qE+OHrsn2toWfLh6gNYIM/WGnzkjuWjajz?= =?utf-8?q?mGB5phYFKAPoD/VM26n7dQyIsZC2L7clgR5EFaxBvXYvohJWHbb5OvDgeJCJBNkyw?= =?utf-8?q?R+KdXWwSnyxO524m4U5d3M7bHnIT4Q9QL4ph4NZpfMz4aDhZlch7oCcy1LtRdgKoZ?= =?utf-8?q?ZGZUr99jbMAiesvJFDaf7s+bF5RxnTt2grQcaBNznyfo9s1NL8oL9LDvAeGX47Pw3?= =?utf-8?q?G3GKgCJp6vTmadTz3apoobLNei/0ihkUbiATtRM9v5GS62JKDQpY8t1+dNvQ+3Q6y?= =?utf-8?q?vL2uFRZKWSK4IEJepnA3gj94z5Z+9ncd3YXWhzLFej0BdUI7CH0oORTXW3nfjn+r5?= =?utf-8?q?sboMSoc/wp2Ikk1VBWiqOOjzLXUMX6812fjIhilegaUMVOPKE34q+PNgI6/pWVMKB?= =?utf-8?q?WA7afhfAHa2TAhZa/VnWzF0Q9wAw9X7PuI2DHD0+MdazswZjw4upGX24dxtNWv5vE?= =?utf-8?q?DMzwplH6QStOnBjIXYP8HEJx2adTWuEMx8wzvyXAGp833VfH4WugTXVNPN8mzG00X?= =?utf-8?q?k1Bf9vrGb3hC21DfGIz0+CTQyfyJXwxoMXyspniVbBJSWc0p6XzYay8tz/dSXPZ0S?= =?utf-8?q?ip81f5vXksBD14Cdaay2OPyPDDGV+q3UGu+srapRPi8ZGVGqlhkWgb3Czs1P3s/ey?= =?utf-8?q?ANi9uHnUmsdZlYyUFqjAZ5Bv+WmsdXQli7ldIFmtzepwCvpdYkqcNOWezVmI8D/pt?= =?utf-8?q?5YBJFdJBx0HniLx+Tc6iFw9NPYdp7Ws9DlKL3fnPKUhE8lanlPBZ0z31b7+4u3IHO?= =?utf-8?q?7ze0LT+Uumfq5H68MDcPtM4qhM1k5pxS2BuKm6Ft97JhJ0lsSOJ3/M4wvWyrSzHq/?= =?utf-8?q?0Q1Dn1ES5B7AVOg36BC21GQ40Da8EOh7phYjyWu301vIbKNy01FOxjN/n5FVG2afb?= =?utf-8?q?RwMFNlD1LGmIGRs1ZD9d3WxluCgzOtoyJi2uaWoQ1yfbOncA8BpZT4KuVDueLeeDK?= =?utf-8?q?Klxuu+ng9G6Aw+qpjK1RRw6TcO/8+18/sDnpVHRzdxQWnnbGHibhkkM=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)(366016)(52116014)(376014)(7416014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?VTqAZ7kwwkbmm98t1I8A07+qcr9f?= =?utf-8?q?a8RiTODBHXGKeP0ybHKC/jqEYL5Yr90NE0apTJmn1IDR3mie1+lY/qDu3EtQl14Hc?= =?utf-8?q?QyVNfQM+bNwZGntlaAUfKqcCCpErTzPsc77kGA/6MnVKNRrAjb7oUHynjq/CdS5zm?= =?utf-8?q?oIB5l9McnZUjnC3hXOug1QXCZU/Yx4LMJqVnbsI4VxbNiHon72nF8J3Lconk4tAqj?= =?utf-8?q?pEiYHTF9OqsAVp62W0SyKwMA1WwrZUF2UZApT4ZYeunNHVEGkqXQlUrrlSIZ/oOnn?= =?utf-8?q?2hfYSf68j0agOwMSbYmCEPEbnbJjk2JDPcjFh1hr9BkJmaMUlLlSNiBRo7Isi5HRd?= =?utf-8?q?ddeHnSE8E4Cl80yP/IARAIs3vSCvjPLMLmoKHdllRCl3GxlE77XFGq+GdUyoTIV+c?= =?utf-8?q?oETnlp8BxRQVnGNj2qrtNfFZBILYvuys1XxgAFa7N0VQOog7UCyQEZCp8GA3EkRcm?= =?utf-8?q?3X43hlHp1nHcZzD/WtyIJUJSZdXWhADBjphPhKXubcYNExfBuqW6u1dJrPh+6Yb3Z?= =?utf-8?q?cNCYy2uTMXrpT+zfck7RbgYfcvCJ+nW6w0b7aFNlz3VE3KKoIb6QpRr1BClmmQEA5?= =?utf-8?q?oKsKZBKnQTtsG+RWAV4/FrcqDUlO2f3tHD3XDt5CM0zUG/eDG9sbx8wUA1qhTPMnk?= =?utf-8?q?LKSvg00iT+Yr+//T/sKTDGgzjMgtkwNIZkFUbj0zt+wbFVVuuCI+B7w1fWXik9BCM?= =?utf-8?q?ZalsIhAsdA67WfD6/7LW3RWLU0hPcIvKY3lZp8RZqpDghwCDHnrnWYCmaP0O6P87h?= =?utf-8?q?PN5aCZ9MFqyms6/ZLd037o1DSKBXz+7BDXBF8nN1MUCMuXa9LrI9aDCPX3vvUFOqU?= =?utf-8?q?osAKGwnL+h3q85PpCq/nYdb2sPdd8hxym0PiN8uaDEbNiPOVcfGRr1pevpyITBAhN?= =?utf-8?q?EgF7zj7a8R7/R0wlvIaILpL12wIqY9fdv/v7JsKcbAYkYavxm6eC5EDMecSTpO+mK?= =?utf-8?q?pFbKDTKd2CP8ovhHrsK+0h7Q/KwcIzYrK2E8LLDlg40pztFHo1kr9K9oSKe+cQ1z0?= =?utf-8?q?8XqfHt/dhRV2idFm1C8vrFgLVd1DmxhOB334Pzc294f0kXqHJLGwmkgq5BArVArOH?= =?utf-8?q?PbmKfV/V6A2iG3v4SP0niL9WcDMk9i4B7ioQQr9S53KaO9tqtF3b99HPqT5BHte3o?= =?utf-8?q?ecsTJlkw4s47UGk+dS65dOItCqSSowNwSMpNj4UVGzYlz5Yeb+utburWF2nG6RCyJ?= =?utf-8?q?bYWYXqSF4RcRvBe/ubbgOeuKRv9n4Yei4/+92NisfqjdWxtaoO8INGmrBjksfksFg?= =?utf-8?q?y30p6o+7N/7C4HwRFVPryCS5bNYTLmcE+baa6J5HmPEcEtum9ZiRXkD9K4Wx2xx4N?= =?utf-8?q?BVQm56xaIdnBvr8EVJuqQkP0lJ6cjphGSYrjXvE45VbSt5m9Z7ij36zOMdtJ0G2Uk?= =?utf-8?q?dtQG85zFTUPPYF+0tL8UlxrgRvvX3O+pcOL4sKZgn0DzepSsrUaVy+c17qSSacts3?= =?utf-8?q?kIkOUlRwcQ+dABmG5BIsaHrgriWyKYcNKknbWsWNx9G1i30f7/VnGZnA=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5cf8f125-e4c2-4b1b-9c03-08dd14bb0b84 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Dec 2024 23:26:14.2225 (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: yvP0pJ5m6qqEJO0FpGucl2ZlNIfQQ9uesSmw8tTAaaqnTMjLAfRm7YZU7a+bjMZjL/5IRCczo51iX2ckDk5IuA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU4PR04MB11006 ┌────────────┐ ┌───────────────────────────────────┐ ┌────────────────┐ │ │ │ │ │ │ │ │ │ PCI Endpoint │ │ PCI Host │ │ │ │ │ │ │ │ │◄──┤ 1.platform_msi_domain_alloc_irqs()│ │ │ │ │ │ │ │ │ │ MSI ├──►│ 2.write_msi_msg() ├──►├─BAR │ │ Controller │ │ update doorbell register address│ │ │ │ │ │ for BAR │ │ │ │ │ │ │ │ 3. Write BAR│ │ │◄──┼───────────────────────────────────┼───┤ │ │ │ │ │ │ │ │ ├──►│ 4.Irq Handle │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └────────────┘ └───────────────────────────────────┘ └────────────────┘ This patches based on old https://lore.kernel.org/imx/20221124055036.1630573-1-Frank.Li@nxp.com/ Original patch only target to vntb driver. But actually it is common method. This patches add new API to pci-epf-core, so any EP driver can use it. Previous v2 discussion here. https://lore.kernel.org/imx/20230911220920.1817033-1-Frank.Li@nxp.com/ Changes in v10: Thomas Gleixner: There are big change in pci-ep-msi.c. I am sure if go on the corrent path. The key improvement is remove only 1 function devices's limitation. I use new patch for imutable check, which relative additional feature compared to base enablement patch. - Remove patch Add msi_remove_device_irq_domain() in platform_device_msi_free_irqs_all() - Add new patch irqchip/gic-v3-its: Avoid overwriting msi_prepare callback if provided by msi_domain_info - Remove only support 1 endpoint function limiation. - Create one MSI domain for each endpoint function devices. - Use "msi-map" in pci ep controler node, instead of of msi-parent. first argument is (func_no << 8 | vfunc_no) - Link to v9: https://lore.kernel.org/r/20241203-ep-msi-v9-0-a60dbc3f15dd@nxp.com Changes in v9 - Add patch platform-msi: Add msi_remove_device_irq_domain() in platform_device_msi_free_irqs_all() - Remove patch PCI: endpoint: Add pci_epc_get_fn() API for customizable filtering - Remove API pci_epf_align_inbound_addr_lo_hi - Move doorbell_alloc in to doorbell_enable function. - Link to v8: https://lore.kernel.org/r/20241116-ep-msi-v8-0-6f1f68ffd1bb@nxp.com Changes in v8: - update helper function name to pci_epf_align_inbound_addr() - Link to v7: https://lore.kernel.org/r/20241114-ep-msi-v7-0-d4ac7aafbd2c@nxp.com Changes in v7: - Add helper function pci_epf_align_addr(); - Link to v6: https://lore.kernel.org/r/20241112-ep-msi-v6-0-45f9722e3c2a@nxp.com Changes in v6: - change doorbell_addr to doorbell_offset - use round_down() - add Niklas's test by tag - rebase to pci/endpoint - Link to v5: https://lore.kernel.org/r/20241108-ep-msi-v5-0-a14951c0d007@nxp.com Changes in v5: - Move request_irq to epf test function driver for more flexiable user case - Add fixed size bar handler - Some minor improvememtn to see each patches's changelog. - Link to v4: https://lore.kernel.org/r/20241031-ep-msi-v4-0-717da2d99b28@nxp.com Changes in v4: - Remove patch genirq/msi: Add cleanup guard define for msi_lock_descs()/msi_unlock_descs() - Use new method to avoid compatible problem. Add new command DOORBELL_ENABLE and DOORBELL_DISABLE. pcitest -B send DOORBELL_ENABLE first, EP test function driver try to remap one of BAR_N (except test register bar) to ITS MSI MMIO space. Old driver don't support new command, so failure return, not side effect. After test, DOORBELL_DISABLE command send out to recover original map, so pcitest bar test can pass as normal. - Other detail change see each patches's change log - Link to v3: https://lore.kernel.org/r/20241015-ep-msi-v3-0-cedc89a16c1a@nxp.com Change from v2 to v3 - Fixed manivannan's comments - Move common part to pci-ep-msi.c and pci-ep-msi.h - rebase to 6.12-rc1 - use RevID to distingiush old version mkdir /sys/kernel/config/pci_ep/functions/pci_epf_test/func1 echo 16 > /sys/kernel/config/pci_ep/functions/pci_epf_test/func1/msi_interrupts echo 0x080c > /sys/kernel/config/pci_ep/functions/pci_epf_test/func1/deviceid echo 0x1957 > /sys/kernel/config/pci_ep/functions/pci_epf_test/func1/vendorid echo 1 > /sys/kernel/config/pci_ep/functions/pci_epf_test/func1/revid ^^^^^^ to enable platform msi support. ln -s /sys/kernel/config/pci_ep/functions/pci_epf_test/func1 /sys/kernel/config/pci_ep/controllers/4c380000.pcie-ep - use new device ID, which identify support doorbell to avoid broken compatility. Enable doorbell support only for PCI_DEVICE_ID_IMX8_DB, while other devices keep the same behavior as before. EP side RC with old driver RC with new driver PCI_DEVICE_ID_IMX8_DB no probe doorbell enabled Other device ID doorbell disabled* doorbell disabled* * Behavior remains unchanged. Change from v1 to v2 - Add missed patch for endpont/pci-epf-test.c - Move alloc and free to epc driver from epf. - Provide general help function for EPC driver to alloc platform msi irq. - Fixed manivannan's comments. To: Manivannan Sadhasivam To: Krzysztof Wilczyński To: Kishon Vijay Abraham I To: Bjorn Helgaas To: Arnd Bergmann To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org Cc: linux-pci@vger.kernel.org Cc: imx@lists.linux.dev Cc: Niklas Cassel Cc: dlemoal@kernel.org Cc: jdmason@kudzu.us To: Rafael J. Wysocki To: Thomas Gleixner To: Anup Patel To: Kishon Vijay Abraham I To: Marc Zyngier To: Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Frank Li --- Frank Li (7): irqchip/gic-v3-its: Avoid overwriting msi_prepare callback if provided by msi_domain_info PCI: endpoint: Add RC-to-EP doorbell support using platform MSI controller PCI: endpoint: pci-ep-msi: Add MSI address/data pair mutable check PCI: endpoint: Add pci_epf_align_inbound_addr() helper for address alignment PCI: endpoint: pci-epf-test: Add doorbell test support misc: pci_endpoint_test: Add doorbell test case tools: PCI: Add 'B' option for test doorbell drivers/irqchip/irq-gic-v3-its-msi-parent.c | 3 +- drivers/misc/pci_endpoint_test.c | 80 +++++++++++++ drivers/pci/endpoint/Makefile | 2 +- drivers/pci/endpoint/functions/pci-epf-test.c | 132 ++++++++++++++++++++++ drivers/pci/endpoint/pci-ep-msi.c | 156 ++++++++++++++++++++++++++ drivers/pci/endpoint/pci-epf-core.c | 44 ++++++++ include/linux/msi.h | 2 + include/linux/pci-ep-msi.h | 15 +++ include/linux/pci-epf.h | 19 ++++ include/uapi/linux/pcitest.h | 1 + tools/pci/pcitest.c | 16 ++- 11 files changed, 467 insertions(+), 3 deletions(-) --- base-commit: f134785ecf3bd881a10f83dccacdcea2ac45e673 change-id: 20241010-ep-msi-8b4cab33b1be Best regards, --- Frank Li