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 32B21C02180 for ; Mon, 13 Jan 2025 23:00:43 +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-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=u630hSWrpEF0CebJbB6DuRMnuHhQEbtm42ncUru71/0=; b=O4xK+WfHIARQGWvcLPO6vnkW+1 rwvel0F1e6DY0v7Lia7/fHXoLYxT/S2eHsH9dGSTgSmShPxyBcKX1o2BSlW5roP+oBTLasU59RWKu Wg9dqkZMikjTulp9MHtJG3NGD0mW3jkJxzDEjcYNPhAg4jJ+2TyZtQKVXp0nmOKHKKt/uk7B6YF9p rzGtYBBMRWuNvAfuZl4iyQc12TrSEQu2NAyULOKV1wN7zw+hxbFJb8JdVYK00uEhksyV0tjbHOaHH jNr5MtZ7vA+hLZsCSH2bZ5+w5aK2+q7djPl8AtB3NLZc1X8K7Tqke4GIMaNEdVzuQsE0Y8fpjtXtn OkMb8MGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tXTQ1-00000006tSb-0qel; Mon, 13 Jan 2025 23:00:25 +0000 Received: from nyc.source.kernel.org ([2604:1380:45d1:ec00::3]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tXTOl-00000006tJh-3ucF for linux-arm-kernel@lists.infradead.org; Mon, 13 Jan 2025 22:59:09 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id CD012A41486; Mon, 13 Jan 2025 22:57:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D9E6C4CED6; Mon, 13 Jan 2025 22:59:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736809146; bh=n1oeyvHgtjf48GNwmyAUR0RM/+tJ12mmaPeKvDNvC7g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BxAXjVFFtgapVMyWqFQYJtaM4MjM0tbw6wKmn+XgfwlbqQ6jPsB+X/SMPGVa2ko9j CklKrIu3MjvLQNtceyTQpyiRkJv73BirjTlPmeuBc0dUXqe5EyoLn8IuztY8Irka68 EiLU31oGONV2tbJERUANVagQ1i/owH2gYY7OJPDFG8PsYBl+BKzxrg2IaA7lYPIcJF e9ITlaxl8E8pdUYxv2Y7knrMKNAllvHOHaYgV+9MqvbSACPYlVNvrmrt1hStGZfFhH 7bajJw04rwyhQ6ewVi5wU9Dwo0XR54KcyfNyRzbnkhLew3N25h1oN/0ENEd61VGpMt F0Hi06lcQsHoA== Date: Mon, 13 Jan 2025 16:59:05 -0600 From: Rob Herring To: Frank Li Cc: Lorenzo Pieralisi , robin.murphy@arm.com, Bjorn Helgaas , Richard Zhu , Lucas Stach , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev, alyssa@rosenzweig.io, bpf@vger.kernel.org, broonie@kernel.org, jgg@ziepe.ca, joro@8bytes.org, lgirdwood@gmail.com, maz@kernel.org, p.zabel@pengutronix.de, will@kernel.org Subject: Re: [PATCH v8 2/2] PCI: imx6: Add IOMMU and ITS MSI support for i.MX95 Message-ID: <20250113225905.GA3325507-robh@kernel.org> References: <20241210-imx95_lut-v8-0-2e730b2e5fde@nxp.com> <20241210-imx95_lut-v8-2-2e730b2e5fde@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250113_145908_097138_6B603842 X-CRM114-Status: GOOD ( 32.37 ) 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 Tue, Jan 07, 2025 at 12:03:39PM -0500, Frank Li wrote: > On Fri, Dec 27, 2024 at 10:58:15AM +0100, Lorenzo Pieralisi wrote: > > On Tue, Dec 17, 2024 at 10:50:22AM -0500, Frank Li wrote: > > > > [...] > > > > > > > > Right. Question: what happens if DT shows that there are SMMU and/or > > > > > > ITS bindings/mappings but the SMMU driver and ITS driver are either not > > > > > > enabled or have not probed ? > > > > > > > > > > It is little bit complex. > > > > > iommu: > > > > > Case 1: > > > > > iommu{ > > > > > status = "disabled" > > > > > }; > > > > > > > > > > PCI driver normal probed. if RID is in range of iommu-map, not > > > > > any functional impact and harmless. > > > > > If RID is out of range of iommu-map, "false alarm" will return. > > > > > enable PCI EP device failure, but actually it can work without IOMMU. > > > > > > > > What does "false alarm" mean in practice ? PCI device enable fails > > > > but actually it should not ? > > > > > > Yes, you are right. It should work without iommu. but return failure for > > > this case. > > > > Rob, Robin, are you OK with this patch DT bindings usage (and the > > related dependencies described in Frank's reply) ? > > > > I am referring to "iommu-map" and "msi-map" usage, everything else > > is platform specific code. > > > > It looks like things can break in multiple ways but I don't want > > to hold up this series forever. > > Rob and Robin: > > Let me simple summary situation. PCIe controler driver need config > "stream id" for each PCI endpoint devices for IOMMU and MSI. > > So add callback for host bridge enable/disable an endpoint devices. > In callback function, call of_map_id("iommu-map" | "msi-map") to get > devices's "stream id" from pci's rid. Then config hardware. > > The limiation is, if smmu/its controller's "status" is disabled > and rid is out of the range of "iommu-map" and "msi-map". Enable device > will be fail although it should be success because "stream id" will not be > used at all at this case. The out of range of "iommu-map" and "msi-map" is > rare. > > dwc common pci driver simple check "msi-map", which should be > another limition and not related this patch. > > In many dwc platform (like qcom) need config "stream id" also. But > that direct parse "iommu-map" and "msi-map" by their drivers, which is not > prefered by Rob now when I try to upstream at v3 > https://lore.kernel.org/imx/20240429150842.GC1709920-robh@kernel.org/ > > Rob: can you help check if this is correct direction? My objection was only parsing the property yourself rather than using existing functions. So it looks fine to me now. Though you might consider if there is something to be shared with QCom driver. Rob