From mboxrd@z Thu Jan 1 00:00:00 1970 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 01B5FC27C4F for ; Sat, 29 Jun 2024 13:06:06 +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:In-Reply-To: Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Hr41jn7CS+JV7JYEOXmHYOhJrr4EACp9o9fXqaxlvEQ=; b=2+c1JIbktwVXB81mBrPYoNoOTW W7ZGoFSZh9LBcQHH8J4BlzzQfIp7E+rA7PE3YOwk2DZFJKcC36+M8DuJglH17ZpHStpssFqar3eM7 q8o/8fPn4TP9QK/6mCIaAMSnd3LWxCOFK4sRFnrq6GXJNDuuQdmMRcf5RmlEq64Zat29L82selGwm bykWgSBS5jaYeUUsrPIZj/tDw1ibulGL4dlIg26efMPLULtZmM8hNDXBrZlML7i3/sBdeG58FZiYH tBAYZ0mdqbKiE0Ss1oZyCL6kB4RViaPkyMvDEiLGdSt+5i0qtZvaNT/es4hohgWaXRAjbYwFoYTVo gG+0OY1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sNXm7-0000000GQQL-18aQ; Sat, 29 Jun 2024 13:05:55 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sNXlw-0000000GQMN-2Xza for linux-arm-kernel@lists.infradead.org; Sat, 29 Jun 2024 13:05:45 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1fab03d2eecso11001645ad.0 for ; Sat, 29 Jun 2024 06:05:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719666333; x=1720271133; darn=lists.infradead.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=Hr41jn7CS+JV7JYEOXmHYOhJrr4EACp9o9fXqaxlvEQ=; b=MtuMxBG619lMlAJi+ySiBqHtV/jrH9vopZeeXA0k5pHdCTKLF/Qk1NRf1F1sk0AUTv L00ky2sDEbFaaL1spGPlD8++SiYSazFJ0eIqpTaufZpaC5CbQjQXf9QnTnb0oQioCuHt +rqML3iWv9sbYkCsu1e2iZ8qKvaZhNOPj+nVA/D1ts9s0FiIHakTt67FuguTYItHDDOz DxlvK7hP4VihKAcw/ZIv3zyJYP4qYUks66qOiY3hfUF6ZqytQKOencZa6BA9tm9CdqKm ZPiLT/v99NvXisbftI5Pr/U8Lb7+4yxnppfIlIz+PtPwv0bfBqx3tpBO246bZI1fwly3 4Gzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719666333; x=1720271133; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Hr41jn7CS+JV7JYEOXmHYOhJrr4EACp9o9fXqaxlvEQ=; b=X0vMyGBakodhTD+cHFVi8KawedwS9flqxK2Tc8ryxsYN3z0Ydx41HUhelBa/AEfjfo zYAD/+PHjAa5bWZ4xVQxYKzmMEP993TxQpFWZIZQlUyIele1zE6IxEJTqcY88B/APl1+ TzcvaDc8w211bTYfIcJN1gkFAnIroD/Td8I3MBMaZBfUl4fBK4nRp21dVvK7E5mGD6pD 6B4t/DqRrWoTagQKJdsS8F3kk4ONReN7LUbMs+6+DS8NbdLF7XdzE1Ri4UCAys9veQsK eVsoR3F2SjB4+AWgwrV4dKLLVVwnvqp6p9zvg7i3PNmtmjr8r5n+h+COTlYXfGVA48bp 7eQw== X-Forwarded-Encrypted: i=1; AJvYcCXhw7KSk6o3v2X+cS2cLBs6vVTte7h/R0l3YwV4eOM4n3pIzCzsw4ds0l6VH1xvl+dg5hfNia66Fx9iwsXb6cUuHBBI4V9e4tABhurXABlNEzGkp54= X-Gm-Message-State: AOJu0Yxdd7GD6ClmBbvJEFu0kDr0GGkgEDxx9SM4NacxxcgaktYjwMsg cu9m8tQr8duH9SAQpwd9Mv0xBx3T8tO5TXauoAKyawlzPjlymktZW5zxAPogyQ== X-Google-Smtp-Source: AGHT+IE5aU4sW0gZNOnsBZmQhd5QPQlm2dJswEqAC+AISCYfDs6s10N0soFFT4U1SUdqSjSMRwrfaA== X-Received: by 2002:a17:903:2349:b0:1f7:23ee:d496 with SMTP id d9443c01a7336-1fadbcb2064mr6324365ad.30.1719666333190; Sat, 29 Jun 2024 06:05:33 -0700 (PDT) Received: from thinkpad ([220.158.156.249]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fac1598576sm31531345ad.278.2024.06.29.06.05.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 29 Jun 2024 06:05:32 -0700 (PDT) Date: Sat, 29 Jun 2024 18:35:25 +0530 From: Manivannan Sadhasivam To: Frank Li Cc: Richard Zhu , Lucas Stach , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Philipp Zabel , Liam Girdwood , Mark Brown , Krzysztof Kozlowski , Conor Dooley , 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, Jason Liu Subject: Re: [PATCH v6 02/10] PCI: imx6: Fix i.MX8MP PCIe EP's occasional failure to trigger MSI Message-ID: <20240629130525.GC5608@thinkpad> References: <20240617-pci2_upstream-v6-0-e0821238f997@nxp.com> <20240617-pci2_upstream-v6-2-e0821238f997@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240617-pci2_upstream-v6-2-e0821238f997@nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240629_060544_674955_0A10A2AA X-CRM114-Status: GOOD ( 18.36 ) 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 On Mon, Jun 17, 2024 at 04:16:38PM -0400, Frank Li wrote: > From: Richard Zhu > > Correct occasional MSI triggering failures in i.MX8MP PCIe EP by apply 64KB > hardware alignment requirement. > > MSI triggering fail if the outbound MSI memory region (ep->msi_mem) is not > aligned to 64KB. > > In dw_pcie_ep_init(): > > ep->msi_mem = pci_epc_mem_alloc_addr(epc, &ep->msi_mem_phys, > epc->mem->window.page_size); > So this is an alignment restriction w.r.t iATU. In that case, we should be passing 'pci_epc_features::align' instead? - Mani > Set ep->page_size to match drvdata::epc_features::align since different > SOCs have different alignment requirements. > > Fixes: 1bd0d43dcf3b ("PCI: imx6: Clean up addr_space retrieval code") > Signed-off-by: Richard Zhu > Acked-by: Jason Liu > 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 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"); > > -- > 2.34.1 > -- மணிவண்ணன் சதாசிவம்