Message ID | 20250404-ep-msi-v16-6-d4919d68c0d0@nxp.com (mailing list archive) |
---|---|
State | New |
Headers | show
Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2076.outbound.protection.outlook.com [40.107.20.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 873B9221573; Fri, 4 Apr 2025 19:02:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743793336; cv=fail; b=niQ9a1nyj+5uzS5rKmrZ859gTe53Q4speIfWaeszO61hdfUL4TxeOrQgAo650axH7TbT+AjSmVsEJpqA1Eaoc57pPuWl13TAwVAUpZbMun/7dMDJ0PIF0pw55k6RnzBgTUkUCytiV0UOyYuWRuEJ4GZk7J2Gb5OJLPsY0wonvhc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743793336; c=relaxed/simple; bh=1rniyVcGag0eNeLrwWvT+jPUnbYZckhT5xHhMRAAH+k=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=ndZCzq6QHivMjKvzu1W5djSkRRNKcqzlXppYQ0Vnz6trv3GfgFGrsCmw53V8Yl8+aaNUzud1KjBivSJRz05XRJnAXusYnMgakjf2njSBMGOQO+FPJWCxhgRJVIhGpGofSXWDvXUJ5RPG+X3VNYoRCuLuA5DFzSG6eFszdszHbHc= 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=YCmX7qDQ; arc=fail smtp.client-ip=40.107.20.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="YCmX7qDQ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Vx+f7gnnVxcv8hlPZbpBxKM4G7s2FoL27WtYJj1UXomtc3CK907GM5Xt1b/bmx/2luxRqE8yCgCV0dBjyQ+JQBBahEmSx6b5f4YAFolzRHD4akD3TvyxecU3Mkx43n9/uJdyhRHEnN1uwF6MskUR8xyHxEI/S54ijpV3i+EPVnK2Uf0aeuLleMk4ufP4r62YodlcRTeQHpcw+261ttGdoMSg7k3aGN2Jh28W117dSwClwDn4t3Yp9udJ8SeFncJJldhPLsZNmSlBHDFfrKgvPBQu0RPUBVDhApEDz4OcB2Q/iYrUEtvai2i2JVWd4+wRwkOQaoop+n5ZsHNjwNZvmg== 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=CV43Lv9xcy4k1Ss3c5nbEs7m6Hdf2yF4V9lxFdIqHso=; b=Ltjz1OnvnJKN2rEFcrxMx/Z/zCzmPHzyIROLzhlaIdiVCnfLk5XL/id0p9I00B3087y06qjXighoAoyDNod7C8ASBlq69cDd8z2fr22UIoGaiob91XTTb4z45Lv30+VX3Jdpgw78ltkT1Q+cGVDVcz+3nvAlagFDnOW9WOIDNet4DnR9VfEjPc28fwzYFhFsS86nv4MEbcbOBAnqGFqoXQhxXLHf4xbzy0DIRUDSIxnvfm7Qk5YDpdJ93w1kKlCgUjVBAJCIuRQ8PokmDjcQJ/m3oDn81fpWzpeJ9OPmOdRmlxqum/jGPi+cXe8HgA714XC6t03TGBShHAPgFh02HA== 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=CV43Lv9xcy4k1Ss3c5nbEs7m6Hdf2yF4V9lxFdIqHso=; b=YCmX7qDQ1O1X7cs0/6LY0g1HGvAVvcRIb+ktUmCs3cSFbiTeZm1Z/Ge8zx0ie/D0NLZ9zoaTDCzdSpNFnRuKKLI3lkzclAFcvUk2Mq5Gr2cjWISRB5aA/7xw16L/zReRF6gpsrmePc2FXe7QFqzw3BHYtL3mqGlw/ZS/LvpuiDoHY6t8luPpt/WWlLUP8oyLVlIL5OH/7cxvD0a/B47iK7NUsT2GfSNrTJWdszkuvFD5b2YVXjIn2ZNSRXOZ3qgBEmqCOR2AaKpUeyOSXv2mOsrsYNEnoYZDYYeZvEikLUNh0Y3kG88YS61nqVZFp1xdTA0jANb42mhGLq1yw/v80A== 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:12 +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:12 +0000 From: Frank Li <Frank.Li@nxp.com> Date: Fri, 04 Apr 2025 15:01:07 -0400 Subject: [PATCH v16 06/15] PCI: endpoint: Set ID and of_node for function driver Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250404-ep-msi-v16-6-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 <kishon@kernel.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Thomas Gleixner <tglx@linutronix.de>, Anup Patel <apatel@ventanamicro.com>, Kishon Vijay Abraham I <kishon@kernel.org>, Marc Zyngier <maz@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Danilo Krummrich <dakr@kernel.org>, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>, =?utf-8?q?Krzysz?= =?utf-8?q?tof_Wilczy=C5=84ski?= <kw@linux.com>, Kishon Vijay Abraham I <kishon@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>, Arnd Bergmann <arnd@arndb.de>, Shuah Khan <shuah@kernel.org>, Richard Zhu <hongxing.zhu@nxp.com>, Lucas Stach <l.stach@pengutronix.de>, Lorenzo Pieralisi <lpieralisi@kernel.org>, Rob Herring <robh@kernel.org>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, Krzysztof Kozlowski <krzk+dt@kernel.org>, Conor Dooley <conor+dt@kernel.org> Cc: Niklas Cassel <cassel@kernel.org>, 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 <Frank.Li@nxp.com> X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1743793288; l=2203; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=1rniyVcGag0eNeLrwWvT+jPUnbYZckhT5xHhMRAAH+k=; b=l2GT5L9pAQRtDgsWVqS+DYQaoA9WM/piy1ZMyGQlFSWPnOn4Iu0+Cx1X+c+14JETVpXYXUSZG OuF5a5+ClugDUoZC+MFwQGkSpPLyriD5qv5z8o68Yc9UQicY/PaoMCP 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-pci@vger.kernel.org List-Id: <linux-pci.vger.kernel.org> List-Subscribe: <mailto:linux-pci+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-pci+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|VI1PR04MB6957:EE_ X-MS-Office365-Filtering-Correlation-Id: 697490ec-c8b2-4178-fab6-08dd73ab34d4 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?n49GQl4P6yocnXDv12H/+YrDXYcmYc+?= =?utf-8?q?2zuADC5WOzIqGyyvhRsDVn292dPW6CdiIJV0F/zkbn+NI/zO1neexffDmQ+2YY8zN?= =?utf-8?q?EEBxplNJzQtc6dvZuTkR4GvL6ueE2I2tKvO7JfBeyr0yr/iUqA0n323NbbaqFIAIj?= =?utf-8?q?MJUUoX5ofF3HzOAdu1vWxeYErn+frsv+rQsoJyo7JkxuJCvT0zX/s6PBpjcSEusUl?= =?utf-8?q?EoYN9a+3gRG047ztWjnJGymrt8C1FrCzIpatoL2zRbq1dH6KrRLCmOxdI14VP085X?= =?utf-8?q?QP/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akR?= =?utf-8?q?oYOSBjG12UoH/uodnzhDdTiqDOk9KHFVC2UXHiF6oyeN8kCGSm3G/ZDpu1l9O2/03?= =?utf-8?q?REPsGnG7xGqdLjNn6o5rQabWlhbdfrBXa4sarOFsxSEObBmIYvbLQomJiD88HnbMe?= =?utf-8?q?+21k2Z3bMziUZK+E6kblj0WA/YD7C4jOaMrfww17BF5yWyG2ULGWeHx9p9D2CWce5?= =?utf-8?q?1C8kEJh7BS3NmL4OoB1jeYnD8AAuvWXLGfo7z8ILsep8bWiKbs6F42B8GddmlaAR2?= =?utf-8?q?F3ZzvnPk8EPFYu8Lwh60xw+mmC9lp+8Iw=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?FqSPzipwWOV6O5qSYUJFXzY6P07g?= =?utf-8?q?Gd1Upg4qD6K94Sor2kv/ar+/9YDM2+7L1jB/pk4nW2z4808oycMlh5fJmy6N/uaI4?= =?utf-8?q?2uKsRcrKCn6KEH4sztKn74Tcah026pjBQKSmaoKuDBk9FXn1UNiu1KHauA5FWafI1?= =?utf-8?q?iL7Z+TROBFzSOpRzEQF7CiKiI4orKjpRWHYGLG/FScll9Upme9X2GG4wr10de4AeU?= =?utf-8?q?V0re583lC2VAe6hQFooMClybDUKn5/JpPN8LiO4mBMpHqbxzm01v0OjEy6f9mxsmx?= =?utf-8?q?Mc5mOkv09eGpJ/7rz1eC0pNPlAnHRwv+aD/mYstopQ/77rlT5u/SvZ9N/l1ML9+en?= =?utf-8?q?OsjDGMV4vM2o0IdgT5tkuBHPDL5ruVQZXrypRmP9wmp0LXF2sPTxVBAc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?= =?utf-8?q?bP9qtILm1S9U/2FEWhHRAZ5JKB3kERxKMYEbS4yEXNXPq/hu4kFRe4fec3atto2nd?= =?utf-8?q?rfwHgeAiCa6rySp8KWcgnLCWjxHdc40ifSq5Q3qjO2D0vpv6hjBRw8A+yMG2jeo76?= =?utf-8?q?sTvA4bnckPbk9c12TznUnweYAGveNCHJoRFfIt2YeKmwx+5lcvrNZKoR0H7h+Lthi?= =?utf-8?q?FytPNsYCIDhmeCpOAh3zSbBirplz7N5vT+qT8KMxmCypmbcU7jiH+hjQ=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 697490ec-c8b2-4178-fab6-08dd73ab34d4 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:12.0528 (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: XjI1nPgwbDXHP2/CRycx1qFmwRg6uocSF6Oi1789kAdlynK13qnp4LkEKZgg+GD8TLjMcJuW8wL+bHyf3wdPJg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6957 |
Series |
PCI: EP: Add RC-to-EP doorbell with platform MSI controller
|
expand
|
diff --git a/drivers/pci/endpoint/pci-epf-core.c b/drivers/pci/endpoint/pci-epf-core.c index 394395c7f8dec..d04224b8e1631 100644 --- a/drivers/pci/endpoint/pci-epf-core.c +++ b/drivers/pci/endpoint/pci-epf-core.c @@ -120,12 +120,16 @@ int pci_epf_bind(struct pci_epf *epf) epf_vf->sec_epc_func_no = epf->sec_epc_func_no; epf_vf->epc = epf->epc; epf_vf->sec_epc = epf->sec_epc; + epf_vf->dev.id = PCI_EPF_DEVID(epf->func_no, vfunc_no); + device_set_of_node_from_dev(&epf_vf->dev, epc->dev.parent); ret = epf_vf->driver->ops->bind(epf_vf); if (ret) goto ret; epf_vf->is_bound = true; } + epf->dev.id = PCI_EPF_DEVID(epf->func_no, 0); + device_set_of_node_from_dev(&epf->dev, epc->dev.parent); ret = epf->driver->ops->bind(epf); if (ret) goto ret; diff --git a/include/linux/pci-epf.h b/include/linux/pci-epf.h index 879d19cebd4fc..1040d83740f9a 100644 --- a/include/linux/pci-epf.h +++ b/include/linux/pci-epf.h @@ -213,6 +213,8 @@ static inline void *epf_get_drvdata(struct pci_epf *epf) return dev_get_drvdata(&epf->dev); } +#define PCI_EPF_DEVID(func_no, vfunc_no) ((vfunc_no) << 3 | (func_no)) + struct pci_epf *pci_epf_create(const char *name); void pci_epf_destroy(struct pci_epf *epf); int __pci_epf_register_driver(struct pci_epf_driver *driver,
Set device ID as 'vfunc_no << 3 | func_no' and use 'device_set_of_node_from_dev()' to set 'of_node' the same as the EPC parent device. Currently, EPF 'of_node' is NULL, but many functions depend on 'of_node' settings, such as DMA, IOMMU, and MSI. At present, all DMA allocation functions use the EPC's device node, but they should use the EPF one. For multiple function drivers, IOMMU/MSI should be different for each function driver. If multiple function devices share the same EPC device, there will be no isolation between them. Setting the ID and 'of_node' prepares for proper support. Signed-off-by: Frank Li <Frank.Li@nxp.com> --- change from v14 to v16 - none change from v13 to v14 new patch --- drivers/pci/endpoint/pci-epf-core.c | 4 ++++ include/linux/pci-epf.h | 2 ++ 2 files changed, 6 insertions(+)