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: 13726918 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0B5DC3271E for ; Mon, 8 Jul 2024 17:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To: In-Reply-To:References:Message-Id:Content-Transfer-Encoding:Content-Type: Subject:Date:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nmaevdNZlABMzm/iTBpcukEaFZ5SPA983fiKgGailbg=; b=o5VLpbczOyIffhOY2pMtecCJOQ rrrmsEhh/b3uLqqYvorkH0xQZ/7dVOEYOOHuqWaAkakEMlVcW5onKSr0ar3ofODydMPW78Z0toYfP LkB7tlOquhUb/G0jHK4+O4E3+BYEmRQ2rGl0UURD6a2lbmVYTjo5CiYg1zOucOXo7vtHKQYKGB3XA Sus401EAZlLJ5WUNb5Ear626gFqF7bwyM3j6aF78pf6H7Vq4FTsgB8G8GGfsXcPhVLzWqP3d1pzHO 0gNp37s9zUalT+qzn8bnlomUlvfJDv1v+jt0QGIj6NE5m/RTph78erNaDXgToQ3ktomqc87kncV6q WUUMSi3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQrrj-00000004XgG-2kic; Mon, 08 Jul 2024 17:09:27 +0000 Received: from mail-northeuropeazlp170120003.outbound.protection.outlook.com ([2a01:111:f403:c200::3] helo=DU2PR03CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQrqv-00000004XIX-1UH2 for linux-arm-kernel@lists.infradead.org; Mon, 08 Jul 2024 17:08:38 +0000 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) 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?3T0QaUE9zN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sCh8N2kvQ25HooLO3GbeTT?= =?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?cVM3q3JybL9+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?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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240708_100837_437917_253081AC X-CRM114-Status: GOOD ( 11.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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");