Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1287978lqt; Tue, 19 Mar 2024 21:03:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUuHbwwC8SN/cEUmx5wnfvChaTzvz3KHcX6JnMS4xh0/s+i4GIxjzOCT+DBX/ZcMFcOB1Mr3ImNX4nL5I7tUzMVOtjlAPiMbFwpuooumw== X-Google-Smtp-Source: AGHT+IEQBwLXw9TpiHUTl245EBvihRk9m5kaTzxwzlHqaB0G01uwr5LskNcK8nBErH3bqWUbrW3d X-Received: by 2002:a05:6402:3788:b0:568:9934:6dcd with SMTP id et8-20020a056402378800b0056899346dcdmr12510789edb.0.1710907427281; Tue, 19 Mar 2024 21:03:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710907427; cv=pass; d=google.com; s=arc-20160816; b=H/AFmT9pqOk8G037uh/WIAAzuooXU7iU+bxgDL1rA1/KU4ehIvyI2eXkJF4ljn1HmU MOW2AvzUuwh2JnFGPTmMiIzkccLnpMXpIQEpW1U1a+5bAqK1UPaKJraNIRuPbxh9nOyH muH0kixOgyEP3QtDPuJobDvEsnvcQu7CuKVl0CsDu+MBDa68eJ90hLnSKh/OOP5KtseD egKcfuCH4KS/PMwW342dfOG6m4q7JGyKDWmV8joBU8HsvfDkaWiXDwgF6q4XFiqf5PNJ fvC3mSuq4OW3loiPBzUVmriOs6caYo2pk3PUBOsCXOqIHQhPjc/Mm8Dbgwv2H1j9TAml d1Cw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from; bh=jpIbEoiWM81ZFhFMutkvcMhtyQ7i9mmNdYx8BMnCrBY=; fh=aC77HMfnLp5TuTgChNiLkU72h3mWwCC2UfVgLGoPOK4=; b=Dcxm9n2cKT3Rci+WsawpgWA2ZMFJTCQsHTCCcYK++QlBvVyVfHoMwOuHB3+0MK0qe+ DG9SAT45tLhCiVQeQnTRtYC/KKll3Jx11nW8ChJBUU+ImUJRnrCg5i4/Y391oKDJoOzP zpQ2gA2z5s2i2FzNrZECs2IGFfW/TKYrdRV/nyTZmKVeJoHkEjFwRbVoj6dOL5i9VLj6 mxw+BBgnACEQm2wn/FEtrgCmLE2aT+WA+SngaWq63VR/1x6mAkJPNi2Z2/OtRy6BqJd7 aP5o+GpsCB9IAMRcpD5SSvIcjh3CnwHbLVDmB6ICmuic2sqtKiy+CJYdJP2SqVvJZVg/ bEnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-108416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108416-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q25-20020aa7d459000000b005686417984fsi5859479edr.579.2024.03.19.21.03.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 21:03:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel+bounces-108416-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108416-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E20171F234F3 for ; Wed, 20 Mar 2024 04:03:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BB1B7125C4; Wed, 20 Mar 2024 04:03:38 +0000 (UTC) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) (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 9C1EA1364; Wed, 20 Mar 2024 04:03:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=92.121.34.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710907418; cv=none; b=TzrNjgmBS6lmcxBYNB8fGjUfmizGHAnCV1j41rJ5LVhpO4Q+KhrDT6hi1iZ8CE1JSbC5++6PlscX1FDdkwj67zsxzB4G3oFJZn72YrOFovEwc0vfOSTuIcM5kphI/M9ZjOWIJ0z1bJGv5t9r1RLihVwiTgYnnteAxU6/01Khi4c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710907418; c=relaxed/simple; bh=a1iPkS19wKvYjByVRjYUWC8hvrMspm4HWjt5L6aSPzE=; h=From:To:Cc:Subject:Date:Message-Id; b=e55pbXMVMHnBP851rtCkCxgQFBCh9qMiD2mRyap2LVAsZfgDrsxqJZ7CvkG2BXFrnW+evJyx0bqA/EAABjhOL8i7dsjHqECmjAhfVijlyUThi5Av7ih2wCYuiZ90ERqYHnNwIJdbR0OULAbBbAkadKUM1ZmLbNxfTGvfIt61AuQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; arc=none smtp.client-ip=92.121.34.21 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 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 5062F200B54; Wed, 20 Mar 2024 05:03:30 +0100 (CET) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 170402016B4; Wed, 20 Mar 2024 05:03:30 +0100 (CET) Received: from localhost.localdomain (shlinux2.ap.freescale.net [10.192.224.44]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id 0A0C5183AD0A; Wed, 20 Mar 2024 12:03:27 +0800 (+08) From: Richard Zhu To: l.stach@pengutronix.de, bhelgaas@google.com, lorenzo.pieralisi@arm.com, marex@denx.de, frank.li@nxp.com, manivannan.sadhasivam@linaro.org Cc: linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, linux-imx@nxp.com, Richard Zhu Subject: [PATCH] PCI: imx6: Fix i.MX8MP PCIe EP can not trigger MSI Date: Wed, 20 Mar 2024 11:45:38 +0800 Message-Id: <1710906338-4596-1-git-send-email-hongxing.zhu@nxp.com> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: ClamAV using ClamSMTP Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Fix i.MX8MP PCIe EP can't trigger MSI issue. There is one 64Kbytes minimal requirement on i.MX8M PCIe outbound region configuration. EP uses Bar0 to set the outboud region to configure the MSI setting. Set the page_size to "epc_features->align" to meet the requirement, let the MSI can be triggered successfully. Fixes: 1bd0d43dcf3b ("PCI: imx6: Clean up addr_space retrieval code") Signed-off-by: Richard Zhu Reviewed-by: Frank Li Acked-by: Jason Liu --- drivers/pci/controller/dwc/pci-imx6.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 99a60270b26c..3238b63721bc 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c @@ -1013,9 +1013,14 @@ static void imx6_pcie_ep_init(struct dw_pcie_ep *ep) { enum pci_barno bar; struct dw_pcie *pci = to_dw_pcie_from_ep(ep); + const struct pci_epc_features *epc_features; for (bar = BAR_0; bar <= BAR_5; bar++) dw_pcie_ep_reset_bar(pci, bar); + if (ep->ops->get_features) { + epc_features = ep->ops->get_features(ep); + ep->page_size = epc_features->align; + } } static int imx6_pcie_ep_raise_irq(struct dw_pcie_ep *ep, u8 func_no, -- 2.37.1