EEH init cleanup

2020-02-03 Thread Oliver O'Halloran
This series reworks how EEH devices are initialised. This mainly affects pseries since it moves the "early" EEH probe out of shared code and into pseries platform code. The goal here is to make the platform dependencies more explicit and to allow PowerNV to implement its own pci_dev <-> eeh_dev

Re: [PATCH 2/2] pseries/makefile: Remove CONFIG_PPC_PSERIES check

2020-01-29 Thread Oliver O'Halloran
On Thu, Jan 30, 2020 at 5:32 PM Oliver O'Halloran wrote: > > The platform makefile (arch/powerpc/platforms/pseries/Makefile) is only doh s/platform/pseries/ > included by the platform makefile (arch/powerpc/platform/Makefile) when > CONFIG_PPC_PSERIES is selected,

[PATCH 1/2] pseries/vio: Remove stray #ifdef CONFIG_PPC_PSERIES

2020-01-29 Thread Oliver O'Halloran
vio.c requires CONFIG_IBMVIO which in turn depends on PPC_PSERIES. In other words, this ifdef is pointless. At a guess it's a carry-over from pre-history. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/pseries/vio.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc

[PATCH 2/2] pseries/makefile: Remove CONFIG_PPC_PSERIES check

2020-01-29 Thread Oliver O'Halloran
The platform makefile (arch/powerpc/platforms/pseries/Makefile) is only included by the platform makefile (arch/powerpc/platform/Makefile) when CONFIG_PPC_PSERIES is selected, so checking for CONFIG_PPC_PSERIES in the pseries makefile is pointless. Signed-off-by: Oliver O'Halloran --- arch

[PATCH] selftests/eeh: Bump EEH wait time to 60s

2020-01-21 Thread Oliver O'Halloran
to be specified via an environmental variable (EEH_MAX_WAIT). Reported-by: Steve Best Suggested-by: Douglas Miller Signed-off-by: Oliver O'Halloran --- tools/testing/selftests/powerpc/eeh/eeh-functions.sh | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests

Re: [PATCH 7/9] powerpc/configs/skiroot: Enable security features

2020-01-15 Thread Oliver O'Halloran
On Thu, Jan 16, 2020 at 4:00 PM Daniel Axtens wrote: > > Michael Ellerman writes: > > > From: Joel Stanley > > > > This turns on HARDENED_USERCOPY with HARDENED_USERCOPY_PAGESPAN, and > > FORTIFY_SOURCE. > > > > It also enables SECURITY_LOCKDOWN_LSM with _EARLY and > >

[PATCH 5/5] powernv/pci: Move pnv_pci_dma_bus_setup() to pci-ioda.c

2020-01-09 Thread Oliver O'Halloran
This is only used in pci-ioda.c so move it there and rename it to match. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 22 +- arch/powerpc/platforms/powernv/pci.c | 20 arch/powerpc/platforms/powernv/pci.h

[PATCH 4/5] powernv/pci: Fold pnv_pci_dma_dev_setup() into the pci-ioda.c version

2020-01-09 Thread Oliver O'Halloran
pnv_pci_dma_dev_setup() does nothing but call the phb->dma_dev_setup() callback, if one exists. That callback is only set for normal PCIe PHBs so we can remove the layer of indirection and use the ioda version in the pci_controller_ops. Signed-off-by: Oliver O'Halloran --- arch/powe

[PATCH 3/5] powerpc/iov: Move VF pdev fixup into pcibios_fixup_iov()

2020-01-09 Thread Oliver O'Halloran
dev_setup(). Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 29 + arch/powerpc/platforms/powernv/pci.c | 14 -- 2 files changed, 25 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.

[PATCH 2/5] powernv/pci: Remove dma_dev_setup() for NPU PHBs

2020-01-09 Thread Oliver O'Halloran
The pnv_pci_dma_dev_setup() only does something when: 1) There PHB contains VFs, or 2) The PHB defines a dma_dev_setup() callback in the pnv_phb structure. Neither is true for NPU PHBs so there's no reason to set the callback. Reviewed-by: Alexey Kardashevskiy Signed-off-by: Oliver O'Halloran

[PATCH 1/5] powerpc/pci: Fold pcibios_setup_device() into pcibios_bus_add_device()

2020-01-09 Thread Oliver O'Halloran
pcibios_bus_add_device() is the only caller of pcibios_setup_device(). Fold them together since there's no real reason to keep them separate. Signed-off-by: Oliver O'Halloran --- arch/powerpc/kernel/pci-common.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/arch

Minor PCI & DMA init cleanups

2020-01-09 Thread Oliver O'Halloran
Pulled out of my big series since these are fairly standalone changes The series folds some single-use functions together and shovels around some code so it lives in a more sensible location. No functional changes.

Re: [PATCH 04/14] powerpc/vas: Setup IRQ mapping and register port for each window

2019-12-17 Thread Oliver O'Halloran
On Wed, Nov 27, 2019 at 12:07 PM Haren Myneni wrote: > > *snip* > > @@ -36,7 +62,18 @@ static int init_vas_instance(struct platform_device *pdev) > return -ENODEV; > } > > - if (pdev->num_resources != 4) { > + rc = of_property_read_u64(dn, "ibm,vas-port", ); >

Re: [PATCH] powerpc/mm: Remove kvm radix prefetch workaround for Power9 DD2.2

2019-12-03 Thread Oliver O'Halloran
On Mon, Dec 2, 2019 at 2:08 PM Jordan Niethe wrote: > > Commit a25bd72badfa ("powerpc/mm/radix: Workaround prefetch issue with > KVM") introduced a number of workarounds as coming out of a guest with > the mmu enabled would make the cpu would start running in hypervisor > state with the PID value

Re: [Very RFC 35/46] powernv/pci: Remove open-coded PE lookup in pnv_pci_release_device

2019-11-27 Thread Oliver O'Halloran
On Wed, Nov 27, 2019 at 4:24 PM Alexey Kardashevskiy wrote: > > > > On 20/11/2019 12:28, Oliver O'Halloran wrote: > > Signed-off-by: Oliver O'Halloran > > --- > > arch/powerpc/platforms/powernv/pci-ioda.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 de

Re: [Very RFC 40/46] powernv/npu: Don't drop refcount when looking up GPU pci_devs

2019-11-27 Thread Oliver O'Halloran
On Wed, Nov 27, 2019 at 8:34 PM Greg Kurz wrote: > > > If everyone is ok with leaking a reference in the NPU case, I guess > this isn't a problem. But if we move forward with Oliver's patch, a > pci_dev_put() would be needed for OpenCAPI, correct ? Yes, but I think that's fair enough. By

Re: [Very RFC 06/46] powerpc/iov: Move VF pdev fixup into pcibios_fixup_iov()

2019-11-24 Thread Oliver O'Halloran
On Thu, Nov 21, 2019 at 3:34 PM Alexey Kardashevskiy wrote: > > > > On 20/11/2019 12:28, Oliver O'Halloran wrote: > > Move this out of the PHB's dma_dev_setup() callback and into the > > ppc_md.pcibios_fixup_iov callback. This ensures that the VF PE's > >

Re: [Very RFC 06/46] powerpc/iov: Move VF pdev fixup into pcibios_fixup_iov()

2019-11-24 Thread Oliver O'Halloran
On Thu, Nov 21, 2019 at 6:48 PM Christoph Hellwig wrote: > > On Wed, Nov 20, 2019 at 12:28:19PM +1100, Oliver O'Halloran wrote: > > Move this out of the PHB's dma_dev_setup() callback and into the > > ppc_md.pcibios_fixup_iov callback. This ensures that the VF PE's > >

Re: [Very RFC 22/46] powernv/eeh: Allocate eeh_dev's when needed

2019-11-24 Thread Oliver O'Halloran
On Mon, Nov 25, 2019 at 2:27 PM Alexey Kardashevskiy wrote: > > > > On 20/11/2019 12:28, Oliver O'Halloran wrote: > > Have the PowerNV EEH backend allocate the eeh_dev if needed rather than > > using > > the one attached to the pci_dn. > > So that pci_dn

Re: [Very RFC 21/46] powernv/eeh: Rework finding an existing edev in probe_pdev()

2019-11-24 Thread Oliver O'Halloran
On Mon, Nov 25, 2019 at 2:20 PM Alexey Kardashevskiy wrote: > > > > On 20/11/2019 12:28, Oliver O'Halloran wrote: > > Use the pnv_eeh_find_edev() helper to look up the eeh_dev for a device > > rather than doing it via the pci_dn. > > This is not what the patc

Re: [Very RFC 01/46] powerpc/eeh: Don't attempt to restore VF config space after reset

2019-11-20 Thread Oliver O'Halloran
On Thu, Nov 21, 2019 at 2:38 PM Alexey Kardashevskiy wrote: > > > > On 20/11/2019 12:28, Oliver O'Halloran wrote: > > After resetting a VF we call eeh_restore_vf_config() to restore several > > registers in the VFs config space. For physical functions this

Re: [Very RFC 04/46] powernv/pci: Move dma_{dev|bus}_setup into pci-ioda.c

2019-11-20 Thread Oliver O'Halloran
On Thu, Nov 21, 2019 at 3:02 PM Alexey Kardashevskiy wrote: > > > > On 20/11/2019 12:28, Oliver O'Halloran wrote: > > These functions are only used from pci-ioda.c. Move them in there and remove > > the prototypes from the header files. > > > Make them static th

[Very RFC 46/46] HACK: prevent pdn's from being created

2019-11-19 Thread Oliver O'Halloran
Not-Signed-off-by: Oliver O'Halloran --- arch/powerpc/kernel/pci_dn.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index f790a8d06f50..0e05c1d7633a 100644 --- a/arch/powerpc/kernel/pci_dn.c +++ b/arch/powerpc/kernel/pci_dn.c

[Very RFC 45/46] powernv/pci: Remove requirement for a pdn in config accessors

2019-11-19 Thread Oliver O'Halloran
:toot: Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 0eeea8652426..6383dcfec606 100644 --- a/arch/powerpc/platforms

[Very RFC 44/46] powerpc/pci: Don't set pdn->pe_number when applying the weird P8 NVLink PE hack

2019-11-19 Thread Oliver O'Halloran
P8 needs to shove four GPUs into three PEs for $reasons. Remove the pdn->pe_assignment done there since we just use the pe_rmap[] now. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/a

[Very RFC 43/46] powernv/pci: Do not set pdn->pe_number for NPU/CAPI devices

2019-11-19 Thread Oliver O'Halloran
The only thing we need the pdn for in this function is setting the pe_number field, which we don't use anymore. Fix the weird refcounting behaviour while we're here. Signed-off-by: Oliver O'Halloran --- Either Fred, or Reza also fixed this in some patch lately and that'll probably get merged

[Very RFC 42/46] powernv/pci: Don't clear pdn->pe_number in pnv_pci_release_device

2019-11-19 Thread Oliver O'Halloran
Nothing looks at it anymore. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 12 1 file changed, 12 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index d3e375d71cdc..45d940730c30

[Very RFC 41/46] powernv/eeh: Remove pdn setup for SR-IOV VFs

2019-11-19 Thread Oliver O'Halloran
We don't need a pci_dn for the VF any more, so we can skip adding them. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 16 1 file changed, 16 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv

[Very RFC 40/46] powernv/npu: Don't drop refcount when looking up GPU pci_devs

2019-11-19 Thread Oliver O'Halloran
from being called. In other words, the desired behaviour here appears to be leaking a ref. Nice! Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/npu-dma.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/platforms/powernv/npu-dma.c

[Very RFC 39/46] powernv/npu: Avoid pci_dn when mapping device_node to a pci_dev

2019-11-19 Thread Oliver O'Halloran
There's no need to use the pci_dn to find a device_node from a pci_dev. Just search for the node pointed to by the pci_dev's of_node pointer. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/npu-dma.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[Very RFC 38/46] powerpc/pci-hotplug: Scan the whole bus when using PCI_PROBE_NORMAL

2019-11-19 Thread Oliver O'Halloran
environment the first downstream child will be at devfn 00.0. In any case it's completely broken when no pci_dn is available. Remove the PCI_DN checking and scan each of the device number that might be on the downstream bus. Cc: Benjamin Herrenschmidt Signed-off-by: Oliver O'Halloran --- I'm not sure we

[Very RFC 37/46] powernv/pci: Use the PHB's rmap for pnv_ioda_to_pe()

2019-11-19 Thread Oliver O'Halloran
ing a DMA so this gets us a bit closer to the model used by the HW, which is comprensible by mortals, rather than... whatever the hell is going on currently. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) d

[Very RFC 36/46] powernv/npu: Remove open-coded PE lookup for GPU device

2019-11-19 Thread Oliver O'Halloran
Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/npu-dma.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c index b95b9e3c4c98..68bfaef44862 100644 --- a/arch

[Very RFC 35/46] powernv/pci: Remove open-coded PE lookup in pnv_pci_release_device

2019-11-19 Thread Oliver O'Halloran
Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 4f38652c7cd7..8525642b1256 100644 --- a/arch

[Very RFC 34/46] powernv/pci: Remove open-coded PE lookup in pnv_pci_enable_device_hook()

2019-11-19 Thread Oliver O'Halloran
Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 7e88de18ead6..4f38652c7cd7 100644 --- a/arch

[Very RFC 33/46] powernv/pci: Remove open-coded PE lookup in iommu notifier

2019-11-19 Thread Oliver O'Halloran
Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 5b1f4677cdce..0eeea8652426 100644 --- a/arch/powerpc/platforms

[Very RFC 32/46] powernv/pci: Remove open-coded PE lookup in iommu_bypass_supported()

2019-11-19 Thread Oliver O'Halloran
Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 98d858999a2d..7e88de18ead6 100644 --- a/arch

[Very RFC 31/46] powernv/pci: Remove open-coded PE lookup in pnv_pci_ioda_dma_dev_setup()

2019-11-19 Thread Oliver O'Halloran
Use the helper to look up the pnv_ioda_pe for the device we're configuring DMA for. In the VF case there's no need set pdn->pe_number since nothing looks at it any more. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 3 +-- 1 file changed, 1 insertion(+)

[Very RFC 30/46] powernv/pci: Remove open-coded PE lookup in PELT-V teardown

2019-11-19 Thread Oliver O'Halloran
Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 5bd7c1b058da..d4b5ee926222 100644

[Very RFC 29/46] powernv/pci: Remove open-coded PE lookup in PELT-V setup

2019-11-19 Thread Oliver O'Halloran
Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 32 +-- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 1c90feed233d..5bd7c1b058da

[Very RFC 28/46] powernv/iov: Move SR-IOV PF state out of pci_dn

2019-11-19 Thread Oliver O'Halloran
specific structure helps to clarify the role of pci_dn and ensures that the platform specifics stay that way. This will make the code easier to understand and modify since we don't need to so much aboute PowerNV changes breaking pseries and EEH, and vis-a-vis. Signed-off-by: Oliver O'Halloran --- TODO

[Very RFC 27/46] powernv/pci: Clear reserved PE freezes

2019-11-19 Thread Oliver O'Halloran
-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci.c | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 36eea4bb514c..5b1f4677cdce 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b

[Very RFC 26/46] powernv/pci: Remove pdn from pnv_pci_cfg_{read|write}

2019-11-19 Thread Oliver O'Halloran
Remove the use of pci_dn from the low-level config space access functions. These are used by the eeh's config ops and the bus config ops that we provide to the PCI core. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/eeh-powernv.c | 14 +++ arch/powerpc/platforms

[Very RFC 25/46] powernv/pci: Remove pdn from pnv_pci_config_check_eeh()

2019-11-19 Thread Oliver O'Halloran
Despite the name this function is generic PowerNV PCI code rather than anything EEH specific. Convert to take a phb and bdfn rather than a pci_dn. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci.c | 32 ++-- 1 file changed, 21 insertions(+), 11

[Very RFC 24/46] powernv/pci: Make the pre-cfg EEH freeze check use eeh_dev rather than pci_dn

2019-11-19 Thread Oliver O'Halloran
Squash another usage in preperation for making the config accessors pci_dn. Signed-off-by: Oliver O'Halloran --- We might want to move this into eeh-powernv.c --- arch/powerpc/platforms/powernv/pci.c | 37 +--- 1 file changed, 17 insertions(+), 20 deletions(-) diff

[Very RFC 23/46] powerpc/eeh: Moving finding the parent PE into the platform

2019-11-19 Thread Oliver O'Halloran
lookup method moves into the pseries platform and PowerNV can choose the PE based on the bus heirachy instead. Signed-off-by: Oliver O'Halloran --- "parent" meaning "parent of the PE that actually contains this edev" is stupid, but it's stupid consistent with what's there alre

[Very RFC 22/46] powernv/eeh: Allocate eeh_dev's when needed

2019-11-19 Thread Oliver O'Halloran
Have the PowerNV EEH backend allocate the eeh_dev if needed rather than using the one attached to the pci_dn. This gets us most of the way towards decoupling pci_dn from the PowerNV EEH code. Signed-off-by: Oliver O'Halloran --- We should probably be free()ing the eeh_dev somewhere. The pci_dev

[Very RFC 21/46] powernv/eeh: Rework finding an existing edev in probe_pdev()

2019-11-19 Thread Oliver O'Halloran
Use the pnv_eeh_find_edev() helper to look up the eeh_dev for a device rather than doing it via the pci_dn. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/eeh-powernv.c | 44 ++-- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/arch/powerpc

[Very RFC 20/46] powernv/eeh: Look up device info from pci_dev

2019-11-19 Thread Oliver O'Halloran
Most of what we fetch from the pci_dn is also in the pci_dev structure. Convert the pnv_eeh_probe_pdev() to use the pdev fields rather than the pci_dn so we can get rid of pci_dn eventually. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/eeh-powernv.c | 26

[Very RFC 19/46] powernv/eeh: Use standard PCI capability lookup functions

2019-11-19 Thread Oliver O'Halloran
a problem if an EEH event occured while probing the device, but I'm pretty sure that's going to be broken anyway. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/eeh-powernv.c | 67 ++-- 1 file changed, 4 insertions(+), 63 deletions(-) diff --git a/arch/powerpc

[Very RFC 18/46] powernv/pci: Add pci_bus_to_pnvhb() helper

2019-11-19 Thread Oliver O'Halloran
roller inside the function. This is hard to read since it requires you to memorise the contents of the private data fields and kind of error prone since it involves blindly assigning a void pointer. Add a helper to make it more concise and explict. Signed-off-by: Oliver O'Halloran --- arch/p

[Very RFC 17/46] powernv/eeh: add pnv_eeh_find_edev()

2019-11-19 Thread Oliver O'Halloran
"traverse the pdn tree" method? Probably not. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/eeh-powernv.c | 31 arch/powerpc/platforms/powernv/pci.h | 2 ++ 2 files changed, 33 insertions(+) diff --git a/arch/powerpc/platforms/powernv/eeh

[Very RFC 16/46] powernv/eeh: Use eeh_edev_warn() rather than open-coding a BDFN print

2019-11-19 Thread Oliver O'Halloran
Neaten things up a bit and remove a pci_dn use. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/eeh-powernv.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh

[Very RFC 15/46] powernv/eeh: Use pnv_eeh_*_config() for internal config ops

2019-11-19 Thread Oliver O'Halloran
Use the pnv_eeh_{read|write}_config() functions that take an edev rather than a pci_dn. This allows us to remove most of the explict uses of pci_dn in the PowerNV EEH backend and localises them into a few functions which we can fix later. Signed-off-by: Oliver O'Halloran --- arch/powerpc

[Very RFC 14/46] powernv/eeh: Remove un-necessary call to eeh_add_device_early()

2019-11-19 Thread Oliver O'Halloran
another pci_dn usage. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/eeh-powernv.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/powernv/eeh-powernv.c b/arch/powerpc/platforms/powernv/eeh-powernv.c index 5250c4525544

[Very RFC 13/46] powerpc/eeh: Rework how pdev_probe() is used

2019-11-19 Thread Oliver O'Halloran
rom using pci_dn on PowerNV and moving the eeh_dev lookup into probe_pdev() allows the EEH core to be oblivious of how the mapping is actually done. Signed-off-by: Oliver O'Halloran --- arch/powerpc/include/asm/eeh.h | 16 +++-- arch/powerpc/kernel/eeh.c|

[Very RFC 12/46] powerpc/eeh: Split eeh_probe into probe_pdn and probe_pdev

2019-11-19 Thread Oliver O'Halloran
ions always return NULL so there's not much point to it. Signed-off-by: Oliver O'Halloran --- arch/powerpc/include/asm/eeh.h | 3 +- arch/powerpc/kernel/eeh.c| 6 ++-- arch/powerpc/platforms/powernv/eeh-powernv.c | 29 ++-- arch/powerpc/platf

[Very RFC 11/46] powerpc/eeh: Convert various printfs to use edev, not pci_dn

2019-11-19 Thread Oliver O'Halloran
We use the pci_dn to retrieve the domain, bus, device, and function numbers for an EEH device. We now have that in the eeh_dev so covert the various printk()s we have around the place to source that information from the eeh_dev. Signed-off-by: Oliver O'Halloran --- arch/powerpc/kernel/eeh.c

[Very RFC 10/46] powerpc/eeh: Pass eeh_dev to eeh_ops->restore_config()

2019-11-19 Thread Oliver O'Halloran
Remove another pdn usage. Signed-off-by: Oliver O'Halloran --- arch/powerpc/include/asm/eeh.h | 2 +- arch/powerpc/kernel/eeh.c| 5 ++--- arch/powerpc/kernel/eeh_pe.c | 6 ++ arch/powerpc/platforms/powernv/eeh-powernv.c | 11

[Very RFC 09/46] powerpc/eeh: Pass eeh_dev to eeh_ops->{read|write}_config()

2019-11-19 Thread Oliver O'Halloran
Switch the eeh_ops->{read|write}_config methods to take an eeh_dev structure rather than a pci_dn structure to specify the target device. This removes a lot of the uses of pci_dn in both the EEH core and in the platform EEH support. Signed-off-by: Oliver O'Halloran --- arch/powerpc/include/

[Very RFC 08/46] powerpc/eeh: Calculate VF index rather than looking it up in pci_dn

2019-11-19 Thread Oliver O'Halloran
to remove a VF are slightly different to those which remove a physical PCI device. Signed-off-by: Oliver O'Halloran --- arch/powerpc/kernel/eeh_driver.c | 44 +++- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch

[Very RFC 07/46] powernv/pci: Rework IODA PE device accounting

2019-11-19 Thread Oliver O'Halloran
we have some symmetry between the setup and teardown paths. Moving the PE assignments to here should also allow us to converge how PE assignment works on all PHB types so it's always done in one place. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c |

[Very RFC 06/46] powerpc/iov: Move VF pdev fixup into pcibios_fixup_iov()

2019-11-19 Thread Oliver O'Halloran
the fixup and it makes dma_dev_setup a bit simpler. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 35 +++ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv

[Very RFC 05/46] powernv/pci: Remove the pnv_phb dma_dev_setup callback

2019-11-19 Thread Oliver O'Halloran
This is only ever set for IODA PHBs. The only call site is in pnv_pci_dma_dev_setup(), which is also only used by normal IODA PHBs, so remove the callback in favour of a direct call. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 4 +--- arch/powerpc/platforms

[Very RFC 04/46] powernv/pci: Move dma_{dev|bus}_setup into pci-ioda.c

2019-11-19 Thread Oliver O'Halloran
These functions are only used from pci-ioda.c. Move them in there and remove the prototypes from the header files. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 43 +++ arch/powerpc/platforms/powernv/pci.c | 43

[Very RFC 03/46] powernv/pci: Remove dma_dev_setup() for NPU PHBs

2019-11-19 Thread Oliver O'Halloran
The pnv_pci_dma_dev_setup() only does something when: 1) There PHB contains VFs, or 2) The PHB defines a dma_dev_setup() callback in the pnv_phb structure. Neither is true for NPU PHBs, so don't set the callback in the pci_controller_ops. Signed-off-by: Oliver O'Halloran --- arch/powerpc

[Very RFC 02/46] powernv/pci: Add helper to find ioda_pe from BDFN

2019-11-19 Thread Oliver O'Halloran
ed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/pci-ioda.c | 10 ++ arch/powerpc/platforms/powernv/pci.h | 1 + 2 files changed, 11 insertions(+) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index fdacf9

[Very RFC 01/46] powerpc/eeh: Don't attempt to restore VF config space after reset

2019-11-19 Thread Oliver O'Halloran
ing useful cleanups. Signed-off-by: Oliver O'Halloran --- arch/powerpc/kernel/eeh.c| 59 arch/powerpc/platforms/powernv/eeh-powernv.c | 39 +++-- arch/powerpc/platforms/pseries/eeh_pseries.c | 26 + 3 files changed, 8 insertions(+), 116 deletion

PCIPOCALYPSE

2019-11-19 Thread Oliver O'Halloran
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

Re: [PATCH 02/11] powerpc/powernv/ioda: Protect PE list

2019-11-19 Thread Oliver O'Halloran
On Tue, Nov 19, 2019 at 11:57 PM Frederic Barrat wrote: > > > Do the other accessors of ioda.pe_list also need mutex protection? > > pnv_ioda_setup_bus_PE() > > pnv_pci_dma_bus_setup() > > pnv_pci_init_ioda_phb() > > pnv_pci_ioda_setup_PEs() > > > I think we could also use it there, it wouldn't

[PATCH v2] powerpc/powernv: Disable native PCIe port management

2019-11-17 Thread Oliver O'Halloran
es drivers that is: AER, PME, BW notifications, hotplug, and DPC. However, this is not a huge disadvantage on PowerNV since these services are either unused or handled through other means. Cc: Sergey Miroshnichenko Fixes: 66725152fb9f ("PCI/hotplug: PowerPC PowerNV PCI hotplug driver") S

Re: [PATCH 01/11] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2019-11-17 Thread Oliver O'Halloran
On Mon, Nov 18, 2019 at 12:06 PM Alistair Popple wrote: > > On Wednesday, 13 November 2019 4:38:21 AM AEDT Frederic Barrat wrote: > > > > However, one question is whether this patch breaks nvlink and if nvlink > > assumes the devices won’t go away because we explicitly take a reference > >

Re: [PATCH] powerpc/powernv: Disable native PCIe port management

2019-11-14 Thread Oliver O'Halloran
On Thu, Nov 14, 2019 at 7:39 AM Tyrel Datwyler wrote: > > Nothing but pedantic spelling and grammar nits of the commit log follow. > > -Tyrel Thanks. My speeling is bad even on a good day and it was not a good day.

Re: [PATCH] powerpc/powernv: Disable native PCIe port management

2019-11-14 Thread Oliver O'Halloran
On Thu, Nov 14, 2019 at 1:31 AM Bjorn Helgaas wrote: > > This is fine, but it feels like sort of a blunt instrument. Is there > any practical way to clear pci_host_bridge.native_pcie_hotplug (and > native_aer if appropriate) for the PHBs in question? That would also > prevent pciehp from

Re: [PATCH] powerpc/perf: Disable trace_imc pmu

2019-11-13 Thread Oliver O'Halloran
On Thu, Nov 14, 2019 at 6:19 PM Madhavan Srinivasan wrote: > > When a root user or a user with CAP_SYS_ADMIN > privilege use trace_imc performance monitoring > unit events, to monitor application or KVM threads, > may result in a checkstop (System crash). Reason > being frequent switch of the

[PATCH] powerpc/powernv: Disable native PCIe port management

2019-11-13 Thread Oliver O'Halloran
these problems by setting the "pcie_ports_disabled" flag during platform initialisation. The flag indicates the platform owns the PCIe ports which stops the portbus driver being registered. Cc: Sergey Miroshnichenko Fixes: 66725152fb9f ("PCI/hotplug: PowerPC PowerNV PCI hotplug driver") S

Re: [PATCH RFC 02/15] powerpc/eeh: Rename eeh_pe_get() to eeh_pe_find()

2019-11-12 Thread Oliver O'Halloran
eeh_pe_get() to eeh_pe_find() > because it performs a search. > > Signed-off-by: Sam Bobroff Good idea. Reviewed-by: Oliver O'Halloran

Re: PROBLEM: PCIe Bus Error atleast

2019-11-03 Thread Oliver O'Halloran
On Sat, Nov 2, 2019 at 5:46 AM Jeffrin Thalakkottoor wrote: > > hello , > > i found a error message as the output of "sudo dmesg -l err" > i have attached related to that in this email. > i think i found this in 5.3.8 kernel Use "uname -a" to get the current kernel version, architecture. >

Re: [PATCH] powerpc/papr_scm: Delete unnecessary assignment for the field “owner”

2019-11-03 Thread Oliver O'Halloran
On Sun, Nov 3, 2019 at 11:31 PM Markus Elfring wrote: > > From: Markus Elfring > Date: Sun, 3 Nov 2019 13:23:13 +0100 > > The field “owner” is set by the core. > Thus delete an unneeded initialisation. Acked-by: Oliver O'Halloran > > Generated by

[PATCH 2/2] powerpc/powernv: Allow manually invoking special reboots

2019-11-01 Thread Oliver O'Halloran
to be able to trigger one of these resets directly, so add a way to do that. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/setup.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c index 8349860

[PATCH 1/2] powerpc/xmon: Allow passing an argument to ppc_md.restart()

2019-11-01 Thread Oliver O'Halloran
On PowerNV a few different kinds of reboot are supported. We'd like to be able to exercise these from xmon so allow 'zr' to take an argument, and pass that to the ppc_md.restart() function. Signed-off-by: Oliver O'Halloran --- arch/powerpc/xmon/xmon.c | 11 +++ 1 file changed, 7

[PATCH v2 1/2] powerpc/powernv: Rework exports to support subnodes

2019-11-01 Thread Oliver O'Halloran
-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/opal.c | 114 +- 1 file changed, 72 insertions(+), 42 deletions(-) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 38e9027..0373da5 100644 --- a/arch/powerpc

[PATCH v2 2/2] powerpc/powernv: Use common code for the symbol_map export

2019-11-01 Thread Oliver O'Halloran
Long before we had a generic way for firmware to export memory ranges of interest we added a special case for the skiboot symbol map. The code is pretty much identical to the generic export so re-use the code. Signed-off-by: Oliver O'Halloran --- v2: Actually compile. --- arch/powerpc/platforms

[PATCH v2 3/3] powerpc/pci: Remove pcibios_setup_bus_devices()

2019-10-28 Thread Oliver O'Halloran
be run multiple times on a device, once before the device is added to the bus and once after. There's no need to run the setup in the early case any more so just remove it entirely. Signed-off-by: Oliver O'Halloran Tested-by: Alexey Kardashevskiy Reviewed-by: Alexey Kardashevskiy --- arch

[PATCH v2 2/3] powerpc/pci: Fix pcibios_setup_device() ordering

2019-10-28 Thread Oliver O'Halloran
From: Shawn Anastasio Move PCI device setup from pcibios_add_device() and pcibios_fixup_bus() to pcibios_bus_add_device(). This ensures that platform-specific DMA and IOMMU setup occurs after the device has been registered in sysfs, which is a requirement for IOMMU group assignment to work This

[PATCH v2 1/3] powernv/iov: Ensure the pdn for VFs always contains a valid PE number

2019-10-28 Thread Oliver O'Halloran
gs can be fixed by just deleting the code. Tested-by: Alexey Kardashevskiy Reviewed-by: Alexey Kardashevskiy Signed-off-by: Oliver O'Halloran --- v2: Re-wrote commit message, got very depressed about the state of things. The real fix here is to move the IOMMU group setup for both

Re: [PATCH 09/10] powerpc: Enable OpenCAPI Storage Class Memory driver on bare metal

2019-10-27 Thread Oliver O'Halloran
On Fri, Oct 25, 2019 at 3:51 PM Alastair D'Silva wrote: > > From: Alastair D'Silva > > Enable OpenCAPI Storage Class Memory driver on bare metal > > Signed-off-by: Alastair D'Silva > --- > arch/powerpc/configs/powernv_defconfig | 4 > 1 file changed, 4 insertions(+) > > diff --git

Re: [PATCH] powerpc/boot: Fix the initrd being overwritten under qemu

2019-10-23 Thread Oliver O'Halloran
On Wed, Oct 23, 2019 at 10:21 PM Segher Boessenkool wrote: > > On Wed, Oct 23, 2019 at 12:36:35PM +1100, Oliver O'Halloran wrote: > > When booting under OF the zImage expects the initrd address and size to be > > passed to it using registers r3 and r4. SLOF (guest fir

[PATCH] powerpc/boot: Fix the initrd being overwritten under qemu

2019-10-22 Thread Oliver O'Halloran
. Cc: sta...@vger.kernel.org Cc: Alexey Kardashevskiy Signed-off-by: Oliver O'Halloran --- First noticed here: https://unix.stackexchange.com/questions/547023/linux-kernel-on-ppc64le-vmlinux-equivalent-in-arch-powerpc-boot --- arch/powerpc/boot/devtree.c | 21 + arch/powerpc

Re: system call hook triggers kernel panic

2019-10-16 Thread Oliver O'Halloran
On Thu, Oct 17, 2019 at 1:01 PM Yi Li wrote: > > Hi, *snip* > The kernel module can be insert correctly, and we mount a tmpfs, then umount. > Kernel panic when doing umount: > " > [ 148.569777] umount /home/adam/test 0x0 > [ 148.608227] umount2 returned 0 > [ 148.608268] Unable to handle

[PATCH] powerpc/eeh: Only dump stack once if an MMIO loop is detected

2019-10-15 Thread Oliver O'Halloran
it to printing one stack trace for each PE freeze. If the driver is truely stuck the kernel's hung task detector is better suited to reporting the probelm anyway. Cc: Sam Bobroff Signed-off-by: Oliver O'Halloran --- arch/powerpc/kernel/eeh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

Re: [PATCH v4 2/4] powerpc: expose secure variables to userspace via sysfs

2019-10-15 Thread Oliver O'Halloran
On Tue, 2019-10-01 at 19:41 -0400, Nayna Jain wrote: > PowerNV secure variables, which store the keys used for OS kernel > verification, are managed by the firmware. These secure variables need to > be accessed by the userspace for addition/deletion of the certificates. > > This patch adds the

Re: [PATCH v4 1/4] powerpc/powernv: Add OPAL API interface to access secure variable

2019-10-15 Thread Oliver O'Halloran
On Tue, 2019-10-01 at 19:41 -0400, Nayna Jain wrote: > The X.509 certificates trusted by the platform and required to secure boot > the OS kernel are wrapped in secure variables, which are controlled by > OPAL. > > This patch adds firmware/kernel interface to read and write OPAL secure >

Re: [PATCH 2/2] powerpc/powernv: Use common code for the symbol_map export

2019-10-04 Thread Oliver O'Halloran
On Fri, Oct 4, 2019 at 7:24 PM kbuild test robot wrote: > > Hi Oliver, > > I love your patch! Yet something to improve: > > [auto build test ERROR on powerpc/next] > [cannot apply to v5.4-rc1 next-20191004] > [if your patch is applied to the wrong git tree, please drop us a note to help > improve

[PATCH 2/2] powerpc/powernv: Use common code for the symbol_map export

2019-10-04 Thread Oliver O'Halloran
Long before we had a generic way for firmware to export memory ranges of interest we added a special case for the skiboot symbol map. The code is pretty much identical to the generic export so re-use the code. Signed-off-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/opal.c | 47

[PATCH 1/2] powerpc/powernv: Rework exports to support subnodes

2019-10-04 Thread Oliver O'Halloran
-by: Oliver O'Halloran --- arch/powerpc/platforms/powernv/opal.c | 114 +- 1 file changed, 72 insertions(+), 42 deletions(-) diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c index 38e9027..0373da5 100644 --- a/arch/powerpc

Re: [PATCH 1/3] powernv/iov: Ensure the pdn for VFs always contains a valid PE number

2019-09-30 Thread Oliver O'Halloran
On Tue, Oct 1, 2019 at 3:09 AM Bjorn Helgaas wrote: > > On Mon, Sep 30, 2019 at 12:08:46PM +1000, Oliver O'Halloran wrote: > > This is all powerpc, so I assume Michael will handle this. Just > random things I noticed; ignore if they don't make sense: > >

[PATCH 3/3] powerpc/pci: Remove pcibios_setup_bus_devices()

2019-09-29 Thread Oliver O'Halloran
be run multiple times on a device, once before the device is added to the bus and once after. There's no need to run the setup in the early case any more so just remove it entirely. Signed-off-by: Oliver O'Halloran --- arch/powerpc/include/asm/pci.h| 1 - arch/powerpc/kernel/pci-common.c

[PATCH 2/3] powerpc/pci: Fix pcibios_setup_device() ordering

2019-09-29 Thread Oliver O'Halloran
From: Shawn Anastasio Move PCI device setup from pcibios_add_device() and pcibios_fixup_bus() to pcibios_bus_add_device(). This ensures that platform-specific DMA and IOMMU setup occurs after the device has been registered in sysfs, which is a requirement for IOMMU group assignment to work This

[PATCH 1/3] powernv/iov: Ensure the pdn for VFs always contains a valid PE number

2019-09-29 Thread Oliver O'Halloran
t appears to have no basis in reality so just delete it. Signed-off-by: Oliver O'Halloran --- Can't get rid of the fixup entirely since we need it to set the ioda_pe->pdev back-pointer. I'll look at killing that another time. --- arch/powerpc/kernel/eeh_driver.c | 6 -- arch/power

<    1   2   3   4   5   6   7   >