From patchwork Mon Jul 8 17:08:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13726895 Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010015.outbound.protection.outlook.com [52.101.69.15]) (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 BAC0414B967; Mon, 8 Jul 2024 17:08:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.69.15 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720458519; cv=fail; b=tkAGkkXz5TDrxo6MkXVfIiTpOEdT3bdqDYiQLEdWZ9+FU7LxlcOn+qXNvGWupOTmWJwq96pPZyIllmiExz+tM4ADZsQD17+Fw+kis9AJgfjxKhKK5gSPD2pmEDTmhz64hiH3Av9Sx5TRO9dtWVYIJxWUM2mOmKTcA56Y7xE3AOU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720458519; c=relaxed/simple; bh=Jm6GeRMPxeTBPfJ2OeGnp/OweXbfacd9STdPEml5mz8=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=p8es6rMmEAAqdCqNzDFYAF1afj/kO/sAW+HJ4H53uwhtUdL7KjRhM1QCduW8BN3Vx+nG+Za22oh/Ml6ybd6wTuLJ9RNpzeHuVFalw74T8+0HM8NycqyoHz24JzWu92Yv1Bi/G0oyiXXm1I4e9ltwu3TqsWeVLSXs7i69ddcAT30= 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=n9ZDKSkq; arc=fail smtp.client-ip=52.101.69.15 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 (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="n9ZDKSkq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RhQjdnmIZINFQeTnbcvCvUUbLs9ZfT2qjETlNiyTfjFtAYCoZd3VMPsh6i6mpS430xGb+1rLTAYYZsFH+fFPJloI6JVU0VulRwKtNeX2KQwYTY82Xp80bcSpyeuKKjj28/1+Ff1rynF54hJ9Q1s2zvhH9PlezKtw/HFMUqvjNnRetRbVhpZgFZrw2OpkCFH8gvxTgWEqH7OEgmfQZ6FlAc4Ef8dsrxY2kIN3uiWE6v+PHnW906eaDQwr8qcC5ALnShN5qMp5cRpKcKob3bNqQxUqtyD0Z/Cmj5xIsMLkC3QrExLXaSCThvzdrMWLhvfGM7Zol2xJqHyGG7wJBnc+Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=nmaevdNZlABMzm/iTBpcukEaFZ5SPA983fiKgGailbg=; b=DLqTuqBXzAi8I+0ZOY+WS7AK6gp/ubNaSpdiOUv2nENyfOm2woadrn+3MEmw1WNO1szmmCZ/5SVEVgMn3T5SBmhLWiu0Fey8uMiWaywdNlVAuGTE1KHI/Tyj8K4kv6z60RbyzDqkRyjU4zm/1s/Vw+++oYzl/4sMolkb+UzGM2hdzLnkyUM640Ozi66wLzW+g6T4+rFxVc9Uukgs3ULgl06Q5qEVnlODjJQT4lo2bjFT4KrkXWwSNzyZp7URnbtY1o1oskGcv45KIpAZJm9EalZLi86XQIm6uctkNTWOxyQWNHQ8lBMxuFI4Zt+fC+2kavyQJcxCI8kQJroe8zrT4Q== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nmaevdNZlABMzm/iTBpcukEaFZ5SPA983fiKgGailbg=; b=n9ZDKSkqpP0oQ0bW1nxFOf/DLi8S8ptW/yx5OMqjbRCkEJBReOujfelm61lcwY9wC2vYEFP7ZwUDi3+uwpbAe3Ar864BLtvwU0l1WKp3K6TtATC1vkLD2iVq4VENfN/8qpYFnDNGuCszf7YBv8yy6//coOVXnl6j1qDSsgPWdek= 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 DBBPR04MB7867.eurprd04.prod.outlook.com (2603:10a6:10:1e5::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 17:08:35 +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.7741.033; Mon, 8 Jul 2024 17:08:35 +0000 From: Frank Li Date: Mon, 08 Jul 2024 13:08:06 -0400 Subject: [PATCH v7 02/10] PCI: imx6: Fix i.MX8MP PCIe EP's occasional failure to trigger MSI Message-Id: <20240708-pci2_upstream-v7-2-ac00b8174f89@nxp.com> References: <20240708-pci2_upstream-v7-0-ac00b8174f89@nxp.com> In-Reply-To: <20240708-pci2_upstream-v7-0-ac00b8174f89@nxp.com> To: Richard Zhu , Lucas Stach , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= , Rob Herring , Bjorn Helgaas , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Philipp Zabel , Liam Girdwood , Mark Brown , Manivannan Sadhasivam , Krzysztof Kozlowski , Conor Dooley Cc: linux-pci@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, devicetree@vger.kernel.org, Frank Li , Jason Liu X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1720458497; l=1316; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=l14lKtYuaY1+3koIMWZcDAe9ZGgSegJpQYHD4eJEreI=; b=nGTCzoSrnG9T+MK3JZPMjCgvuInupZ10wJn1acT2nGO4CsBe7gZMW2HOvPwHp2Rzb0k3fUhNp MF3yxSZjlFVB6oUj/n8/b6Jy7/TNFUwNgx0tsUaI3XadIeJ/M49P5BT X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0198.namprd13.prod.outlook.com (2603:10b6:a03:2c3::23) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|DBBPR04MB7867:EE_ X-MS-Office365-Filtering-Correlation-Id: bc482cd4-f661-4da4-913a-08dc9f709a13 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|52116014|7416014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q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erlMDgV0txbOAsCh8N2kvQ25HooLO3GbeTT?= =?utf-8?q?REFwAptcBMEmvYkLDNhqcP9VbgzouIgxjogkV0PMtNRQzGbs8CRi9+MIhwE0YUdlJ?= =?utf-8?q?DlWCmacJyRqU8Ww1eAJaUUsUrOcPLLyTzP1Vr64ec+OyQ22xixrSyXte3CADv+Dxc?= =?utf-8?q?2FONqRpSyqGFKKc6gZpDpADS5Jj49BcheR0gCdTr6n45+PA6ibbrEEPZrnj3PjO2q?= =?utf-8?q?zMOLOP5kwvMokW7DZaj2PVyjU18hXIxYgoxEdWx6oPYXTzyhKEPqFLMzA1uuioP0Z?= =?utf-8?q?i7SK51FOwcFeRKIkYsX3HxL23GlHBAXdJBIZ9G3a9K/U8/DlGvQNudfkZST+pkvi7?= =?utf-8?q?vXR7FvB/jKF07DCLh5M0E9v8IiaeLMpzIuag5eVI4/RCSRZMHQID6RLUJnWkK3dsz?= =?utf-8?q?dDmM8xikOUe5CPm7c7VPl/31GlO+F85l9KuUrT4+hPpyPJFUSPNCAwkGd5Fci4wVp?= =?utf-8?q?zpyslHKKvZVIvJ81JLykavx8O3S5mydwOGi84RwDAFiKYvtlC0FIjxQ=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)(376014)(52116014)(7416014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?xZz/cca4BKPCzWns/dVNz1Z/VyKE?= =?utf-8?q?303ProVVDjxIeVo9PXm0xyul4MJUt+eAewtYlqe5C+XwgFTN/GnD4fffrBD01oWKk?= =?utf-8?q?MFrJZ3qKMpyZrVRNwspSTAac3dLOtA1yrKnsoN/tRPYFm+lVR7nI0VKbmrRhiNqtL?= =?utf-8?q?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6?= =?utf-8?q?pBqBPcNh6bkenk8dxroeKB2Z3SZm88eFPStDEHv/E0TAusO/ZTJlV5NrvO0QurRrx?= =?utf-8?q?ekwyKS+hPR+dnMkwUwdU/wfeBD0iXAuC3wWK0fuaIOmb82dhgn4aMKKT099WCYcGS?= =?utf-8?q?6S8cV2uUzoq+6ZTn5eKKaQnJZhapKLEXFNK30mf1NPYCHz5xprwM6WjPcJiHfEk3s?= =?utf-8?q?K2Tl75IKl5BaAjzd/R83vlK2PjmJacnqXlxVCdQIjsbXIPrIZs0Edy5kUAU+fvBab?= =?utf-8?q?+uSLA3qOeXy4aHfTO/3S9a6FEMRVHGtFpIGdKRBVRjnAfyDIDFA9A0kM5er5C41HU?= =?utf-8?q?X+lnLtfGQCjF4lIgsBQabOI78NjxFMrPspomOIaekmbKa5UrIEM6KFFDsL0howXgL?= =?utf-8?q?uF0RVNxtC2DHZZIWIFu9CSw8+IjIsipbTVHJEnlPI+DRZQ2FYaSlPQcHRnaCdplbY?= =?utf-8?q?sbuhAJe2TNBsqYM/m3SWTlOxLAszK5oGFwPaVnS1OLHUJMexl+yhwy40=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bc482cd4-f661-4da4-913a-08dc9f709a13 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2024 17:08:35.1151 (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: 6DU4ftsBgM3fdzyWuzx10FcUA8w2ljNSb4U1pS1cDUPSfhMgGPmMwy9/81fR6bzOeFAPA+Qq4zK9vJCMtqrH7A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7867 From: Richard Zhu Correct occasional MSI triggering failures in i.MX8MP PCIe EP by applying the correct hardware outbound alignment requirement. The i.MX platform has a restriction about outbound address translation. The pci-epc-mem uses page_size to manage it. Set the correct page_size for i.MX platform to meet the hardware requirement, which is the same as inbound address alignment. Align it with epc_features::align. Fixes: 1bd0d43dcf3b ("PCI: imx6: Clean up addr_space retrieval code") Signed-off-by: Richard Zhu Acked-by: Jason Liu Signed-off-by: Frank Li Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pci-imx6.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 9a71b8aa09b3c..ca9a000c9a96d 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1118,6 +1118,8 @@ static int imx6_add_pcie_ep(struct imx6_pcie *imx6_pcie, if (imx6_check_flag(imx6_pcie, IMX6_PCIE_FLAG_SUPPORT_64BIT)) dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)); + ep->page_size = imx6_pcie->drvdata->epc_features->align; + ret = dw_pcie_ep_init(ep); if (ret) { dev_err(dev, "failed to initialize endpoint\n");