[PATCH 01/14] powerpc/eeh: Fix possible null deref in eeh_dump_dev_log()

2018-09-11 Thread Sam Bobroff
If an error occurs during an unplug operation, it's possible for eeh_dump_dev_log() to be called when edev->pdn is null, which currently leads to dereferencing a null pointer. Handle this by skipping the error log for those devices. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/e

[PATCH 09/14] powerpc/eeh: Cleanup logic in eeh_rmv_from_parent_pe()

2018-09-11 Thread Sam Bobroff
Move the call to eeh_dev_to_pe() up, so that later it's clear that "pe" isn't NULL. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh_pe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.

[PATCH 07/14] powerpc/eeh: Cleanup list_head field names

2018-09-11 Thread Sam Bobroff
ST_HEAD(), on it. The eeh_dev struct contains two list entry fields, called "list" and "rmv_list". Rename them to "entry" and "rmv_entry" and, as above, stop initializing them with LIST_HEAD(). Signed-off-by: Sam Bobroff --- arch/powerpc/include/as

[PATCH 05/14] powerpc/eeh: Cleanup unused field in eeh_dev

2018-09-11 Thread Sam Bobroff
The 'bus' member of struct eeh_dev is assigned to once but never used, so remove it. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 1 - arch/powerpc/kernel/eeh_driver.c | 1 - 2 files changed, 2 deletions(-) diff --git a/arch/powerpc/include/asm/eeh.h b/arch/power

[PATCH 12/14] powerpc/eeh: Cleanup eeh_pe_state_mark()

2018-09-11 Thread Sam Bobroff
riate one at each site. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/ppc-pci.h | 1 + arch/powerpc/kernel/eeh.c| 8 +-- arch/powerpc/kernel/eeh_driver.c | 10 ++- arch/powerpc/kernel/eeh_pe.c | 70 +--- arch/po

[PATCH 10/14] powerpc/eeh: Cleanup eeh_enabled()

2018-09-11 Thread Sam Bobroff
Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/eeh.h b/arch/powerpc/include/asm/eeh.h index b48b08ed9be3..247f09ce44de 100644 --- a/arch/powerpc/include/asm/eeh.h +++ b/arch/powerpc

[PATCH 11/14] powerpc/eeh: Cleanup unnecessary eeh_pe_state_mark_with_cfg()

2018-09-11 Thread Sam Bobroff
The function eeh_pe_state_mark_with_cfg() just performs the work of eeh_pe_state_mark() and then, conditionally, the work of eeh_pe_state_clear(). However it is only ever called with a constant state such that the condition is always true, so replace it by direct calls. Signed-off-by: Sam Bobroff

[PATCH 03/14] powerpc/eeh: Fix use of EEH_PE_KEEP on wrong field

2018-09-11 Thread Sam Bobroff
een cleared from the correct field), because the field is never tested after it is cleared by the statement in question. The clear statement was added by commit 807a827d4e74 ("powerpc/eeh: Keep PE during hotplug"), but it didn't explain why it was necessary. Signed-off-by: Sam Bobroff

[PATCH 06/14] powerpc/eeh: Cleanup eeh_add_virt_device()

2018-09-11 Thread Sam Bobroff
Remove the unnecessary cast through void * on the first parameter and remove the unused second parameter (always NULL). Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh_driver.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/eeh_driver.c b

[PATCH 08/14] powerpc/eeh: Cleanup field names in eeh_rmv_data

2018-09-11 Thread Sam Bobroff
change "removed" to "removed_dev_count" because it is a count of any removed devices, not just those in the above list. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh_driver.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/k

[PATCH 14/14] powerpc/eeh: Cleanup control flow in eeh_handle_normal_event()

2018-09-11 Thread Sam Bobroff
Rather than mixing "if (state)" blocks and gotos, convert entirely to "if (state)" blocks to make the state machine behaviour clearer. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh_driver.c | 196 +++ 1 file changed, 94 insertions(+), 10

[PATCH 04/14] powerpc/eeh: Cleanup EEH_POSTPONED_PROBE

2018-09-11 Thread Sam Bobroff
os_fixup hook). The display of the message can be cleaned up as well, by moving it into eeh_probe_devices(). Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 1 - arch/powerpc/kernel/eeh.c| 18 ++ arch/powerpc/platforms/powern

[PATCH 13/14] powerpc/eeh: Cleanup eeh_ops.wait_state()

2018-09-11 Thread Sam Bobroff
e" parameter to "delay" because that's what it is. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 4 +- arch/powerpc/kernel/eeh.c| 9 ++- arch/powerpc/kernel/eeh_driver.c | 2 +- arch/powerpc/k

[PATCH 00/14] EEH refactoring 3

2018-09-11 Thread Sam Bobroff
The set is based on powerpc next. Cheers, Sam Sam Bobroff (14): powerpc/eeh: Fix possible null deref in eeh_dump_dev_log() powerpc/eeh: Fix null deref for devices removed during EEH powerpc/eeh: Fix use of EEH_PE_KEEP on wrong field powerpc/eeh: Cleanup EEH_POSTPONED_PROBE powerpc/ee

Re: [PATCH] MAINTAINERS: Add PPC contacts for PCI core error handling

2018-09-13 Thread Sam Bobroff
are other people who should be added. > > I think this patch is definitely a good idea. > > Alongside this (whether you want to include it in your patch or not, Bjorn), > Sam Bobroff should replace myself as maintainer. He's been very active in > fixing, > reworking an

Re: [PATCH] MAINTAINERS: Add PPC contacts for PCI core error handling

2018-09-19 Thread Sam Bobroff
t; > I applied the following to for-linus for v4.19. Russell, if you want > to be removed, let me know and I'll do that. Cheers! Acked-by: Sam Bobroff > commit 3fed0e04026c > Author: Bjorn Helgaas > Date: Wed Sep 12 11:55:26 2018 -0500 > > MAINTAINERS: Upda

Re: [PATCH kernel] powerpc/powernv/ioda1: Remove dead code for a single device PE

2018-11-14 Thread Sam Bobroff
& (PNV_IODA_PE_BUS | PNV_IODA_PE_BUS_ALL)) > > pnv_ioda_setup_bus_dma(pe, pe->pbus, true); > > > > return; > > > > -- > Alexey > Looks good to me. It's pretty easy to see that PNV_IODA_PE_DEV is only set for PHBs that are PNV_PHB_NPU_NVLINK or PNV_PHB_NPU_OCAPI, so: Reviewed-by: Sam Bobroff signature.asc Description: PGP signature

Re: [PATCH kernel] powerpc/powernv/ioda: Reduce a number of hooks in pnv_phb

2018-11-14 Thread Sam Bobroff
On Tue, Oct 16, 2018 at 01:34:09PM +1100, Alexey Kardashevskiy wrote: > fixup_phb() is never used, this removes it. > > pick_m64_pe() and reserve_m64_pe() are always defined for all powernv > PHBs: they are initialized by pnv_ioda_parse_m64_window() which is > called unconditionally from pnv_pci_i

Re: [PATCH kernel] powerpc/powernv/eeh/npu: Fix uninitialized variables in opal_pci_eeh_freeze_status

2018-11-19 Thread Sam Bobroff
as well. I think we could consider these skiboot bugs, but this still seems like an improvement. Reviewed-by: Sam Bobroff > --- > > Without this, this happens: > > pnv_eeh_get_phb_diag: Failure -7 getting PHB#6 diag-data > EEH: PHB#6 failure detected, location: N/A > CPU:

Re: [PATCH kernel] powerpc/powernv/eeh/npu: Fix uninitialized variables in opal_pci_eeh_freeze_status

2018-11-19 Thread Sam Bobroff
On Tue, Nov 20, 2018 at 01:51:06PM +1100, Michael Ellerman wrote: > Alexey Kardashevskiy writes: > > > The current implementation of the OPAL_PCI_EEH_FREEZE_STATUS call in > > skiboot's NPU driver does not touch the pci_error_type parameter so > > it might have garbage but the powernv code analyz

[PATCH 1/6] powerpc/eeh: Cleanup eeh_pe_clear_frozen_state()

2018-11-28 Thread Sam Bobroff
lity, except as mentioned above. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh_driver.c | 40 +++- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c index 9446248eb6b8..aa86a42d98f2 10

[PATCH 4/6] powerpc/eeh: Add include_passed to eeh_clear_pe_frozen_state()

2018-11-28 Thread Sam Bobroff
Add a parameter to eeh_clear_pe_frozen_state() that allows passed-through PEs to be excluded. Update callers to always pass true so that there is no change in behaviour. This is to prepare for follow-up work for passed-through devices. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel

[PATCH 0/6] powerpc/eeh: Improve recovery of passed-through devices

2018-11-28 Thread Sam Bobroff
devices from that PHB so that an EEH event is raised during the process of passing the device back to the host. Cheers, Sam. Sam Bobroff (6): powerpc/eeh: Cleanup eeh_pe_clear_frozen_state() powerpc/eeh: remove sw_state from eeh_unfreeze_pe() powerpc/eeh: Add include_passed to eeh_pe_state_c

[PATCH 6/6] powerpc/eeh: Correct retries in eeh_pe_reset_full()

2018-11-28 Thread Sam Bobroff
slot error and adjust the message generation so that it's clear weather the reset has ultimately succeeded or failed. This allows the reset to succeed in some situations where it would currently fail. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh.c | 32 ++

[PATCH 3/6] powerpc/eeh: Add include_passed to eeh_pe_state_clear()

2018-11-28 Thread Sam Bobroff
-through devices. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/ppc-pci.h | 2 +- arch/powerpc/kernel/eeh.c | 18 arch/powerpc/kernel/eeh_driver.c | 20 - arch/powerpc/kernel/eeh_pe.c | 68 +- arch/powerpc/kernel/eeh_sysfs.c

[PATCH 2/6] powerpc/eeh: remove sw_state from eeh_unfreeze_pe()

2018-11-28 Thread Sam Bobroff
hould be no change in behaviour. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 2 +- arch/powerpc/kernel/eeh.c| 18 ++ arch/powerpc/kernel/eeh_driver.c | 2 +- arch/powerpc/kernel/eeh_sysfs.c | 3 ++- 4 files changed, 14 insertions(+), 11 dele

[PATCH 5/6] powerpc/eeh: Improve recovery of passed-through devices

2018-11-28 Thread Sam Bobroff
mware thaws a passed-through PE because it's parent PE has been thawed (because it was not passed through), re-freeze it. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 2 +- arch/powerpc/include/asm/ppc-pci.h | 2 +- arch/powerpc/kernel/eeh.c

Re: [PATCH] powerpc: eeh_event: convert semaphore to completion

2018-12-10 Thread Sam Bobroff
On Tue, Dec 11, 2018 at 10:18:31AM +1100, Oliver wrote: > On Tue, Dec 11, 2018 at 8:52 AM Arnd Bergmann wrote: > > > > For this use case, completions and semaphores are equivalent, > > but semaphores are an awkward interface that should generally > > be avoided, so use the completion instead. > >

Re: [PATCH kernel] powerpc/pci/of: Parse unassigned resources

2019-06-17 Thread Sam Bobroff
On Fri, Jun 14, 2019 at 01:18:28PM +1000, Alexey Kardashevskiy wrote: > > > On 14/06/2019 12:59, Alexey Kardashevskiy wrote: > > The pseries platform uses the PCI_PROBE_DEVTREE method of PCI probing > > which is basically reading "assigned-addresses" of every PCI device. > > However if the proper

Re: [PATCH v2 3/6] powerpc/eeh: Improve debug messages around device addition

2019-06-18 Thread Sam Bobroff
On Tue, Jun 11, 2019 at 03:47:58PM +1000, Alexey Kardashevskiy wrote: > > > On 07/05/2019 14:30, Sam Bobroff wrote: > > Also remove useless comment. > > > > Signed-off-by: Sam Bobroff > > Reviewed-by: Alexey Kardashevskiy > > --- > > arch

Re: [PATCH v2 6/6] powerpc/eeh: Refactor around eeh_probe_devices()

2019-06-18 Thread Sam Bobroff
On Wed, Jun 05, 2019 at 03:49:15PM +1000, Oliver wrote: > On Tue, May 7, 2019 at 2:30 PM Sam Bobroff wrote: > > > > Now that EEH support for all devices (on PowerNV and pSeries) is > > provided by the pcibios bus add device hooks, eeh_probe_devices() and > > eeh_addr_

Re: [PATCH 1/5] powerpc/eeh_cache: Don't use pci_dn when inserting new ranges

2019-07-15 Thread Sam Bobroff
. A few simple tests of EEH recovery still succeed as well. Reviewed-by: Sam Bobroff Tested-by: Sam Bobroff > --- > arch/powerpc/kernel/eeh_cache.c | 10 +- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/arch/powerpc/kernel/eeh_cache.c b/arch/powerpc/kernel/

Re: [PATCH 2/5] powerpc/eeh_sysfs: Fix incorrect comment

2019-07-15 Thread Sam Bobroff
On Mon, Jul 15, 2019 at 06:56:09PM +1000, Oliver O'Halloran wrote: > The EEH_ATTR_SHOW() helper is used to display fields from struct eeh_dev > not struct pci_dn. > > Signed-off-by: Oliver O'Halloran Good. Reviewed-by: Sam Bobroff > --- > arch/powerpc/kernel/

Re: [PATCH 3/5] powerpc/eeh_sysfs: ifdef pseries sr-iov sysfs properties

2019-07-15 Thread Sam Bobroff
#ifdef > CONFIG_PPC_PSERIES to make the dependency clearer. Looks good and a test compile without pSeries platform support configured seemed to work, so: Tested-by: Sam Bobroff Reviewed-by: Sam Bobroff > > Signed-off-by: Oliver O'Halloran > --- > arch/powerpc/kernel

Re: [PATCH 4/5] powerpc/eeh_sysfs: Remove double pci_dn lookup.

2019-07-15 Thread Sam Bobroff
gt; Signed-off-by: Oliver O'Halloran Reviewed-by: Sam Bobroff Tested-by: Sam Bobroff > --- > arch/powerpc/kernel/eeh_sysfs.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/arch/powerpc/kernel/eeh_sysfs.c b/arch/powerpc/kernel/eeh_sysfs.c > index 3adf8cd..c4cc8f

Re: [PATCH 5/5] powerpc/eeh_sysfs: Make clearing EEH_DEV_SYSFS saner

2019-07-15 Thread Sam Bobroff
ed-off-by: Oliver O'Halloran Good cleanup, although it looks like "for the device" got duplicated in the last part of the commit message. Simple EEH tests still succeeed. Reviewed-by: Sam Bobroff Tested-by: Sam Bobroff > + if (!(edev->pe->state & EEH_PE_KEEP)

Re: [EXTERNAL] Re: [PATCH v2 3/6] powerpc/eeh: Improve debug messages around device addition

2019-07-15 Thread Sam Bobroff
On Thu, Jun 20, 2019 at 01:45:24PM +1000, Oliver O'Halloran wrote: > On Thu, Jun 20, 2019 at 12:40 PM Alexey Kardashevskiy wrote: > > > > On 19/06/2019 14:27, Sam Bobroff wrote: > > > On Tue, Jun 11, 2019 at 03:47:58PM +1000, Alexey Kardashevskiy wrote: > >

Re: [EXTERNAL] Re: [PATCH v2 3/6] powerpc/eeh: Improve debug messages around device addition

2019-07-17 Thread Sam Bobroff
On Tue, Jul 16, 2019 at 05:00:44PM +1000, Oliver O'Halloran wrote: > On Tue, 2019-07-16 at 16:48 +1000, Sam Bobroff wrote: > > On Thu, Jun 20, 2019 at 01:45:24PM +1000, Oliver O'Halloran wrote: > > > On Thu, Jun 20, 2019 at 12:40 PM Alexey Kardashevskiy > > &g

[PATCH v3 4/9] powerpc/eeh: Initialize EEH address cache earlier

2019-07-22 Thread Sam Bobroff
step into a separate function and call it from a core_initcall (rather than a subsys initcall). This will allow future work to make use of the cache during boot time PCI scanning. Signed-off-by: Sam Bobroff Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/eeh.h | 3 +++ arch

[PATCH v3 1/9] powerpc/64: Adjust order in pcibios_init()

2019-07-22 Thread Sam Bobroff
already the case) and at boot time, to support future work. Signed-off-by: Sam Bobroff Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/kernel/pci-common.c | 4 arch/powerpc/kernel/pci_32.c | 4 arch/powerpc/kernel/pci_64.c | 12 +--- 3 files changed, 13 insertions

[PATCH v3 8/9] powerpc/eeh: Introduce EEH edev logging macros

2019-07-22 Thread Sam Bobroff
"info" level function is used here, the others will be used in followup work. Signed-off-by: Sam Bobroff --- v3 * New in this version. arch/powerpc/include/asm/eeh.h | 11 +++ arch/powerpc/kernel/eeh_driver.c | 17 - 2 files changed, 11 insertions(+), 17 deletions

[PATCH v3 7/9] powerpc/eeh: Add bdfn field to eeh_dev

2019-07-22 Thread Sam Bobroff
liver O'Halloran [SB: Re-wrapped commit message, fixed whitespace damage.] Signed-off-by: Sam Bobroff --- v3 * New in this version. arch/powerpc/include/asm/eeh.h | 2 ++ arch/powerpc/include/asm/ppc-pci.h | 2 ++ arch/powerpc/kernel/eeh_dev.c | 2 ++ 3 files changed, 6 insertions(+) di

[PATCH v3 3/9] powerpc/eeh: Improve debug messages around device addition

2019-07-23 Thread Sam Bobroff
Also remove useless comment. Signed-off-by: Sam Bobroff Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/kernel/eeh.c| 2 +- arch/powerpc/platforms/powernv/eeh-powernv.c | 14 arch/powerpc/platforms/pseries/eeh_pseries.c | 23 +++- 3 files

[PATCH v3 2/9] powerpc/eeh: Clear stale EEH_DEV_NO_HANDLER flag

2019-07-23 Thread Sam Bobroff
lers to be incorrectly ignored). To remedy this, clear the flag at the beginning of recovery processing. The flag is still cleared at the end of recovery processing, although it is no longer really necessary. Also clear the flag during eeh_handle_special_event(), for the same reasons. Signed-off-by: S

[PATCH v3 0/9]

2019-07-23 Thread Sam Bobroff
debug messages around device addition Patch 5/8: powerpc/eeh: Add eeh_show_enabled() Patch 6/8: powerpc/eeh: Initialize EEH address cache earlier Patch 7/8: powerpc/eeh: EEH for pSeries hot plug Patch 8/8: powerpc/eeh: Remove eeh_probe_devices() and eeh_addr_cache_build() Oliver O'Halloran (1):

[PATCH v3 6/9] powerpc/eeh: Refactor around eeh_probe_devices()

2019-07-23 Thread Sam Bobroff
Note that previously on pSeries, useless EEH sysfs files were created for some devices that did not have EEH support and this change prevents them from being created. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 7 ++--- arch/powerpc/kernel/

[PATCH v3 5/9] powerpc/eeh: EEH for pSeries hot plug

2019-07-23 Thread Sam Bobroff
was not previously possible (it was already possible on pSeries). Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh.c| 2 +- arch/powerpc/kernel/of_platform.c| 3 +- arch/powerpc/platforms/powernv/eeh-powernv.c | 39 +- arch/powerpc/platforms

[PATCH v3 9/9] powerpc/eeh: Convert log messages to eeh_edev_* macros

2019-07-23 Thread Sam Bobroff
n pnv_eeh_probe() is now generated slightly later, which will mean that it is no longer emitted for devices that aren't probed due to the initial checks. Signed-off-by: Sam Bobroff --- v3 * New in this version. arch/powerpc/include/asm/ppc-pci.h | 5 -- arch/powerpc/kernel/eeh.

Re: [PATCH v3 9/9] powerpc/eeh: Convert log messages to eeh_edev_* macros

2019-07-24 Thread Sam Bobroff
; [also build test ERROR on v5.3-rc1 next-20190724] > > [if your patch is applied to the wrong git tree, please drop us a note to > > help improve the system] > > > > url: > > https://github.com/0day-ci/linux/commits/Sam-Bobroff/powerpc-64-Adjust-order-in

[PATCH 3/3] powerpc/eeh: Fix crash when edev->pdev changes

2019-08-01 Thread Sam Bobroff
device() on it. Use this value to release the mutex, but also pass it through to the device driver's EEH handlers so that they always see the same device. Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh_driver.c | 44 +--- 1 file changed, 29 insertions(+), 1

[PATCH 1/3] powerpc/eeh: Slightly simplify eeh_add_to_parent_pe()

2019-08-01 Thread Sam Bobroff
Simplify some needlessly complicated boolean logic in eeh_add_to_parent_pe(). Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh_pe.c | 52 +++- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel

[PATCH 0/3] EEH fixes 4

2019-08-01 Thread Sam Bobroff
necessary.) For the crash fix, I did consider holding the pci_rescan_remove lock for the whole recovery phase but I was afraid that a driver may block for a long time (I've seen five minutes) or even crash and leave the lock held forever. Cheers, Sam. Sam Bobroff (3): powerpc/eeh: Sli

[PATCH 2/3] powerpc/eeh: Remove unused return path from eeh_pe_dev_traverse()

2019-08-01 Thread Sam Bobroff
There are no users of the early-out return value from eeh_pe_dev_traverse(), so remove it. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 6 +++--- arch/powerpc/kernel/eeh.c| 16 +--- arch/powerpc/kernel/eeh_driver.c | 26 +++--- arch

[PATCH v4 4/9] powerpc/eeh: Initialize EEH address cache earlier

2019-08-06 Thread Sam Bobroff
step into a separate function and call it from a core_initcall (rather than a subsys initcall). This will allow future work to make use of the cache during boot time PCI scanning. Signed-off-by: Sam Bobroff Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/eeh.h | 3 +++ arch

[PATCH v4 3/9] powerpc/eeh: Improve debug messages around device addition

2019-08-06 Thread Sam Bobroff
Also remove useless comment. Signed-off-by: Sam Bobroff Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/kernel/eeh.c| 2 +- arch/powerpc/platforms/powernv/eeh-powernv.c | 14 arch/powerpc/platforms/pseries/eeh_pseries.c | 23 +++- 3 files

[PATCH v4 0/9]

2019-08-06 Thread Sam Bobroff
address cache earlier Patch 7/8: powerpc/eeh: EEH for pSeries hot plug Patch 8/8: powerpc/eeh: Remove eeh_probe_devices() and eeh_addr_cache_build() Oliver O'Halloran (1): powerpc/eeh: Add bdfn field to eeh_dev Sam Bobroff (8): powerpc/64: Adjust order in pcibios_init() powerpc/eeh: Cle

[PATCH v4 8/9] powerpc/eeh: Introduce EEH edev logging macros

2019-08-06 Thread Sam Bobroff
"info" level function is used here, the others will be used in followup work. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 11 +++ arch/powerpc/kernel/eeh_driver.c | 17 - 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/arch/powe

[PATCH v4 5/9] powerpc/eeh: EEH for pSeries hot plug

2019-08-06 Thread Sam Bobroff
was not previously possible (it was already possible on pSeries). Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh.c| 2 +- arch/powerpc/kernel/of_platform.c| 3 +- arch/powerpc/platforms/powernv/eeh-powernv.c | 39 +- arch/powerpc/platforms

[PATCH v4 1/9] powerpc/64: Adjust order in pcibios_init()

2019-08-06 Thread Sam Bobroff
already the case) and at boot time, to support future work. Signed-off-by: Sam Bobroff Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/kernel/pci-common.c | 4 arch/powerpc/kernel/pci_32.c | 4 arch/powerpc/kernel/pci_64.c | 12 +--- 3 files changed, 13 insertions

[PATCH v4 2/9] powerpc/eeh: Clear stale EEH_DEV_NO_HANDLER flag

2019-08-06 Thread Sam Bobroff
lers to be incorrectly ignored). To remedy this, clear the flag at the beginning of recovery processing. The flag is still cleared at the end of recovery processing, although it is no longer really necessary. Also clear the flag during eeh_handle_special_event(), for the same reasons. Signed-off-by: S

[PATCH v4 7/9] powerpc/eeh: Add bdfn field to eeh_dev

2019-08-06 Thread Sam Bobroff
liver O'Halloran [SB: Re-wrapped commit message, fixed whitespace damage.] Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 2 ++ arch/powerpc/include/asm/ppc-pci.h | 2 ++ arch/powerpc/kernel/eeh_dev.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/arch/powerpc/i

[PATCH v4 6/9] powerpc/eeh: Refactor around eeh_probe_devices()

2019-08-06 Thread Sam Bobroff
Note that previously on pSeries, useless EEH sysfs files were created for some devices that did not have EEH support and this change prevents them from being created. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 7 ++--- arch/powerpc/kernel/

[PATCH v4 9/9] powerpc/eeh: Convert log messages to eeh_edev_* macros

2019-08-06 Thread Sam Bobroff
n pnv_eeh_probe() is now generated slightly later, which will mean that it is no longer emitted for devices that aren't probed due to the initial checks. Signed-off-by: Sam Bobroff --- v4 - Fixed compile warning when compiling without CONFIG_IOV. arch/powerpc/include/asm/ppc-pci.h

[PATCH v5 00/12]

2019-08-15 Thread Sam Bobroff
sages around device addition Patch 5/8: powerpc/eeh: Add eeh_show_enabled() Patch 6/8: powerpc/eeh: Initialize EEH address cache earlier Patch 7/8: powerpc/eeh: EEH for pSeries hot plug Patch 8/8: powerpc/eeh: Remove eeh_probe_devices() and eeh_addr_cache_build() Oliver O'Halloran (1): powerpc/e

[PATCH v5 01/12] powerpc/64: Adjust order in pcibios_init()

2019-08-15 Thread Sam Bobroff
resources before they were allocated. Signed-off-by: Sam Bobroff Reviewed-by: Alexey Kardashevskiy --- v5 - Complete rewrite of commit message based on more research. arch/powerpc/kernel/pci-common.c | 4 arch/powerpc/kernel/pci_32.c | 4 arch/powerpc/kernel/pci_64.c | 12

[PATCH v5 04/12] powerpc/eeh: Initialize EEH address cache earlier

2019-08-15 Thread Sam Bobroff
step into a separate function and call it from a core_initcall (rather than a subsys initcall). This will allow future work to make use of the cache during boot time PCI scanning. Signed-off-by: Sam Bobroff Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/eeh.h | 3 +++ arch

[PATCH v5 02/12] powerpc/eeh: Clear stale EEH_DEV_NO_HANDLER flag

2019-08-15 Thread Sam Bobroff
lers to be incorrectly ignored). To remedy this, clear the flag at the beginning of recovery processing. The flag is still cleared at the end of recovery processing, although it is no longer really necessary. Also clear the flag during eeh_handle_special_event(), for the same reasons. Signed-off-by: S

[PATCH v5 07/12] powerpc/eeh: Add bdfn field to eeh_dev

2019-08-15 Thread Sam Bobroff
liver O'Halloran [SB: Re-wrapped commit message, fixed whitespace damage.] Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 2 ++ arch/powerpc/include/asm/ppc-pci.h | 2 ++ arch/powerpc/kernel/eeh_dev.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/arch/powerpc/i

[PATCH v5 12/12] powerpc/eeh: Slightly simplify eeh_add_to_parent_pe()

2019-08-15 Thread Sam Bobroff
Simplify some needlessly complicated boolean logic in eeh_add_to_parent_pe(). Signed-off-by: Sam Bobroff --- v5 * New in this version. arch/powerpc/kernel/eeh_pe.c | 52 +++- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/arch/powerpc/kernel

[PATCH v5 08/12] powerpc/eeh: Introduce EEH edev logging macros

2019-08-15 Thread Sam Bobroff
"info" level function is used here, the others will be used in followup work. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 11 +++ arch/powerpc/kernel/eeh_driver.c | 17 - 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/arch/powe

[PATCH v5 06/12] powerpc/eeh: Refactor around eeh_probe_devices()

2019-08-15 Thread Sam Bobroff
Note that previously on pSeries, useless EEH sysfs files were created for some devices that did not have EEH support and this change prevents them from being created. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/eeh.h | 7 ++--- arch/powerpc/kernel/

[PATCH v5 10/12] powerpc/eeh: Fix crash when edev->pdev changes

2019-08-15 Thread Sam Bobroff
device() on it. Use this value to release the mutex, but also pass it through to the device driver's EEH handlers so that they always see the same device. Signed-off-by: Sam Bobroff --- v5 * New in this version. arch/powerpc/kernel/eeh_driver.c | 44 +--- 1 file

[PATCH v5 03/12] powerpc/eeh: Improve debug messages around device addition

2019-08-15 Thread Sam Bobroff
Also remove useless comment. Signed-off-by: Sam Bobroff Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/kernel/eeh.c| 2 +- arch/powerpc/platforms/powernv/eeh-powernv.c | 14 arch/powerpc/platforms/pseries/eeh_pseries.c | 23 +++- 3 files

[PATCH v5 05/12] powerpc/eeh: EEH for pSeries hot plug

2019-08-15 Thread Sam Bobroff
was not previously possible (it was already possible on pSeries). Signed-off-by: Sam Bobroff --- arch/powerpc/kernel/eeh.c| 2 +- arch/powerpc/kernel/of_platform.c| 3 +- arch/powerpc/platforms/powernv/eeh-powernv.c | 39 +- arch/powerpc/platforms

[PATCH v5 09/12] powerpc/eeh: Convert log messages to eeh_edev_* macros

2019-08-15 Thread Sam Bobroff
n pnv_eeh_probe() is now generated slightly later, which will mean that it is no longer emitted for devices that aren't probed due to the initial checks. Signed-off-by: Sam Bobroff --- arch/powerpc/include/asm/ppc-pci.h | 5 -- arch/powerpc/kernel/eeh.c|

[PATCH v5 11/12] powerpc/eeh: Remove unused return path from eeh_pe_dev_traverse()

2019-08-15 Thread Sam Bobroff
There are no users of the early-out return value from eeh_pe_dev_traverse(), so remove it. Signed-off-by: Sam Bobroff --- v5 * New in this version. arch/powerpc/include/asm/eeh.h | 6 +++--- arch/powerpc/kernel/eeh.c| 16 +--- arch/powerpc/kernel/eeh_driver.c | 26

Re: [PATCH 7/7] powerpc/eeh: Add eeh_force_recover to debugfs

2019-02-12 Thread Sam Bobroff
On Fri, Feb 08, 2019 at 02:08:02PM +1100, Oliver O'Halloran wrote: > This patch adds a debugfs interface to force scheduling a recovery event. > This can be used to recover a specific PE or schedule a "special" recovery > even that checks for errors at the PHB level. > To force a recovery of a norm

[PATCH 1/1] powerpc/64: Adjust order in pcibios_init()

2019-02-13 Thread Sam Bobroff
. Signed-off-by: Sam Bobroff --- Hi everyone, I've tested this on a P9 for both the host and a KVM guest, and the change hasn't caused any differences in PCI resource assignments or the general boot messages. I've also had a go at inspecting most of the code used by pci_bus_ad

Re: [PATCH v2 1/7] powerpc/eeh: Use debugfs_create_u32 for eeh_max_freezes

2019-02-14 Thread Sam Bobroff
ecimal rather than > hex because printing it in hex makes no sense. > > Signed-off-by: Oliver O'Halloran Reviewed-by: Sam Bobroff > --- > v2: Replaced uint32_t with u32. > --- > arch/powerpc/include/asm/eeh.h | 2 +- > arch/powerpc/kernel/eeh.c | 21 +++-

Re: [PATCH v2 2/7] powerpc/eeh_cache: Add pr_debug() prints for insert/remove

2019-02-14 Thread Sam Bobroff
is is pointless since we > have dynamic_debug nowdays, so remove the #ifdef guard and add a pr_debug() > for the remove case too. > > Signed-off-by: Oliver O'Halloran Reviewed-by: Sam Bobroff > --- > arch/powerpc/kernel/eeh_cache.c | 4 ++-- > 1 file changed, 2 in

Re: [PATCH v2 3/7] powerpc/eeh_cache: Add a way to dump the EEH address cache

2019-02-14 Thread Sam Bobroff
ide of the kernel since it's #ifdef`ed out by default, and writes > into the kernel log. > > Signed-off-by: Oliver O'Halloran Reviewed-by: Sam Bobroff > --- > v2: Added missing #endif > Replaced while loop with a for > --- > arch/powerpc/include/asm/eeh.

Re: [PATCH v2 4/7] powerpc/eeh_cache: Bump log level of eeh_addr_cache_print()

2019-02-14 Thread Sam Bobroff
debug print if > dynamic_debug is in use so this patch bumps it to pr_info. > > Signed-off-by: Oliver O'Halloran Reviewed-by: Sam Bobroff > --- > arch/powerpc/kernel/eeh_cache.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/power

Re: [PATCH v2 5/7] powerpc/pci: Add pci_find_controller_for_domain()

2019-02-14 Thread Sam Bobroff
On Fri, Feb 15, 2019 at 11:48:15AM +1100, Oliver O'Halloran wrote: > Add a helper to find the pci_controller structure based on the domain > number / phb id. > > Signed-off-by: Oliver O'Halloran Reviewed-by: Sam Bobroff > --- > v2: Renamed p

Re: [PATCH v2 6/7] powerpc/eeh: Allow disabling recovery

2019-02-14 Thread Sam Bobroff
On Fri, Feb 15, 2019 at 11:48:16AM +1100, Oliver O'Halloran wrote: > Currently when we detect an error we automatically invoke the EEH recovery > handler. This can be annoying when debugging EEH problems, or when working > on EEH itself so this patch adds a debugfs knob that will prevent a > recove

Re: [PATCH 1/1] powerpc/64: Adjust order in pcibios_init()

2019-02-21 Thread Sam Bobroff
04:14:42PM +1100, Sam Bobroff wrote: > The pcibios_init() function for 64 bit PowerPC currently calls > pci_bus_add_devices() before pcibios_resource_survey(), which seems > incorrect because it adds devices and attempts to bind their drivers > before allocating their resources (although

Re: [PATCH 1/1] powerpc/64: Adjust order in pcibios_init()

2019-02-21 Thread Sam Bobroff
On Fri, Feb 22, 2019 at 03:31:57PM +1100, Oliver wrote: > On Fri, Feb 22, 2019 at 2:24 PM Sam Bobroff wrote: > > > > Hey all, > > > > After some consideration, I've decided to post a v2 of this patch that > > will make it a bit safer (although I haven't

Re: [PATCH v2 07/13] powerpc/eeh: Clean up pci_ers_result handling

2018-06-03 Thread Sam Bobroff
On Sat, Jun 02, 2018 at 01:40:46AM +1000, Michael Ellerman wrote: > Sam Bobroff writes: > > > As EEH event handling progresses, a cumulative result of type > > pci_ers_result is built up by (some of) the eeh_report_*() functions > > using either: > > if (rc == P

[PATCH v3 1/1] KVM: PPC: Book3S HV: pack VCORE IDs to access full VCPU ID space

2018-07-18 Thread Sam Bobroff
From: Sam Bobroff It is not currently possible to create the full number of possible VCPUs (KVM_MAX_VCPUS) on Power9 with KVM-HV when the guest uses less threads per core than it's core stride (or "VSMT mode"). This is because the VCORE ID and XIVE offsets to grow beyond KVM

Re: [PATCH v3 1/1] KVM: PPC: Book3S HV: pack VCORE IDs to access full VCPU ID space

2018-07-24 Thread Sam Bobroff
On Mon, Jul 23, 2018 at 03:43:37PM +1000, Paul Mackerras wrote: > On Thu, Jul 19, 2018 at 12:25:10PM +1000, Sam Bobroff wrote: > > From: Sam Bobroff > > > > It is not currently possible to create the full number of possible > > VCPUs (KVM_MAX_VCPUS) on Power9 with KVM-

[PATCH v4 1/1] KVM: PPC: Book3S HV: pack VCORE IDs to access full VCPU ID space

2018-07-24 Thread Sam Bobroff
From: Sam Bobroff It is not currently possible to create the full number of possible VCPUs (KVM_MAX_VCPUS) on Power9 with KVM-HV when the guest uses less threads per core than it's core stride (or "VSMT mode"). This is because the VCORE ID and XIVE offsets to grow beyond KVM

Re: [PATCH v2 1/1] powerpc/pseries: fix EEH recovery of some IOV devices

2018-07-29 Thread Sam Bobroff
On Mon, Jul 02, 2018 at 10:59:24AM +1000, Michael Ellerman wrote: > Sam Bobroff writes: > > > EEH recovery currently fails on pSeries for some IOV capable PCI > > devices, if CONFIG_PCI_IOV is on and the hypervisor doesn't provide > > certain device tree properties

[PATCH v3 1/1] powerpc/pseries: fix EEH recovery of some IOV devices

2018-07-29 Thread Sam Bobroff
le-vfs" as well as support for the RTAS function "ibm_map_pes". These are all part of hypervisor support for IOV and it seems unlikely that a hypervisor would ever partially, but not fully, support it. (None are currently provided by QEMU/KVM.) Signed-off-by: Sam Bobroff --- Hi

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Allow creating max number of VCPUs on POWER9

2018-07-29 Thread Sam Bobroff
ble to access the entire VCPU ID space (tested using CONFIG_NR_CPUS 1024 in the host, rather than the default 2048, as that's the limit imposed by QEMU). So: Tested-by: Sam Bobroff > > arch/powerpc/include/asm/kvm_host.h | 9 - > 1 file changed, 8 insertions(+), 1 deletion

[PATCH 1/1] vfio-pci/nvlink2: Allow fallback to ibm,mmio-atsd[0]

2020-02-05 Thread Sam Bobroff
to be able to assign a dedicated ATSD register to each NVLink2 device. However, ATSD registers can be shared among devices. This change allows vfio-pci to fall back to sharing the register at index 0 if necessary. Signed-off-by: Sam Bobroff --- drivers/vfio/pci/vfio_pci_nvlink2.c | 13 +++

Re: [PATCH 1/6] powerpc/eeh: Add sysfs files in late probe

2020-02-05 Thread Sam Bobroff
d sysfs files for devices that have failed to init, because bailing out in eeh_add_device_late() (or eeh_probve_device()) will now prevent eeh_sysfs_add_device() from being called. Nice cleanup. Reviewed-by: Sam Bobroff > Signed-off-by: Oliver O'Halloran > --- > arch/powerpc/include

Re: [PATCH 2/6] powerpc/eeh: Remove eeh_add_device_tree_late()

2020-02-05 Thread Sam Bobroff
esult we can remove > eeh_add_device_tree_late(). > > Signed-off-by: Oliver O'Halloran ... with pcibios_bus_add_device() being called from pci_bus_add_devices(), in this case. Looks good. Reviewed-by: Sam Bobroff > --- > arch/powerpc/include/asm/eeh.h| 3 --- &g

Re: [PATCH 3/6] powerpc/eeh: Do early EEH init only when required

2020-02-05 Thread Sam Bobroff
where the early EEH probe needs to be done. > > We can move the calls to eeh_add_device_tree_early() to the locations where > it's needed and remove it from the generic path. This is preparation for > making the early EEH probe pseries specific. > > Signed-off-by: Oliver

Re: [PATCH 4/6] powerpc/eeh: Remove PHB check in probe

2020-02-05 Thread Sam Bobroff
ered how to test that block... and it's just dead code. Reviewed-by: Sam Bobroff > --- > arch/powerpc/kernel/eeh.c | 6 -- > 1 file changed, 6 deletions(-) > > diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c > index 9cb3370..a9e4ca7 100644 >

Re: [PATCH 5/6] powerpc/eeh: Make early EEH init pseries specific

2020-02-06 Thread Sam Bobroff
gets called via the module init path (as rpaphp is loaded) -- I tried it and there was no deadlock. I don't think we have the lock in other situations but I haven't unravelled it all enough yet to tell, either. Regardless, good cleanup. Reviewed-by: Sam Bobroff >

Re: [PATCH 6/6] powerpc/eeh: Rework eeh_ops->probe()

2020-02-06 Thread Sam Bobroff
it does does and removes the last vestiges of the > early/late EEH probe split. Nice! Just one nit, below. Reviewed-by: Sam Bobroff > Signed-off-by: Oliver O'Halloran > --- > arch/powerpc/include/asm/eeh.h | 6 ++-- > arch/powerpc/kernel/eeh.c

<    1   2   3   4   >