From patchwork Mon Jul 29 20:18:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13745666 X-Patchwork-Delegate: kw@linux.com Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012008.outbound.protection.outlook.com [52.101.66.8]) (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 B4CF518A955; Mon, 29 Jul 2024 20:18:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.8 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722284340; cv=fail; b=Zpk8KiDPwnr6ScERhYvOPqbcpWyz5v6Co1a7zYg+a6nASKwc8bjHLMsntq5uQo0wbQhtCkWVwJvr4a04jq6GnXDA/2WblIfuw//KO3+hP7qBhcH/cnpJSjrUYWqy1EYgoOCb9dbRaddii+007h3lwdZbPjo0INLT88eJL7gDdHU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722284340; c=relaxed/simple; bh=hpqdEP5Pgr9uYqW28LwRsva5OMhbbRtNGQBvj6M+tnI=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=BdTF5Pg7FA4Ee/EP2n9l378nEZvnRAsa9jcrAISP5X4/F2h8yd2qWDYPf/gtvIs/nBgLe48mkQafIh7ZqJkbDsnLQsbIHQZjSf9cjo3pwOYr9rHN0XlFUeecaYR4VgXPoipJVxWfA/hEyhCuZMA7474gUY/HBwGyI6EQYFkXIz0= 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=BDQXh7Br; arc=fail smtp.client-ip=52.101.66.8 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="BDQXh7Br" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kCmn3G3K3bfAlEB1RDyL8Y2NfWl/ubgGotUXEy3Y+21Ou/W6YfWHxGXbC+E9gr7pUNryMZKPywfeEmFIWq7Qjx9sGC/lPwzswXucWAhcR4VaD81TMYe5eZezgMR0iU5eUwXEbdwx6yBbiVd35zKlEHFJbzN48HopktWsi/mp62EKKdN8pBj+6i0bTETMTXyNYjqhC+PmR7cKicXbF1e1qcAQ0ElhHhTIY4ZBFaFoerVBFUyx9P6sk+uq/1kXEIAJVB4qwkzio3389T7P5ZcUhhPouHAwPUEn6GmgoT1NQGyv1AGdl1wTOHKO6Bzbt7CtvOGRPPjW54/n8QCUbFIYMA== 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=5mXPAqxzgD3DfLhd10Jz2h/StlIoB396o6udlgnSLuQ=; b=ZQFtbSqCf7w05w5oND7Of1QEoc/0JH8+NkfiplHxXikM+qnSAUazFKGI4NsuHghLiSpVCuogjfJu64PZejqpsO4BVlYpmqRrrQnO/FS4EdlyMoNbL9MExklP86XDZXCufNw6dvqnz+F3UyYt8VtNNlFaLyOGJ/KFuigOGuNYAcIn5tvVqazOoJlf5D0oLfysipnCaQ4GOf4YmyfuTdHNXpRNkgmB/pKfzYI+VDaLzSSnxlTZtLWivdFvNvpn1WX7cG+mdUnn+TyKMxCrItzsfYhA7kYEw9q4F/CX88vtMuw9PxQ/nSIuIcfZnJ/vwmrskPL5n1SySqIe6dorHzL31w== 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=5mXPAqxzgD3DfLhd10Jz2h/StlIoB396o6udlgnSLuQ=; b=BDQXh7BrglETCVkHbH/QDi9fsb8gKxPhPkdQULuwCXXQgDvuAWIPvz4ku/Fe8iqVSmaxEQuOe9Vx+4R8bYhtC8kS8IXspAY+4RHw3c4HEyhQP2w0HoMeYsFEGhU1ance+I5twl+OlqWoxLbXhiqRJ8QLx52GaPPzkLSfkDAP3ajFVs2C/Z34c6NgJGMkyrNPpC9pXM4r5/ronPHEvKyvtxO0r9EtafQ1sg2fhQDj4rVUbYQJNBLw0aZftn5vg9BV0nx5hNFi0JMKsGykzzc5valRsb1AYjlfTIpmPJJlc8NrnxOOvBLpeQ7P8Ib3J9U6SILgqvPKXn8gQzldmXePUg== 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 PA2PR04MB10240.eurprd04.prod.outlook.com (2603:10a6:102:410::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7807.28; Mon, 29 Jul 2024 20:18:55 +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.7807.026; Mon, 29 Jul 2024 20:18:55 +0000 From: Frank Li Date: Mon, 29 Jul 2024 16:18:09 -0400 Subject: [PATCH v8 02/11] PCI: imx6: Fix i.MX8MP PCIe EP's occasional failure to trigger MSI Message-Id: <20240729-pci2_upstream-v8-2-b68ee5ef2b4d@nxp.com> References: <20240729-pci2_upstream-v8-0-b68ee5ef2b4d@nxp.com> In-Reply-To: <20240729-pci2_upstream-v8-0-b68ee5ef2b4d@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=1722284317; l=1387; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=M9wO2WI/42fd1UXuH4/xq4IS1t8W2AIoBjreaGqLJqo=; b=btyzVEu7eaMJllA91jP4QDpf7klL334SGxCNLum/F0kgX2SlLLsuNDQMFG+NJe+YA087prVZT UqcnjwRTM4UDkK7+igOUT/VELY8DefnOToZbQ+36udd6REe1zac1i+S X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR03CA0069.namprd03.prod.outlook.com (2603:10b6:a03:331::14) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|PA2PR04MB10240:EE_ X-MS-Office365-Filtering-Correlation-Id: 1a63c99e-4139-4e55-ebd7-08dcb00babaf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|7416014|376014|52116014|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?pkc1Nc98zPQAYWA+VxqouyyqiOK5ubt?= =?utf-8?q?DNfvOBRZi61CbVLtMP/aVz0D/SJW1UDvDCiEnGYPtUaw2vvUh18X5vHE59YXgJYCZ?= =?utf-8?q?iOURf+lHIu3hCX6vggjAB1TQtFA9OdMGYeFeVw19/MC9/NvGadZBDduJuvS9JVxUI?= =?utf-8?q?eQAUiye/Z9YamZCMKmqufbifh91T4Xlcm6Cj5El6V9ES5C230w1Uzp1vcuyX70K6S?= =?utf-8?q?MVnTAML+t0BrgC6gRHzuIKbcyQ8vZRsgWXxh/X+mtyoOGq34jieMjy8p2v8H4Q5MN?= =?utf-8?q?86AZEni4Twm/jMpMLF1rYWpJOl5hT1tkQHITzQH5nYGgBDbGd5jG4pT/g2sdtQlRU?= =?utf-8?q?n1SHh66d39cSreUAekItu+A4vZMxlGW1H27m1y/zOXBKy5U/IBaGh9g3UgwbFrNLr?= =?utf-8?q?6eOKWHLRHiLc1hgd5VbkEOEH0Nc0DkAdfLuisZXFaE/fw5S2xWa1uXC5y35TJju+q?= =?utf-8?q?z7gCdBd74hiaDi3ZhdwPNdwHLMtP3tQRjpiNXJmAJLRtBdKl6sntVOdDqo+9Irm5m?= =?utf-8?q?+/4Mt+fupIkbjdtQxlJbXZ3hQ6tLeN3jCYS276qDQ+8fNH2058k/rCDX5fs9CHzbU?= =?utf-8?q?zI+TNQFiOYwpIZd20ESMXwmt+zJT2baNgdlfiQ62B1fJFZKy24YAwOEX0kB91vFM+?= =?utf-8?q?MyHXnhgqOqqbL160aVPs81DOrK7o3W72jVmg3nZSVGkaBP2LVYrAVUzv6Lihy5rE3?= =?utf-8?q?E4zNuo7mfxuhfxsQ8I1LV3YRseteilfSyuqfW7UOenJ4ekePFB7k6z2SXnlq3wV+r?= =?utf-8?q?H+VTbMz0aAd/r16nvwisDnxAGmuJsSi+DqHJB/uqVbas/rGCUbzForBIgMMyBfBq1?= =?utf-8?q?XQkgihqH1IlWtMc6SLDDWudhWqA+unrdO+svJ/uE+nKWPnGCRYj06wL3pgnXzbIN9?= =?utf-8?q?/IhiLjfe15cTT/RowP2xnrfECLgOHOaLkmXcMjZ6YoK3jIA8d9oxfF+VIaLkGpPTx?= =?utf-8?q?mCrXVg8TlMsWu68ii+VS2HbW7tesVN0xHL5fcIfV9f0HZUfNNNci+SKw/JHoLl7PC?= =?utf-8?q?eSnOxCBRCwDu2IPsPkBmzIN2EbdIzMoIFDQG/n6X1EHuMvWQ3IQ+r+UEYTervco7e?= =?utf-8?q?6F5ngPxmuF2heuQPgHXFIngBJ3K71oBO0vI2TI9qa8/1WxRBH90OXdDdjvx1IyrMi?= =?utf-8?q?nTBgeCIiKI1jAy5ubpVdch3nbkiRL9/Quweyx1KQnM9gv4cj71suVryc3d4OYWjQo?= =?utf-8?q?gTfjyWY9ihKlFqbVTGb8bKhAWooJVCJqeBfnzne2PR4gvfNqCXPGV+vsvKeSjHBdn?= =?utf-8?q?U9HA3YestyVfu5gv44a+IEb7mtYWNjIwZOyZiH9ruZS8p9H3FuDHeEpoGywayVKpU?= =?utf-8?q?87oTgtFyDheFMFLdK9EfAu2bWCnPMOpm2HZHSSmWEvsk1h6Rs9WGN2Q=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)(1800799024)(7416014)(376014)(52116014)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?NeJQ3K7p83o93+Q79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8hdCbMFQ?= =?utf-8?q?KUpWUr7vRCe80O0PbJpaQcFLqm4prmRp3LLzs5qOQarEt3hqwMCbpecFMwfbOGv3k?= =?utf-8?q?9JdEAjwQOPUtycPM2QzGTHk2puvLbIYRcs2g3eyM36m+IFDIfQBK3neOQk1NIiipf?= =?utf-8?q?X8/bgbLTpe121z2Y015hfC5egtdKbFOqvUzbTBDmfx1n1dpeWXkYB57548dLFjQIX?= =?utf-8?q?dZMvBLH4il59s3k7yTsV98MFbw/ByE7vR6RR0PJPuhzyD5oZdp+VNxU3MuaNnkeQJ?= =?utf-8?q?bukI+oFrcuiEj1ifWuiCKIDynU3k+jbByUiLzuZIZKxqxqzOgItle0MwCgPZmyOWx?= =?utf-8?q?QsdZICWXu+I77VdF9r0utGA6OhALeISGmvvi/zT+hvdH97hSqQGDyszFXO6zzOWtX?= =?utf-8?q?JwaVXM1godr4VkIokaOnM8ZQnPx5o28jSkm+VA9Ih3P/mJOWVShPs6AEr5GtY76Xd?= =?utf-8?q?PaxzgsrEaE8yOjR/jSqWwQaj2+WCnhUjukLicmU6MdBEv26stfLV8EuSlnT/hp4Xz?= =?utf-8?q?8DLVEXuKqxgxgrPCszjX9/LCKFVlw2h7+odhoRyP9ctWWEftCQeBqoxRAnGjpp/Hp?= =?utf-8?q?WhK6y74VRGYMXO4Ma4wn/QqMTQBtc3m3817UuCYOUxGrI/RizaUxASj6p6KSV/g6d?= =?utf-8?q?teBcKT4sMhpa?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1a63c99e-4139-4e55-ebd7-08dcb00babaf X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2024 20:18:55.2355 (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: Zwchzj6z3QDQDnCAYqv5bPv7XPb8pPB9N6PMHxDFCagMKTfIOO8JtYjE4vKfTX05iqH7XTrOOuniE+DukQpU5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA2PR04MB10240 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 Reviewed-by: Manivannan Sadhasivam Signed-off-by: Frank Li --- 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 42fd17fbadfa5..3b739aa7c5166 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1113,6 +1113,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");