All of lore.kernel.org
 help / color / mirror / Atom feed
* PCIPOCALYPSE
@ 2019-11-20  1:28 Oliver O'Halloran
  2019-11-20  1:28 ` [Very RFC 01/46] powerpc/eeh: Don't attempt to restore VF config space after reset Oliver O'Halloran
                   ` (45 more replies)
  0 siblings, 46 replies; 107+ messages in thread
From: Oliver O'Halloran @ 2019-11-20  1:28 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: alistair, s.miroshnichenko

This series does a few things and probably needs to be split into two or
three smaller ones. I figured I'd post it as-is since I'm sick of sitting
on it and some people wanted people to take a look at it. There's three
parts:

1) Reworking EEH to move the "pseudo-generic" into the platform backend.
2) Moving the point where do do PE assignments for PCIe devices out of
   pcibios_setup_bridge() and into pcibios_bus_add_device().
3) Killing the use of pci_dn in powernv entirely.

It used to be a (much) longer series, but bits and pieces of been
upstreamed or at least posted to the list so I've omitted most of the
pre-reqs. Here is a tree you can build based on today's -next with
everything in it:

	https://github.com/oohal/linux/tree/eeh-no-pdn-working

Keep in mind this is all pretty raw and I've tested it on precisely one
P8 PowerNV system. Things not tested:

 -> pseries (not recently anyway)
 -> CAPI
 -> OpenCAPI
 -> Any kind of NVLink

The main TODO is to finish what was started in 2) so that we handle PE
assignments, IOMMU configuration, etc in the same place for each PHB
type. Right now there's three distinct paths:

 1) For normal IODA PHBs (PHB3 and 4) the PE we can assign a device to is
 pinned by the location of it's MMIO BARs. How this is handled depends on
 whether the device is a VF or not, so the two sub cases are:

  a) For normal devices all the devices under a bridge are assigned to a
     PE in a walk done after configuring the bridge window. This causes a
     pile of wierd edge cases when a PCI device is removed without also
     removing it's parent bridge.

  b) For VFs PEs (and MMIO BARs) are assigned when we call sriov_enable() on
     the PF and we "fix up" the software state later on. As a result there's
     some IOMMU group stuff that happens in a bus notifier which runs after
     adding the device to a bus.

 2) For bullshit IODA PHBs (OpenCAPI / NVLink) there is no MMIO pinning
    so we can assign a BDFN to an arbitrary PE. For devices under those
    PEs are assigned in a per-PHB fixup that runs only once at boot,
    just after the the PHB is probed. There doesn't seem to be good
    reason for this and the lack of pinning means we should be able to
    do it whenever.

This series fixes 1a) by moving the PE assignment into
pcibios_bus_add_device(), which is run per-device. With that change
fixing the other two cases should be relatively straight forward. VFs
will probably still require some special casing since their setup
works differently to normal PCI devices, but we should be able to do
better than the current trainwreck of random hacks occuring in random
places.



^ permalink raw reply	[flat|nested] 107+ messages in thread

end of thread, other threads:[~2019-11-27 23:02 UTC | newest]

Thread overview: 107+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20  1:28 PCIPOCALYPSE Oliver O'Halloran
2019-11-20  1:28 ` [Very RFC 01/46] powerpc/eeh: Don't attempt to restore VF config space after reset Oliver O'Halloran
2019-11-21  3:38   ` Alexey Kardashevskiy
2019-11-21  4:34     ` Oliver O'Halloran
2019-11-20  1:28 ` [Very RFC 02/46] powernv/pci: Add helper to find ioda_pe from BDFN Oliver O'Halloran
2019-11-20  1:28 ` [Very RFC 03/46] powernv/pci: Remove dma_dev_setup() for NPU PHBs Oliver O'Halloran
2019-11-21  3:57   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 04/46] powernv/pci: Move dma_{dev|bus}_setup into pci-ioda.c Oliver O'Halloran
2019-11-21  4:02   ` Alexey Kardashevskiy
2019-11-21  4:33     ` Oliver O'Halloran
2019-11-21  7:46   ` Christoph Hellwig
2019-11-20  1:28 ` [Very RFC 05/46] powernv/pci: Remove the pnv_phb dma_dev_setup callback Oliver O'Halloran
2019-11-21  4:03   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 06/46] powerpc/iov: Move VF pdev fixup into pcibios_fixup_iov() Oliver O'Halloran
2019-11-21  4:34   ` Alexey Kardashevskiy
2019-11-25  4:41     ` Oliver O'Halloran
2019-11-21  7:48   ` Christoph Hellwig
2019-11-25  4:39     ` Oliver O'Halloran
2019-11-20  1:28 ` [Very RFC 07/46] powernv/pci: Rework IODA PE device accounting Oliver O'Halloran
2019-11-21  5:48   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 08/46] powerpc/eeh: Calculate VF index rather than looking it up in pci_dn Oliver O'Halloran
2019-11-22  4:43   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 09/46] powerpc/eeh: Pass eeh_dev to eeh_ops->{read|write}_config() Oliver O'Halloran
2019-11-22  4:52   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 10/46] powerpc/eeh: Pass eeh_dev to eeh_ops->restore_config() Oliver O'Halloran
2019-11-20  1:28 ` [Very RFC 11/46] powerpc/eeh: Convert various printfs to use edev, not pci_dn Oliver O'Halloran
2019-11-22  4:55   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 12/46] powerpc/eeh: Split eeh_probe into probe_pdn and probe_pdev Oliver O'Halloran
2019-11-22  5:45   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 13/46] powerpc/eeh: Rework how pdev_probe() is used Oliver O'Halloran
2019-11-20  1:28 ` [Very RFC 14/46] powernv/eeh: Remove un-necessary call to eeh_add_device_early() Oliver O'Halloran
2019-11-22  6:01   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 15/46] powernv/eeh: Use pnv_eeh_*_config() for internal config ops Oliver O'Halloran
2019-11-22  6:15   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 16/46] powernv/eeh: Use eeh_edev_warn() rather than open-coding a BDFN print Oliver O'Halloran
2019-11-22  6:17   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 17/46] powernv/eeh: add pnv_eeh_find_edev() Oliver O'Halloran
2019-11-25  0:30   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 18/46] powernv/pci: Add pci_bus_to_pnvhb() helper Oliver O'Halloran
2019-11-25  0:42   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 19/46] powernv/eeh: Use standard PCI capability lookup functions Oliver O'Halloran
2019-11-25  1:02   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 20/46] powernv/eeh: Look up device info from pci_dev Oliver O'Halloran
2019-11-25  1:26   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 21/46] powernv/eeh: Rework finding an existing edev in probe_pdev() Oliver O'Halloran
2019-11-25  3:20   ` Alexey Kardashevskiy
2019-11-25  4:17     ` Oliver O'Halloran
2019-11-20  1:28 ` [Very RFC 22/46] powernv/eeh: Allocate eeh_dev's when needed Oliver O'Halloran
2019-11-25  3:27   ` Alexey Kardashevskiy
2019-11-25  4:26     ` Oliver O'Halloran
2019-11-27  1:50       ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 23/46] powerpc/eeh: Moving finding the parent PE into the platform Oliver O'Halloran
2019-11-25  5:00   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 24/46] powernv/pci: Make the pre-cfg EEH freeze check use eeh_dev rather than pci_dn Oliver O'Halloran
2019-11-27  0:21   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 25/46] powernv/pci: Remove pdn from pnv_pci_config_check_eeh() Oliver O'Halloran
2019-11-27  1:05   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 26/46] powernv/pci: Remove pdn from pnv_pci_cfg_{read|write} Oliver O'Halloran
2019-11-27  2:16   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 27/46] powernv/pci: Clear reserved PE freezes Oliver O'Halloran
2019-11-27  3:00   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 28/46] powernv/iov: Move SR-IOV PF state out of pci_dn Oliver O'Halloran
2019-11-27  4:09   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 29/46] powernv/pci: Remove open-coded PE lookup in PELT-V setup Oliver O'Halloran
2019-11-27  4:26   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 30/46] powernv/pci: Remove open-coded PE lookup in PELT-V teardown Oliver O'Halloran
2019-11-27  4:50   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 31/46] powernv/pci: Remove open-coded PE lookup in pnv_pci_ioda_dma_dev_setup() Oliver O'Halloran
2019-11-21  7:52   ` Christoph Hellwig
2019-11-27  4:53   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 32/46] powernv/pci: Remove open-coded PE lookup in iommu_bypass_supported() Oliver O'Halloran
2019-11-27  5:09   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 33/46] powernv/pci: Remove open-coded PE lookup in iommu notifier Oliver O'Halloran
2019-11-27  5:09   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 34/46] powernv/pci: Remove open-coded PE lookup in pnv_pci_enable_device_hook() Oliver O'Halloran
2019-11-27  5:14   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 35/46] powernv/pci: Remove open-coded PE lookup in pnv_pci_release_device Oliver O'Halloran
2019-11-27  5:24   ` Alexey Kardashevskiy
2019-11-27  9:51     ` Oliver O'Halloran
2019-11-20  1:28 ` [Very RFC 36/46] powernv/npu: Remove open-coded PE lookup for GPU device Oliver O'Halloran
2019-11-27  5:45   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 37/46] powernv/pci: Use the PHB's rmap for pnv_ioda_to_pe() Oliver O'Halloran
2019-11-21  3:50   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 38/46] powerpc/pci-hotplug: Scan the whole bus when using PCI_PROBE_NORMAL Oliver O'Halloran
2019-11-27  6:27   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 39/46] powernv/npu: Avoid pci_dn when mapping device_node to a pci_dev Oliver O'Halloran
2019-11-27  6:58   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 40/46] powernv/npu: Don't drop refcount when looking up GPU pci_devs Oliver O'Halloran
2019-11-27  7:09   ` Alexey Kardashevskiy
2019-11-27  8:24     ` Greg Kurz
2019-11-27  9:10       ` Frederic Barrat
2019-11-27  9:33         ` Greg Kurz
2019-11-27  9:40           ` Oliver O'Halloran
2019-11-27 12:00             ` Greg Kurz
2019-11-27  9:47           ` Frederic Barrat
2019-11-27 12:03             ` Greg Kurz
2019-11-20  1:28 ` [Very RFC 41/46] powernv/eeh: Remove pdn setup for SR-IOV VFs Oliver O'Halloran
2019-11-27  7:14   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 42/46] powernv/pci: Don't clear pdn->pe_number in pnv_pci_release_device Oliver O'Halloran
2019-11-27  7:30   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 43/46] powernv/pci: Do not set pdn->pe_number for NPU/CAPI devices Oliver O'Halloran
2019-11-27 22:49   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 44/46] powerpc/pci: Don't set pdn->pe_number when applying the weird P8 NVLink PE hack Oliver O'Halloran
2019-11-27 22:54   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 45/46] powernv/pci: Remove requirement for a pdn in config accessors Oliver O'Halloran
2019-11-27 23:00   ` Alexey Kardashevskiy
2019-11-20  1:28 ` [Very RFC 46/46] HACK: prevent pdn's from being created Oliver O'Halloran

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.