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@xxxxxxxxxx/ > 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 <bhelgaas@xxxxxxxxxx> > To: Richard Zhu <hongxing.zhu@xxxxxxx> > To: Lucas Stach <l.stach@xxxxxxxxxxxxxx> > To: Lorenzo Pieralisi <lpieralisi@xxxxxxxxxx> > To: Krzysztof Wilczyński <kw@xxxxxxxxx> > To: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx> > To: Rob Herring <robh@xxxxxxxxxx> > To: Shawn Guo <shawnguo@xxxxxxxxxx> > To: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> > To: Pengutronix Kernel Team <kernel@xxxxxxxxxxxxxx> > To: Fabio Estevam <festevam@xxxxxxxxx> > Cc: linux-pci@xxxxxxxxxxxxxxx > Cc: linux-kernel@xxxxxxxxxxxxxxx > Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx > Cc: imx@xxxxxxxxxxxxxxx > Cc: Frank.li@xxxxxxx \ > Cc: alyssa@xxxxxxxxxxxxx \ > Cc: bpf@xxxxxxxxxxxxxxx \ > Cc: broonie@xxxxxxxxxx \ > Cc: jgg@xxxxxxxx \ > Cc: joro@xxxxxxxxxx \ > Cc: l.stach@xxxxxxxxxxxxxx \ > Cc: lgirdwood@xxxxxxxxx \ > Cc: maz@xxxxxxxxxx \ > Cc: p.zabel@xxxxxxxxxxxxxx \ > Cc: robin.murphy@xxxxxxx \ > Cc: will@xxxxxxxxxx \ > > Signed-off-by: Frank Li <Frank.Li@xxxxxxx> > --- > Changes in v2: > - see each patch > - Link to v1: https://lore.kernel.org/r/20240926-imx95_lut-v1-0-d0c62087dbab@xxxxxxx > > --- > 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).