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 AD005CF8544 for ; Wed, 2 Oct 2024 22:25:53 +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: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:References:List-Owner; bh=rxPEF01jRD8Ih5JHCGuJetmKAsRjnnJ0akwXmtEm6Dc=; b=TETR4E71vOhSAKve8LB+9s4fai 261+xndMKGt+qFiuwRDP79SU2y3eAycFtDrrff76q645Z1FSaplkr8rPOzkPYthqGTpsrV9ltBomu cKEBtr0ymdZ3fKkrWCTCdhBlLFXu5XLki9XUt2ZCQinqQyPgt4+U0e6CdlpDVUS28LDlcFcGXkUtK o+sIifm1xwR3YJ4oc7SIBtWzrfOW2IjKV4qRLl3y6+GG2RMVGjpf+9NNdzzsCM5/d25jTH3BGave3 PMAmphhr8cg6NVBNzFtv1Y1nVF08YZmTmQgZ37vikp1UUDKfgtW/iYnh9fVLTMuibxXXr05qhwAgL 4QDkEEaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sw7mz-00000007dmA-13eq; Wed, 02 Oct 2024 22:25:45 +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 1sw7lj-00000007dfZ-0t7y for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2024 22:24:29 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id A6C4CA4404B; Wed, 2 Oct 2024 22:24:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4EF4CC4CEC2; Wed, 2 Oct 2024 22:24:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1727907865; bh=q2Rl77RNB02APr0cNr0BdjJ03UI4MAUtitRmcIrhtt4=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=qhAW0TIS2u8ad7MMxUUsd2UYFbBkRIGVWjLqV5bZkHkYRZt+MLlNhms8GEuTTZjp0 YD/p0vpp1paTTM/pAaPFfRkV98Z4P3ZLyK4rGrHWDTHGJfFh01AVO5WZpkfWnB5zzT gADZxVqdjVqsEhy9SY98GcCFfjsSk0nQZ5arT34uF/GnyYuB6h55Z0J0LLTv6tJBvb sFyJTppcZvSKULtwZBg90NT6ZdJWnf4o/vDDEO5W2T8q/0MLkPo2Clh0jgtue12j4d nc7lCxphw+cwclQYJ6JlfFd/IXEK7AXrkIgd4BHulYXq+3/4n1Ae8tgwmn/D19p52y 6SUR/P/ejDCaw== Date: Wed, 2 Oct 2024 17:24:23 -0500 From: Bjorn Helgaas To: Frank Li Cc: Bjorn Helgaas , Richard Zhu , Lucas Stach , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Manivannan Sadhasivam , Rob Herring , 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, robin.murphy@arm.com, will@kernel.org Subject: Re: [PATCH v2 0/2] PCI: add enabe(disable)_device() hook for bridge Message-ID: <20241002222423.GA282316@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240930-imx95_lut-v2-0-3b6467ba539a@nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241002_152427_399721_D6047325 X-CRM114-Status: GOOD ( 19.41 ) 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, Sep 30, 2024 at 03:42:20PM -0400, Frank Li wrote: > Some system's IOMMU stream(master) ID bits(such as 6bits) less than > pci_device_id (16bit). It needs add hardware configuration to enable > pci_device_id to stream ID convert. > > https://lore.kernel.org/imx/20240622173849.GA1432357@bhelgaas/ > This ways use pcie bus notifier (like apple pci controller), when new PCIe > device added, bus notifier will call register specific callback to handle > look up table (LUT) configuration. > > https://lore.kernel.org/imx/20240429150842.GC1709920-robh@kernel.org/ > which parse dt's 'msi-map' and 'iommu-map' property to static config LUT > table (qcom use this way). This way is rejected by DT maintainer Rob. > > Above ways can resolve LUT take or stream id out of usage the problem. If > there are not enough stream id resource, not error return, EP hardware > still issue DMA to do transfer, which may transfer to wrong possition. > > Add enable(disable)_device() hook for bridge can return error when not > enough resource, and PCI device can't enabled. > > Basicallly this version can match Bjorn's requirement: > 1: simple, because it is rare that there are no LUT resource. > 2: EP driver probe failure when no LUT, but lspci can see such device. > > [ 2.164415] nvme nvme0: pci function 0000:01:00.0 > [ 2.169142] pci 0000:00:00.0: Error enabling bridge (-1), continuing > [ 2.175654] nvme 0000:01:00.0: probe with driver nvme failed with error -12 > > > lspci > 0000:00:00.0 PCI bridge: Philips Semiconductors Device 0000 > 0000:01:00.0 Non-Volatile memory controller: Micron Technology Inc 2100AI NVMe SSD [Nitro] (rev 03) > > To: Bjorn Helgaas > To: Richard Zhu > To: Lucas Stach > To: Lorenzo Pieralisi > To: Krzysztof WilczyƄski > To: Manivannan Sadhasivam > To: Rob Herring > To: Shawn Guo > To: Sascha Hauer > To: Pengutronix Kernel Team > To: Fabio Estevam > Cc: linux-pci@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: imx@lists.linux.dev > Cc: Frank.li@nxp.com \ > Cc: alyssa@rosenzweig.io \ > Cc: bpf@vger.kernel.org \ > Cc: broonie@kernel.org \ > Cc: jgg@ziepe.ca \ > Cc: joro@8bytes.org \ > Cc: l.stach@pengutronix.de \ > Cc: lgirdwood@gmail.com \ > Cc: maz@kernel.org \ > Cc: p.zabel@pengutronix.de \ > Cc: robin.murphy@arm.com \ > Cc: will@kernel.org \ > > Signed-off-by: Frank Li > --- > Changes in v2: > - see each patch > - Link to v1: https://lore.kernel.org/r/20240926-imx95_lut-v1-0-d0c62087dbab@nxp.com > > --- > Frank Li (2): > PCI: Add enable_device() and disable_device() callbacks for bridges > PCI: imx6: Add IOMMU and ITS MSI support for i.MX95 > > drivers/pci/controller/dwc/pci-imx6.c | 133 +++++++++++++++++++++++++++++++++- > drivers/pci/pci.c | 14 ++++ > include/linux/pci.h | 2 + > 3 files changed, 148 insertions(+), 1 deletion(-) > --- > base-commit: 2849622e7b01d5aea1b060ba3955054798c1e0bb > change-id: 20240926-imx95_lut-1c68222e0944 Not sure what this applies to; it doesn't apply cleanly to v6.13-rc1 (the pci/main branch).