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 29F96C2BD09 for ; Sat, 6 Jul 2024 17:40:35 +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=+w1HhCtOPF6+jQjVe2f79xd5RcxOFhfFM5UmLnkLxcg=; b=AjcWb5kiT1yE5ylbthTArRkBm0 te8Of4SpMX0k9X/oPr9DeDM5V/6nFnWlHbvYdKufzCdgs1/4uL1BNKJD6HxcBSYkHSMEtOw36F3Pj /0peLv0ecMMcMg+/Rhlk74ub+oFQVw3TiWk8gQ3nTShcT766hIHsv+564knx0yeZOSt+euFMD+BEn Ltt1rj3qG8zbIPO7RfKGY+I88uzm7b2EPCY5jkJHk199l/BZpTXruvrwZv6P021X/NAyJJL09vOnq nzJlA0Im1zY7nOWTO9tnPNzCAA2W9P6ApCM/VZErn9w8TQOUzUVwCKiMDJJMbNDwl9cRpr31EyVT4 XYY0gpyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sQ9OV-00000000XkD-1STi; Sat, 06 Jul 2024 17:40:19 +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 1sQ9OG-00000000Xha-2PNx for linux-arm-kernel@lists.infradead.org; Sat, 06 Jul 2024 17:40:06 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1fb05b0be01so15234935ad.2 for ; Sat, 06 Jul 2024 10:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1720287603; x=1720892403; 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=+w1HhCtOPF6+jQjVe2f79xd5RcxOFhfFM5UmLnkLxcg=; b=kdneCdymtTfruP/+eYxPwCV2K4hVzG8q9t0GZZeH4KnxxACW8hyZPnbeWOz9bY22uu u9CWztsR0MW3KtSDtp3Hjk6mLSTK3wDj3K8l5NWlFSXQt9E+K2RbT80cemnnXzML2c9v FVbapLavuG8PybhQLOdLTeTTCvQuxUSMNP924HyUq2hBG8u7UDu+BAskjhacDEZRu8cF O3CNcl6o1kloit86DP4glQn8kJInS1Nk5Q77KbBSga+cbNTv0qD1nMzpAluhtfEZrPZ2 dXL/rZ81Z3F4jfVceJO+rdwuAzC3HaVEyGpa2oJeu9rtXyYXyNtLcC6As9yaNXvOrqko YXkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720287603; x=1720892403; 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=+w1HhCtOPF6+jQjVe2f79xd5RcxOFhfFM5UmLnkLxcg=; b=mLedtBdssJ2ZaAZsGqN8eo7+xH8iP5tEawCJYwJiTS45opZBWCNqA0kUA4EIliosPM 25LhMOumeBlyx3qPOtqa8Dl5cUMRj3XJiZWmLY1MtyGcQYBC3NuBv45yGQrnhTnzH91M iTrF3oQRVkFP38aOjBp5R2yk/ZU55a4YQoU/vSRwi0/7iXIlv1z3w3Q3owterY6DW2C3 ePjDTv2O43XY0uZdVhaTVbetCdC+TBbB3IAU0kwDK/XatnFw2GfY97ya3zPj7X+vZzsh 4p4VQ1J1dV9ji7guElRrY+hj/F0RGba1nEPY3f4eSh9SXldfqPRxYdqFSL9Jf6wpqHlR cAfg== X-Forwarded-Encrypted: i=1; AJvYcCVhrVbjE9wl+b1R7eskhxEdNTqJqdBUCAwxEGA+YU00V2gmh8+MYFmxtGuv2sWx1g+jjjCwLnD7363HXfXzot+IlHxWEyOJxDCx0zCMjuPw5UG3Ylg= X-Gm-Message-State: AOJu0YxFlbP78t30mix886ls4cBt4ok5rQVfzTR2lmjZHtAE8pSkRU9c ITNCu+1Laz4mQ7F6IP82nBhQ8OE+YPg00Gw5QHaB5eObcD+ym3rTocgLUZuSKg== X-Google-Smtp-Source: AGHT+IFfAmOh1vpybFa6ASP3tIwymsHJN+q/v+qmk1RVhTTsF5OCIrWZZWApJcwuyin0gArdkk3Wrw== X-Received: by 2002:a17:902:d4cd:b0:1f6:e20f:86b4 with SMTP id d9443c01a7336-1fb33f36fc1mr68382145ad.61.1720287603063; Sat, 06 Jul 2024 10:40:03 -0700 (PDT) Received: from thinkpad ([220.158.156.249]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fb14faa241sm70616845ad.110.2024.07.06.10.39.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jul 2024 10:40:02 -0700 (PDT) Date: Sat, 6 Jul 2024 23:09:54 +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: <20240706173954.GB3980@thinkpad> References: <20240617-pci2_upstream-v6-0-e0821238f997@nxp.com> <20240617-pci2_upstream-v6-2-e0821238f997@nxp.com> <20240629130525.GC5608@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240706_104004_660964_1B257028 X-CRM114-Status: GOOD ( 19.25 ) 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, Jul 01, 2024 at 02:32:59PM -0400, Frank Li wrote: > On Sat, Jun 29, 2024 at 06:35:25PM +0530, Manivannan Sadhasivam wrote: > > 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? > > pci_epc_features::align already set. > > pci_epc_mem_alloc_addr( > ... > align_size = ALIGN(size, mem->window.page_size); > order = pci_epc_mem_get_order(mem, align_size); > ... > } > > but pci_epc_mem_alloc_addr() align to page_size, instead of > pci_epc_features::align. > 'window.page_size' is set to what is passed as 'page_size' argument to pci_epc_mem_init(). In this case, 'ep->page_size' is passed which corresponds to size of pages that can be allocated within the memory window. Default value of 'ep->page_size' is PAGE_SIZE which is most likely 4K. So if your hardware cannot allocate 4K pages within the memory window, then it doesn't support splitting this OB region into 4K pages. But this has nothing to do with alignment AFAIU since epc_features::align is used for IB memory. This 'page_size' argument was introduced for some TI SoC that doesn't handle PAGE_SIZE splitting of OB memory window. Reference: 52c9285d4745 ("PCI: endpoint: Add support for configurable page size") Can you check if your SoC also suffers from the same limitation? If so, then you should modify the commit message to make it clear. - Mani -- மணிவண்ணன் சதாசிவம்