Message ID | 20250404-ep-msi-v16-8-d4919d68c0d0@nxp.com (mailing list archive) |
---|---|
State | New |
Headers | show
Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2053.outbound.protection.outlook.com [40.107.20.53]) (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 E8F1C221D9A; Fri, 4 Apr 2025 19:02:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743793349; cv=fail; b=KiZtN0MlV8PBcrJ6JXQ5JXygh/B0R4axefZVhUWT8C1sTta7gKfezctcHif6y/WLkHkqXT9lRgwTcogBsF0To7YMr01i4XjRlG/kQVAfVXk7n5oG+2zlDpqd8R4X5oaRahGxUs4qey/H2IVw1ANDZk1fxLXazzmbbcoBbtrtQkk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743793349; c=relaxed/simple; bh=N/Rcdz4WASrCVzB40i3dK6NDhujmvhnmUfU9wknM7Kw=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=hGVWsqrdW/0R/SGtQBx51fRMXAozTbEyv/R5ihWqbKApx7T4fqPLdlsIcD2nTIXnhsDTDpSfK1GHENnGx19vAVAUz8LGYyQQNAmW4LpSPX9AjaHR9+O+WLdPSUyRCy4ENdVxNy5Wghl7jxDvOUb1dhzzw/effLmBWrZZ82LVHm4= 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=aKtepLbT; arc=fail smtp.client-ip=40.107.20.53 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="aKtepLbT" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QD81Vc6vngu33xjhk9+i5u2QC4o9WBydXamZecb8J51KCwnSsCiuceOMX1W4F70xfgscSl6MTxrPDvyAIWRWx6IrHyKW0VLzs3TQrK7Lu8OZM3rZw6ttQxljuc5rGi3zIV62F3oDrJyn82tZCmZtUILXWDrFrjeQ4Ef4e82HM5m2MFhM/DOE/oAGBJi7KpIfp95pk81IXXu58yE/+1KxeHDrtWk0nzYChmCvnypqOq670M4Cy/Vv13EX1CpurGDGiTxm0gZI0oAcq4p7+CjBTPqjub7p16SQRwdjFRd2rI1YszQTMiRDGptf8muo4ov0ARCJjBiyVrDUozCT6303TA== 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=1IZAfUVaAOa7chBgO8REmAJsb14Zp8lXTUd7dS+omz0=; b=YDNrprgKn6PiTIeCvf6BfNB/H9OKFHT2UZuGmbrbUrgPlaUOy8sNGpVisYts78OvJ8L4H3nJq0k/R7V5t6RvNpmWNMSfOdYIMYL/VcQYpimYm+MRA+G8DD3VcUkMg4tw5YPcJRGTedpU6dItj1iWS6nO+Be4VmGCpIFE3ABlJf38F9NJmlP00Qn00i9SgJmwYpl8cLG323Rw26kpsdYSoyaBZhuG33tZ62zG8ouG3UITJzIFjpOC5Dlpd2fwrF6aiOEcWLqRuHiKHlZhHzSkBD1q2jPkure+dmOKibnmZdu43VeX9/3O9s+PPQdOYF/4wBdple5tpVQjbDp2GYNmjQ== 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=1IZAfUVaAOa7chBgO8REmAJsb14Zp8lXTUd7dS+omz0=; b=aKtepLbTZFHKqgR5Eb9nrXKXwTGsCw6NFRmfyH2/grD8mixgfCN4k9Jvva3M6NYoMyrWprqcw5/tIyvXnyaUajOjCT3D0wxLujLx6Gx1CEfpFb2hMrnJPdUVIQu+6jre2Uj0pUT7QXBW7wZqe+eflyupC1BJL1FhfsF/Gh7mEc+cpy1JGQBG+BbuC7w9d90S/Hd9FJaT0EZilb/ir1OXTjJ1XGeQHoLxG6+izTcCkkrWfQCCD+QUk4jTNePWiVrKxuI2aGeCwYLjByIivbpq6tQzKicm2EoAHMSctucvB/Mklo+5N3+bKEytHY99YGxV/HAoTXjED0ZzwUz92WhhhA== 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:24 +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:24 +0000 From: Frank Li <Frank.Li@nxp.com> Date: Fri, 04 Apr 2025 15:01:09 -0400 Subject: [PATCH v16 08/15] PCI: endpoint: pci-ep-msi: Add MSI address/data pair mutable check Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20250404-ep-msi-v16-8-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=1143; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=N/Rcdz4WASrCVzB40i3dK6NDhujmvhnmUfU9wknM7Kw=; b=l7PF6H3Th9cGiq46HdUyeFG6OzFlTPz3QQTzNdCgKmZ7lLApCVYxKmrQyEDodWNDeI2ojOMQF UVIjZJ8SiSrC1It+ZwS+wRK/6+jcwVVp+Trzx/ajyIP2P4ROo8QFWKX 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: 1b3fe2f6-3a69-4c1b-6912-08dd73ab3c29 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?H48uMZd9CcETXk7XVu1wX91C1TqJVz5?= =?utf-8?q?eeKaghWSKqeIicpyFALVrj8A/JjiyVgiRNOhMZ3QnALExu+OG9j3bphXVnn1Actv3?= =?utf-8?q?X9uSZWS5bRfUV4oGg8hhvH29I7kmVkzYpTSDKfblK43Wa8FluYj87vtrsedxYLajI?= =?utf-8?q?TDJWuRfmaQtukI9C0kcflX4Z3zGpxTqhOWRYAjLdrISSh9WKfltIOLMR8BbavzfbC?= =?utf-8?q?5HqiisktTnXUZ8n4j8II3JAnsoCD9pPBBcu7E7uLWjbgTcZuUn0gM0qOxqwPIDQAe?= =?utf-8?q?Jo5DhWk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CoZa5uj3SsJOCy4d74B7DpCV1OAEpo3QHcI7Y4mc2vhld4GA24wUPpGGXGsnO9jSD?= =?utf-8?q?jzVXCFHAqL1jKu4u7vzRGkRnHIRj7Pzw/e/X8F1rEaVcsK6W7t2geHfG4ZfqTA/J1?= =?utf-8?q?tjCZXZf5+4Sc9B46u9/2miLzqsakzGHOTzWJ3P5ozyPyyNuPhHyiKsqqrNfPENXxu?= =?utf-8?q?Lsm+Mz07G6DFsa0Pk7f+/Wb+3tvUJ0ijbMITKEavbkvbZqM1bVvBj89cCEWGUV7AZ?= =?utf-8?q?1MIv72IvMTDGEVbFP/v+UGBmZtDg0k4mA=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?LftrnBNDQN3PWBr7kJwUAt/JigTG?= =?utf-8?q?iKA4SQcK1VUzbmolMVMn9+d4s/g372VgmqLGmwc2pgvYBLAr5n4HYMiM6Nvs2tnCU?= =?utf-8?q?HkVxG4ndwKgXK/7sXsPx36w8Rd++NreWpz9fvV1FouJ+eU/Jp52rNnuNEvxl13Xzf?= =?utf-8?q?H+yOjBFC6bAl2Xd0mLamoNUHADavpa5sgXNeuxwIIN29yKvTRxHvopGIiWWZXWW68?= =?utf-8?q?DAm3AO5cmJXdM/MMFRyB1hVGYJmLkWAMKOWuHHHhaGgDkqN4JUNGyfV+Xb+nLF+4F?= =?utf-8?q?zr5AF+7QNhzxW7tNnMo/U8INBVv/skLGLAFiypU9Hxyx5HoES2K6Ucg0e4idI5XTG?= =?utf-8?q?bzogWf5+aUXj+ntG6GbG4ecv0bCq1L6WmJ1AAFZXEMI6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MsW0qPIpSgAb5L2?= =?utf-8?q?j02tkfYxDUSc7Kv7x3ooDbPWXeOYtSkWSgWfhhSG1fo5K5347CgwtqE/toTJ4Oe48?= =?utf-8?q?94miAkpr6qlwHM4VB+3SQJabDzeI/J9ezQKh0xZYBIBvZFMuZ46jRnkSKiElhfGnv?= =?utf-8?q?XSTyN5ckRArGM5wq6DnZajnAmw9GowRGfcdr9zWObBHRF4siGvc3wFkM/Vi2k/QsN?= =?utf-8?q?4PnpJfXtySDIED4+MMlk4HpeZUP23TxbCC/9Py63PISX/T3AVFFS+DvA=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b3fe2f6-3a69-4c1b-6912-08dd73ab3c29 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:24.3558 (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: Zmdsmnf/o4Kx3RWpJQD7urwuVQiX2AaiQPeps+IcOFb6iMWQDZqL32/NHBOdlB0I6YjUKdrA1KAbsbEcWNwbKw== 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-ep-msi.c b/drivers/pci/endpoint/pci-ep-msi.c index 549b55b864d0e..c0e2d806ee658 100644 --- a/drivers/pci/endpoint/pci-ep-msi.c +++ b/drivers/pci/endpoint/pci-ep-msi.c @@ -44,6 +44,14 @@ int pci_epf_alloc_doorbell(struct pci_epf *epf, u16 num_db) dev_set_msi_domain(dev, dom); + if (!irq_domain_is_msi_parent(dom)) + return -EINVAL; + + if (!irq_domain_is_msi_immutable(dom)) { + dev_err(dev, "Can't support mutable address/data pair MSI controller\n"); + return -EINVAL; + } + msg = kcalloc(num_db, sizeof(struct pci_epf_doorbell_msg), GFP_KERNEL); if (!msg) return -ENOMEM;
Some MSI controller change address/data pair when irq_set_affinity(). Current PCI endpoint can't support this type MSI controller. So add flag MSI_FLAG_MUTABLE in include/linux/msi.h and check it when allocate doorbell. Signed-off-by: Frank Li <Frank.Li@nxp.com> --- change from v14 to v16 - none change from v13 to v14 - bring v10 back Change from v9 to v10 - new patch --- drivers/pci/endpoint/pci-ep-msi.c | 8 ++++++++ 1 file changed, 8 insertions(+)