Re: [PATCH 6/7] KVM: arm64: Change return type of kvm_vm_ioctl_mte_copy_tags() to "int"

2023-02-07 Thread Gavin Shan
On 2/7/23 9:09 PM, Thomas Huth wrote: On 07/02/2023 01.09, Gavin Shan wrote: Hi Thomas, On 2/3/23 8:42 PM, Thomas Huth wrote: This function only returns normal integer values, so there is no need to declare its return value as "long". Signed-off-by: Thomas Huth ---   arch/arm64/i

Re: [PATCH 6/7] KVM: arm64: Change return type of kvm_vm_ioctl_mte_copy_tags() to "int"

2023-02-06 Thread Gavin Shan
Hi Thomas, On 2/3/23 8:42 PM, Thomas Huth wrote: This function only returns normal integer values, so there is no need to declare its return value as "long". Signed-off-by: Thomas Huth --- arch/arm64/include/asm/kvm_host.h | 4 ++-- arch/arm64/kvm/guest.c| 4 ++-- 2 files chang

Re: [PATCH] powerpc/powernv/pci: Reduce spam when dumping PEST

2017-04-20 Thread Gavin Shan
often) all PESTA/B are dumped. I think it should be very very rare because only one error case (link-down-freeze-all) can cause this. So it's fine to keep current implementation and code. However, it's nice to make the code smart though. With below comments resolved: Reviewed-by: Gav

Re: [PATCH v3 2/2] powerpc/eeh: Clean up and document event handling functions

2017-04-19 Thread Gavin Shan
On Thu, Apr 20, 2017 at 11:03:57AM +1000, Russell Currey wrote: >On Thu, 2017-04-20 at 09:48 +1000, Gavin Shan wrote: >> On Wed, Apr 19, 2017 at 05:39:27PM +1000, Russell Currey wrote: >> > Remove unnecessary tags in eeh_handle_normal_event(), and add function

Re: [PATCH v3 2/2] powerpc/eeh: Clean up and document event handling functions

2017-04-19 Thread Gavin Shan
;maximum number of failures, rather than one message telling you of this >and suggesting you reseat the device, there are two separate messages. > >Suggested-by: Alexey Kardashevskiy >Signed-off-by: Russell Currey Reviewed-by: Gavin Shan

Re: [PATCH v3 1/2] powerpc/eeh: Avoid use after free in eeh_handle_special_event()

2017-04-19 Thread Gavin Shan
pts to >clear the "recovering" state on the PE after eeh_handle_normal_event() returns. > >Thus, make sure the PE is valid when attempting to clear state in >eeh_handle_special_event(). > >Cc: #3.10+ >Reported-by: Alexey Kardashevskiy >Signed-off-by: Russell Currey Reviewed-by: Gavin Shan

Re: [PATCH v3 2/2] powerpc/eeh: Clean up and document event handling functions

2017-04-19 Thread Gavin Shan
On Wed, Apr 19, 2017 at 05:39:27PM +1000, Russell Currey wrote: >Remove unnecessary tags in eeh_handle_normal_event(), and add function >comments for eeh_handle_normal_event() and eeh_handle_special_event(). > >The only functional difference is that in the case of a PE reaching the >maximum number

[PATCH v2] powerpc/powernv: Block PCI config access on BCM5718 during EEH recovery

2017-04-18 Thread Gavin Shan
: Broadcom Corporation \ NetXtreme BCM5718 Gigabit Ethernet PCIe (rev 10) 0001:06:00.1 Ethernet controller: Broadcom Corporation \ NetXtreme BCM5718 Gigabit Ethernet PCIe (rev 10) Signed-off-by: Gavin Shan --- v2: s/BCM5719/BCM5718 in the subject --- arch/powerpc

Re: [PATCH] powerpc/powernv: Block PCI config access on BCM5719 during EEH recovery

2017-04-18 Thread Gavin Shan
On Wed, Apr 19, 2017 at 12:39:43PM +1000, Gavin Shan wrote: >Similar to what is done in commit b6541db13952 ("powerpc/eeh: Block >PCI config access upon frozen PE"), we need block PCI config access >for BCM5719 when recovering frozen error on them. Otherwise, an >unexpecte

[PATCH] powerpc/powernv: Block PCI config access on BCM5719 during EEH recovery

2017-04-18 Thread Gavin Shan
: Broadcom Corporation \ NetXtreme BCM5718 Gigabit Ethernet PCIe (rev 10) 0001:06:00.1 Ethernet controller: Broadcom Corporation \ NetXtreme BCM5718 Gigabit Ethernet PCIe (rev 10) Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/eeh-powernv.c | 3 +

Re: EEH error in doing DMA with PEX 8619

2017-04-10 Thread Gavin Shan
On Tue, Apr 11, 2017 at 12:15:10PM +1000, Benjamin Herrenschmidt wrote: >On Mon, 2017-04-10 at 19:04 -0700, IanJiang wrote: >> Thanks for your replay. >> >> I fixed my test according your suggestion. The CPU physical addresses (0x >> 1f9e40 and 0x 1f82c0) converted with virt_to_phys() are

Re: EEH error in doing DMA with PEX 8619

2017-04-10 Thread Gavin Shan
On Mon, Apr 10, 2017 at 05:22:33AM -0700, IanJiang wrote: >Hi all! > >I am porting PLX driver for PEX 8619 to a power8 machine with CentOS-7.3. >The PEX 8619 is used as an NTB (Non-Transparent Bridge). > >First, two DMA buffer are allocated with dma_alloc_coherent() and the >physical address are: >

[PATCH] powerpc/powernv: Map OPAL msglog in IOREMAP area

2017-03-15 Thread Gavin Shan
are about its endian (big or little) afterwards, until we need update the output position when dumping the messages in the output buffer. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/opal-msglog.c | 81 ++-- 1 file changed, 54 insertions(+), 27 deletions(-) diff --g

Re: [PATCH] powerpc/eeh: Avoid use after free in eeh_handle_special_event()

2017-03-05 Thread Gavin Shan
On Fri, Mar 03, 2017 at 04:59:11PM +1100, Alexey Kardashevskiy wrote: >On 03/03/17 15:47, Russell Currey wrote: >> eeh_handle_special_event() is called when an EEH event is detected but >> can't be narrowed down to a specific PE. This function looks through >> every PE to find one in an erroneous

Re: [PATCH] powerpc/eeh: Avoid use after free in eeh_handle_special_event()

2017-03-02 Thread Gavin Shan
On Fri, Mar 03, 2017 at 03:47:18PM +1100, Russell Currey wrote: >eeh_handle_special_event() is called when an EEH event is detected but >can't be narrowed down to a specific PE. This function looks through >every PE to find one in an erroneous state, then calls the regular event >handler eeh_handl

Re: [RESEND-RFC v2 2/3] powerpc/eeh: Introduce function eeh_pe_reset_freeze_counter()

2017-03-02 Thread Gavin Shan
ilures similar to the one before. >> > >> > Signed-off-by: Vaibhav Jain >> > --- >> >> Had a short chat discussion with Gavin Shan on this patchset and he >> preffers restoring the freeze_count on the eeh_pe once FRESET is done. >> He expects

Re: [PATCH kernel] powerpc/powernv/ioda2: Gracefully fail if too many TCE levels requested

2017-02-26 Thread Gavin Shan
t address more and EEH happens on DMA accesses. > >This adds a check that too many levels were requested. > >It is still possible to have 5 levels in the case of 4K system page size. > >Signed-off-by: Alexey Kardashevskiy >--- Acked-by: Gavin Shan

Re: [PATCH kernel] powerpc/powernv/ioda2: Update iommu table base on ownership change

2017-02-21 Thread Gavin Shan
On Wed, Feb 22, 2017 at 02:05:15PM +1100, Alexey Kardashevskiy wrote: >On 22/02/17 10:28, Gavin Shan wrote: >> On Tue, Feb 21, 2017 at 01:41:31PM +1100, Alexey Kardashevskiy wrote: [The subsequent discussion isn't related to the patch itself anymore] >> One thing would b

Re: [PATCH kernel] powerpc/powernv/ioda2: Update iommu table base on ownership change

2017-02-21 Thread Gavin Shan
s MPT3 SAS adapter >which uses both 32bit and 64bit DMA access and it has not been tested >with VFIO much. > >Cc: Gavin Shan >Signed-off-by: Alexey Kardashevskiy Acked-by: Gavin Shan One thing would be improved in future, which isn't relevant to this patch if my understanding

Re: [PATCH kernel] powerpc/powernv/npu: Remove dead iommu code

2017-02-21 Thread Gavin Shan
ype id (PNV_PHB_NPU) >so pnv_pci_ioda2_setup_dma_pe() cannot be called on NPU and therefore >(pe->flags & PNV_IODA_PE_DEV) is always "false". > >This removes not used iommu_add_device(). This should not cause any >behavioral change. > >Signed-off-by: Alexey Kardashevskiy Acked-by: Gavin Shan

Re: [PATCH kernel] powerpc/powernv: Fix it_ops::get() callback to return in cpu endian

2017-02-21 Thread Gavin Shan
ing conversion. > >The only caller of this is crash dump at arch/powerpc/kernel/iommu.c, >iommu_table_clear() which only compares TCE to zero so this change >should not cause behavioral change. > >Signed-off-by: Alexey Kardashevskiy Acked-by: Gavin Shan

Re: [PATCH] powerpc/powernv: Make PCI non-optional

2017-02-19 Thread Gavin Shan
gt; >Signed-off-by: Michael Ellerman Acked-by: Gavin Shan

Re: [PATCH 0/3] pci/hotplug/pnv-php: More bug fixes

2017-02-16 Thread Gavin Shan
On Thu, Feb 16, 2017 at 05:28:54PM -0600, Bjorn Helgaas wrote: >On Fri, Feb 17, 2017 at 09:38:08AM +1100, Gavin Shan wrote: >> On Thu, Feb 16, 2017 at 08:09:26AM -0600, Bjorn Helgaas wrote: >> >On Thu, Feb 16, 2017 at 10:22:31AM +1100, Gavin Shan wrote: >> >> T

Re: [PATCH 0/3] pci/hotplug/pnv-php: More bug fixes

2017-02-16 Thread Gavin Shan
On Thu, Feb 16, 2017 at 08:09:26AM -0600, Bjorn Helgaas wrote: >On Thu, Feb 16, 2017 at 10:22:31AM +1100, Gavin Shan wrote: >> This series bases on the series: https://patchwork.ozlabs.org/patch/713513. >> This series fixes couple of issues: >> >>* Remove WARN_ON()

Re: [PATCH 2/3] pci/hotplug/pnv-php: Disable surprise hotplug capability on conflicts

2017-02-15 Thread Gavin Shan
On Thu, Feb 16, 2017 at 03:31:48PM +1100, Andrew Donnellan wrote: >On 16/02/17 10:22, Gavin Shan wrote: >>The root port or PCIe switch downstream port might have been associated >>with driver other than pnv-php. The MSI or MSIx might also have been >>enabled by that driv

[PATCH 3/3] pci/hotplug/pnv-php: Disable MSI and PCI device properly

2017-02-15 Thread Gavin Shan
se hotplug in powernv driver") Signed-off-by: Gavin Shan --- drivers/pci/hotplug/pnv_php.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index 6d36b76..335a556 100644 --- a/drivers/pci

[PATCH 1/3] pci/hotplug/pnv-php: Remove WARN_ON() in pnv_php_put_slot()

2017-02-15 Thread Gavin Shan
] pnv_php_exit+0x50/0xcb4 [pnv_php] [c003bc007d70] [c019499c] SyS_delete_module+0x1fc/0x2a0 [c003bc007e30] [c000b184] system_call+0x38/0xe0 Cc: # v4.8+ Fixes: 66725152fb9f ("PCI/hotplug: PowerPC PowerNV PCI hotplug driver") Signed-off-by: Gavin Shan --- d

[PATCH 0/3] pci/hotplug/pnv-php: More bug fixes

2017-02-15 Thread Gavin Shan
her dirver. Also, the upstream port of the PCI slot is disabled when it's destroyed. Gavin Shan (3): pci/hotplug/pnv-php: Remove WARN_ON() in pnv_php_put_slot() pci/hotplug/pnv-php: Disable surprise hotplug capability on conflicts pci/hotplug/pnv-php: Disable MSI and PCI device pro

[PATCH 2/3] pci/hotplug/pnv-php: Disable surprise hotplug capability on conflicts

2017-02-15 Thread Gavin Shan
g: Support surprise hotplug in powernv driver") Signed-off-by: Gavin Shan --- drivers/pci/hotplug/pnv_php.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/pci/hotplug/pnv_php.c b/drivers/pci/hotplug/pnv_php.c index da1bbf3..6d36b76 100644 --- a/drivers/pci/hotplug/pnv_php.c ++

Re: [PATCH] powerpc/mm: Fix typo in set_pte_at()

2017-02-07 Thread Gavin Shan
On Mon, Feb 06, 2017 at 08:03:57AM +0530, Aneesh Kumar K.V wrote: >Gavin Shan writes: > >> This fixes the typo about the _PAGE_PTE in set_pte_at() by changing >> "tryint" to "trying to". >> >> Fixes: 6a119eae942 ("powerpc/mm: Add a _PAGE_PT

[PATCH v2] powerpc/mm: Fix typo in set_pte_at()

2017-02-07 Thread Gavin Shan
This fixes the typo about the _PAGE_PTE in set_pte_at() by changing "tryint" to "trying to". Signed-off-by: Gavin Shan --- v2: Removed "Fixes" tag --- arch/powerpc/mm/pgtable.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/

[PATCH v2] powerpc/kernel: Remove error message in pcibios_setup_phb_resources()

2017-02-07 Thread Gavin Shan
operty in the device-tree node. We can check the device-tree instead for that. This also removes one unnecessary blank line in the function. Signed-off-by: Gavin Shan --- v2: Removes the error message instead of avoiding it --- arch/powerpc/kernel/pci-common.c | 10 ++ 1 file changed, 2 i

Re: [PATCH] drivers/misc/cxl: Avoid unnecessary error message

2017-02-07 Thread Gavin Shan
On Wed, Feb 08, 2017 at 01:41:19PM +1100, Michael Ellerman wrote: >Gavin Shan writes: > >> On Wed, Feb 08, 2017 at 10:39:55AM +1100, Andrew Donnellan wrote: >>>On 08/02/17 10:21, Gavin Shan wrote: >>>>On Tue, Feb 07, 2017 at 10:12:48PM +1100, Michael Ellerman wro

Re: [PATCH] drivers/misc/cxl: Avoid unnecessary error message

2017-02-07 Thread Gavin Shan
On Wed, Feb 08, 2017 at 10:39:55AM +1100, Andrew Donnellan wrote: >On 08/02/17 10:21, Gavin Shan wrote: >>On Tue, Feb 07, 2017 at 10:12:48PM +1100, Michael Ellerman wrote: >>>Andrew Donnellan writes: >> >>.../... >> >>>>The effect of this patc

Re: [PATCH] powerpc/mm: Fix RECLAIM_DISTANCE

2017-02-07 Thread Gavin Shan
On Tue, Jan 31, 2017 at 04:01:05PM +1100, Gavin Shan wrote: >On Tue, Jan 31, 2017 at 08:11:39AM +1100, Michael Ellerman wrote: >>Gavin Shan writes: >> >>I'd like to see some test results from multi-node systems. >> >>I'd also like to understand what has

Re: [PATCH] drivers/misc/cxl: Avoid unnecessary error message

2017-02-07 Thread Gavin Shan
On Tue, Feb 07, 2017 at 10:12:48PM +1100, Michael Ellerman wrote: >Andrew Donnellan writes: .../... >> The effect of this patch is to copy the memory resources from the *real* >> PHB to the vPHB, as given through the device tree. It shouldn't have any >> practical effect other than squashing t

Re: [PATCH] drivers/misc/cxl: Avoid unnecessary error message

2017-02-07 Thread Gavin Shan
On Tue, Feb 07, 2017 at 07:14:33PM +1100, Andrew Donnellan wrote: >On 31/01/17 14:43, Gavin Shan wrote: >>The following error message was observed. It's complaining M32 >>memory window is missed on virtual PHB, which is a bit confusing. >>The problem is the memory wind

Re: [PATCH] powerpc/mm: Fix typo in set_pte_at()

2017-02-05 Thread Gavin Shan
On Mon, Feb 06, 2017 at 08:03:57AM +0530, Aneesh Kumar K.V wrote: >Gavin Shan writes: > >> This fixes the typo about the _PAGE_PTE in set_pte_at() by changing >> "tryint" to "trying to". >> >> Fixes: 6a119eae942 ("powerpc/mm: Add a _PAGE_PT

[PATCH] powerpc/mm: Fix typo in set_pte_at()

2017-02-05 Thread Gavin Shan
This fixes the typo about the _PAGE_PTE in set_pte_at() by changing "tryint" to "trying to". Fixes: 6a119eae942 ("powerpc/mm: Add a _PAGE_PTE bit") Signed-off-by: Gavin Shan --- arch/powerpc/mm/pgtable.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)

Re: [PATCH 0/3] powerpc/powernv: PCI hotplug fixes and improvement

2017-01-30 Thread Gavin Shan
On Wed, Jan 11, 2017 at 11:50:05AM +1100, Gavin Shan wrote: >This series fixes couple issues or improves its reliability: > > * The PDC event is never detected inside the IRQ handler in surprise > hot-add path. > * The slot's initial state should be REGISTERED

Re: [PATCH] powerpc/mm: Fix RECLAIM_DISTANCE

2017-01-30 Thread Gavin Shan
On Tue, Jan 31, 2017 at 04:01:05PM +1100, Gavin Shan wrote: >On Tue, Jan 31, 2017 at 08:11:39AM +1100, Michael Ellerman wrote: >>Gavin Shan writes: >> >>I'd like to see some test results from multi-node systems. >> >>I'd also like to understand what has

Re: [PATCH] powerpc/mm: Fix RECLAIM_DISTANCE

2017-01-30 Thread Gavin Shan
On Tue, Jan 31, 2017 at 03:58:16PM +1100, Anton Blanchard wrote: >Hi, > > >> Anton, I think the behaviour looks good. Actually, it's not very >> relevant to the issue addressed by the patch. I will reply to >> Michael's reply about the reason. There are two nodes in your system >> and the memory is

Re: [PATCH] powerpc/mm: Fix RECLAIM_DISTANCE

2017-01-30 Thread Gavin Shan
On Tue, Jan 31, 2017 at 08:11:39AM +1100, Michael Ellerman wrote: >Gavin Shan writes: > >I'd like to see some test results from multi-node systems. > >I'd also like to understand what has changed since we changed >RECLAIM_DISTANCE in the first place, ie. why did it u

Re: [PATCH] powerpc/mm: Fix RECLAIM_DISTANCE

2017-01-30 Thread Gavin Shan
On Mon, Jan 30, 2017 at 12:02:40PM +1100, Anton Blanchard wrote: >Hi, > >> Anton suggested that NUMA distances in powerpc mattered and hurted >> performance without this setting. We need to validate to see if this >> is still true. A simple way to start would be benchmarking > >The original issue w

[PATCH] drivers/misc/cxl: Avoid unnecessary error message

2017-01-30 Thread Gavin Shan
evice@0 This avoids the unnecessary error message by updating the PHB's memory windows with pci_process_bridge_OF_ranges(). The function is exported as well. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/pci-common.c | 1 + drivers/misc/cxl/vphb.c | 9 + 2 files c

Re: [PATCH] powerpc/mm: Fix RECLAIM_DISTANCE

2017-01-29 Thread Gavin Shan
On Mon, Jan 30, 2017 at 12:02:40PM +1100, Anton Blanchard wrote: >> Anton suggested that NUMA distances in powerpc mattered and hurted >> performance without this setting. We need to validate to see if this >> is still true. A simple way to start would be benchmarking > >The original issue was that

Re: [PATCH] powerpc/mm: Fix RECLAIM_DISTANCE

2017-01-24 Thread Gavin Shan
On Wed, Jan 25, 2017 at 09:27:44AM +0530, Balbir Singh wrote: >On Tue, Jan 24, 2017 at 10:32:28AM +1100, Gavin Shan wrote: >> When @node_reclaim_mode ("/proc/sys/vm/zone_reclaim_mode") is enabled, >> the nodes in the specified distance (< RECLAIM_DISTANCE) to the pref

Re: [PATCH] powerpc/powernv: Validate memcons descriptor and output buffer

2017-01-24 Thread Gavin Shan
On Tue, Jan 24, 2017 at 09:21:22PM +1100, Michael Ellerman wrote: >Gavin Shan writes: > >> Currently, it's assumed that memcons and its output buffer are included >> in the linear mapping. It's not true when "mem=384M" is included in >> bootargs.

[PATCH] powerpc/mm: Fix RECLAIM_DISTANCE

2017-01-23 Thread Gavin Shan
o 30. With it, the preferred node and its directly adjacent nodes will be checked for page direct reclaim. The comments explaining RECLAIM_DISTANCE is out of date. This updates and makes it correct. Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/topology.h | 7 --- 1 file changed, 4 insertio

[PATCH v2 0/3] powerpc/kernel: Simplify rtas_initialize()

2017-01-23 Thread Gavin Shan
ode's refcount in error path. v2: * Set RTAS device-tree node to NULL if its base, or size, or both of them can't be found. Gavin Shan (3): powerpc/kernel: Remove nested if statements in rtas_initialize() powerpc/kernel: Use of_property_read_u32() in rtas_initialize() powe

[PATCH v2 1/3] powerpc/kernel: Remove nested if statements in rtas_initialize()

2017-01-23 Thread Gavin Shan
This removes the unnecessary nested if statements in function rtas_initialize(), to simplify the code. No functional changes introduced. Signed-off-by: Gavin Shan --- v2: Set device node to NULL when base or size isn't found --- arch/powerpc/kernel/rtas.c

[PATCH v2 3/3] powerpc/kernel: Fix unbalanced refcount on RTAS device node

2017-01-23 Thread Gavin Shan
7;s refcount in error path. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/rtas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index ba5a4cc..b8a4987 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c @@

[PATCH v2 2/3] powerpc/kernel: Use of_property_read_u32() in rtas_initialize()

2017-01-23 Thread Gavin Shan
This uses of_property_read_u32() in rtas_initialize() so that we needn't explicitly care the CPU's endian. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/rtas.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/kernel/rtas.c b/ar

Re: [PATCH 1/3] powerpc/kernel: Remove nested if statements in rtas_initialize()

2017-01-23 Thread Gavin Shan
On Mon, Jan 23, 2017 at 08:08:20PM +1100, Michael Ellerman wrote: >Gavin Shan writes: > >> This removes the unnecessary nested if statements in function >> rtas_initialize(), to simplify the code. No functional changes >> introduced. >> >> Signed-off-by: Gavin

[PATCH 3/3] powerpc/kernel: Fix unbalanced refcount on RTAS device node

2017-01-22 Thread Gavin Shan
7;s refcount in error path. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/rtas.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index d13b92d..0823fe3 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c @@

[PATCH 1/3] powerpc/kernel: Remove nested if statements in rtas_initialize()

2017-01-22 Thread Gavin Shan
This removes the unnecessary nested if statements in function rtas_initialize(), to simplify the code. No functional changes introduced. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/rtas.c | 33 - 1 file changed, 16 insertions(+), 17 deletions(-) diff --git

[PATCH 0/3] powerpc/kernel: Simplify rtas_initialize()

2017-01-22 Thread Gavin Shan
ode's refcount in error path. Gavin Shan (3): powerpc/kernel: Remove nested if statements in rtas_initialize() powerpc/kernel: Use of_property_read_u32() in rtas_initialize() powerpc/kernel: Fix unbalanced refcount on RTAS device node arch/powerpc/kernel/r

[PATCH 2/3] powerpc/kernel: Use of_property_read_u32() in rtas_initialize()

2017-01-22 Thread Gavin Shan
This uses of_property_read_u32() in rtas_initialize() so that we needn't explicitly care the CPU's endian. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/rtas.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/kernel/rtas.c b/ar

[PATCH] powerpc/powernv: Validate memcons descriptor and output buffer

2017-01-18 Thread Gavin Shan
age log interface") Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/opal-msglog.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/opal-msglog.c b/arch/powerpc/platforms/powernv/opal-msglog.c index 39d6ff9

[PATCH v2] powerpc/eeh: Fix wrong flag passed to eeh_unfreeze_pe()

2017-01-18 Thread Gavin Shan
eared, no real issue is caused because of the misused @flag. This fixes the code by passing the value of @flag to eeh_unfreeze_pe(). Cc: sta...@vger.kernel.org #3.18+ Fixes: 5cfb20b96f6 ("powerpc/eeh: Emulate EEH recovery for VFIO devices") Signed-off-by: Gavin Shan --- v2: Improve

Re: [PATCH] powerpc/eeh: Fix wrong flag passed to eeh_unfreeze_pe()

2017-01-18 Thread Gavin Shan
On Wed, Jan 18, 2017 at 04:49:58PM +1100, Michael Ellerman wrote: >Gavin Shan writes: > >> In __eeh_clear_pe_frozen_state(), we should pass the flag's value >> instead of its address to eeh_unfreeze_pe(). This doesn't introduce >> any problems, but the code is

Re: Normal service will resume shortly ...

2017-01-16 Thread Gavin Shan
On Mon, Jan 16, 2017 at 08:33:09PM +1100, Michael Ellerman wrote: >Hi folks, > >I'm back from paternity leave, and will start processing patches in the >next day or two. > >If you've sent a fix that should go into 4.10 that hasn't been merged >yet, please feel free to reply to this message giving m

[PATCH] powerpc/eeh: Fix wrong flag passed to eeh_unfreeze_pe()

2017-01-10 Thread Gavin Shan
es: 5cfb20b96f6 ("powerpc/eeh: Emulate EEH recovery for VFIO devices") Signed-off-by: Gavin Shan --- arch/powerpc/kernel/eeh_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c index d88573b..

[PATCH] powerpc/powernv: Remove unused variable in pnv_pci_sriov_disable()

2017-01-10 Thread Gavin Shan
The local variable @iov isn't used, to remove it. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/pci-ioda.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index b07680c..32f3130 1

[PATCH 3/3] drivers/pci/hotplug: Mask PDC interrupt if required

2017-01-10 Thread Gavin Shan
#x27;t reliable and the underly (skiboot) firmware has best judgement. This masks the PDC event when skiboot requests by "ibm,slot-broken-pdc" property in PCI slot's device-tree node. Reported-by: Hank Chang Signed-off-by: Gavin Shan Tested-by: Willie Liauw --- arch/powe

[PATCH 2/3] drivers/pci/hotplug: Fix initial state for empty slot

2017-01-10 Thread Gavin Shan
hotplug in powernv driver") Cc: sta...@vger.kernel.org #v4.9+ Reported-by: Hank Chang Signed-off-by: Gavin Shan Tested-by: Willie Liauw --- drivers/pci/hotplug/pnv_php.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/pci/hotplug/pnv_php.

[PATCH 1/3] drivers/pci/hotplug: Handle presence detection change properly

2017-01-10 Thread Gavin Shan
(non-zero value) returned from pnv_pci_get_presence_state(). Fixes: 360aebd85a4 ("drivers/pci/hotplug: Support surprise hotplug in powernv driver") Cc: sta...@vger.kernel.org #v4.9+ Reported-by: Hank Chang Signed-off-by: Gavin Shan Tested-by: Willie Liauw --- drivers/pci/hotplug/pnv

[PATCH 0/3] powerpc/powernv: PCI hotplug fixes and improvement

2017-01-10 Thread Gavin Shan
;t be populated properly in hot-add path. * PDC isn't reliable for hot-add on some machines. Introduce another device-tree property to disable it if required by (skiboot) firmware. Gavin Shan (3): drivers/pci/hotplug: Handle presence detection change properly drivers/pci/hotplug: F

Re: [PATCH] powerpc/eeh: Enable IO path on permanent error

2017-01-05 Thread Gavin Shan
On Fri, Jan 06, 2017 at 10:46:21AM +1100, Russell Currey wrote: >On Fri, 2017-01-06 at 10:39 +1100, Gavin Shan wrote: >> We give up recovery on permanent error, simply shutdown the affected >> devices and remove them. If the devices can't be put into quiet state, >> they

[PATCH] powerpc/eeh: Enable IO path on permanent error

2017-01-05 Thread Gavin Shan
idhiviraj Paidipeddi Signed-off-by: Gavin Shan --- arch/powerpc/kernel/eeh.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index 8180bfd..9de7f79 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh

Re: [PATCH] drivers/pci/hotplug: Handle presence detection change properly

2016-12-21 Thread Gavin Shan
On Tue, Dec 20, 2016 at 05:49:33PM +1100, Gavin Shan wrote: >The surprise hotplug is driven by interrupt in PowerNV PCI hotplug >driver. In the interrupt handler, pnv_php_interrupt(), we bail when >pnv_pci_get_presence_state() returns zero wrongly. It causes the >presence change eve

Re: [PATCH] drivers/pci/hotplug: Handle presence detection change properly

2016-12-20 Thread Gavin Shan
On Tue, Dec 20, 2016 at 10:37:09AM +0100, Greg KH wrote: >On Tue, Dec 20, 2016 at 05:49:33PM +1100, Gavin Shan wrote: >> The surprise hotplug is driven by interrupt in PowerNV PCI hotplug >> driver. In the interrupt handler, pnv_php_interrupt(), we bail when >> pnv_pci_get_pre

[PATCH] drivers/pci/hotplug: Handle presence detection change properly

2016-12-19 Thread Gavin Shan
(non-zero value) returned from pnv_pci_get_presence_state(). Fixes: 360aebd85a4 ("drivers/pci/hotplug: Support surprise hotplug in powernv driver") Cc: sta...@vger.kernel.org #v4.9+ Reported-by: Hank Chang Signed-off-by: Gavin Shan Tested-by: Willie Liauw --- drivers/pci/hotplug/pnv

Re: [PATCH] genirq/affinity: fix node generation from cpumask

2016-12-14 Thread Gavin Shan
iel Krisman Bertazi >Signed-off-by: Guilherme G. Piccoli >Cc: sta...@vger.kernel.org # v4.9+ >Cc: Christoph Hellwig >Cc: linuxppc-dev@lists.ozlabs.org >Cc: linux-...@vger.kernel.org >--- Reviewed-by: Gavin Shan There is one picky comment as below, but you don't have to fix

Re: [PATCH v4 3/7] PCI: Separate VF BAR updates from standard BAR updates

2016-11-30 Thread Gavin Shan
On Wed, Nov 30, 2016 at 05:45:18PM -0600, Bjorn Helgaas wrote: >On Thu, Dec 01, 2016 at 10:02:54AM +1100, Gavin Shan wrote: >> On Tue, Nov 29, 2016 at 06:06:05PM -0600, Bjorn Helgaas wrote: >> >On Wed, Nov 30, 2016 at 10:20:28AM +1100, Gavin Shan wrote: >> >> On T

Re: [PATCH v4 3/7] PCI: Separate VF BAR updates from standard BAR updates

2016-11-30 Thread Gavin Shan
On Tue, Nov 29, 2016 at 06:06:05PM -0600, Bjorn Helgaas wrote: >On Wed, Nov 30, 2016 at 10:20:28AM +1100, Gavin Shan wrote: >> On Tue, Nov 29, 2016 at 08:48:26AM -0600, Bjorn Helgaas wrote: >> >On Tue, Nov 29, 2016 at 03:55:46PM +1100, Gavin Shan wrote: >> >> On M

Re: [PATCH v4 3/7] PCI: Separate VF BAR updates from standard BAR updates

2016-11-29 Thread Gavin Shan
On Tue, Nov 29, 2016 at 08:48:26AM -0600, Bjorn Helgaas wrote: >On Tue, Nov 29, 2016 at 03:55:46PM +1100, Gavin Shan wrote: >> On Mon, Nov 28, 2016 at 10:15:06PM -0600, Bjorn Helgaas wrote: >> >Previously pci_update_resource() used the same code path for updating >> >s

Re: [PATCH v4 7/7] PCI: Add comments about ROM BAR updating

2016-11-28 Thread Gavin Shan
OM mapping"). > >Link: https://lkml.org/lkml/2005/8/30/138 >Signed-off-by: Bjorn Helgaas Reviewed-by: Gavin Shan >--- > drivers/pci/rom.c |5 + > drivers/pci/setup-res.c |6 ++ > 2 files changed, 11 insertions(+) > >diff --git a/drivers/pci/rom.

Re: [PATCH v4 6/7] PCI: Decouple IORESOURCE_ROM_ENABLE and PCI_ROM_ADDRESS_ENABLE

2016-11-28 Thread Gavin Shan
what we should use. >IORESOURCE_ROM_ENABLE is a corresponding bit in struct resource flags. > >Signed-off-by: Bjorn Helgaas Reviewed-by: Gavin Shan >--- > drivers/pci/probe.c |3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/drivers/pci/probe.c b/

Re: [PATCH v4 5/7] PCI: Remove pci_resource_bar() and pci_iov_resource_bar()

2016-11-28 Thread Gavin Shan
ar(). That makes >pci_iov_resource_bar() unused, so remove that as well. > >Signed-off-by: Bjorn Helgaas Reviewed-by: Gavin Shan >--- > drivers/pci/iov.c | 18 -- > drivers/pci/pci.c | 30 -- > drivers/pci/pci.h |6 -

Re: [PATCH v4 4/7] PCI: Don't update VF BARs while VF memory space is enabled

2016-11-28 Thread Gavin Shan
s a >programming error, so use dev_WARN() to get a backtrace. > >Signed-off-by: Bjorn Helgaas Reviewed-by: Gavin Shan >--- > drivers/pci/iov.c |8 > 1 file changed, 8 insertions(+) > >diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c >index d00ed5c..

Re: [PATCH v4 3/7] PCI: Separate VF BAR updates from standard BAR updates

2016-11-28 Thread Gavin Shan
he appropriate one, > >No functional change intended. > >Signed-off-by: Bjorn Helgaas With below minor comments fixed: Reviewed-by: Gavin Shan >--- > drivers/pci/iov.c | 49 +++ > drivers/pci/pci.h |1 + > drive

Re: [PATCH v4 2/7] PCI: Ignore BAR updates on virtual functions

2016-11-28 Thread Gavin Shan
re VF BARs"); this merely restructures it slightly to make it easier >to split updates for standard and SR-IOV BARs. > >Signed-off-by: Bjorn Helgaas >CC: Wei Yang Reviewed-by: Gavin Shan >--- > drivers/pci/pci.c |4 > drivers/pci/setup-res.c |5 ++--- > 2

Re: [PATCH] powerpc/eeh: Refactor EEH PE reset functions

2016-11-17 Thread Gavin Shan
On Thu, Nov 17, 2016 at 04:07:47PM +1100, Russell Currey wrote: >eeh_pe_reset and eeh_reset_pe are two different functions in the same >file which do mostly the same thing. Not only is this confusing, but >potentially causes disrepancies in functionality, notably eeh_reset_pe >as it does not check

Re: [PATCH] powerpc/powernv: Don't warn on PE init if unfreeze is unsupported

2016-11-15 Thread Gavin Shan
rpc/powernv: Unfreeze PE on allocation") >Signed-off-by: Russell Currey Acked-by: Gavin Shan >--- > arch/powerpc/platforms/powernv/pci-ioda.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c >b/arch/power

[PATCH v3 2/2] PCI: Disable VF's memory space on updating IOV BAR in pci_update_resource()

2016-10-25 Thread Gavin Shan
ce(). Reported-by: Carol Soto Suggested-by: Bjorn Helgaas Signed-off-by: Gavin Shan Tested-by: Carol Soto --- drivers/pci/setup-res.c | 28 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 66

[PATCH v3 0/2] Disable VF's memory space on updating IOV BARs

2016-10-25 Thread Gavin Shan
that point. Instead, the VF's memory space should be disabled. Changelog = v3: * Disable VF's memory space when IOV BARs are updated in pcibios_sriov_enable(). v2: * Added one patch calling pcibios_sriov_enable() before the VF and VF BARs are enabled. Gavin S

[PATCH v3 1/2] PCI: Call pcibios_sriov_enable() before IOV BARs are enabled

2016-10-25 Thread Gavin Shan
iov_enable() returns. This calls pcibios_sriov_enable() earlier before the IOV BARs are enabled. As the result, the IOV BARs have been configured correctly when they are enabled. Signed-off-by: Gavin Shan Tested-by: Carol Soto --- drivers/pci/iov.c | 14 +++--- 1 file changed, 7 insert

Re: [PATCH v2 2/2] PCI: Don't disable PF's memory decoding when enabling SRIOV

2016-10-25 Thread Gavin Shan
On Mon, Oct 24, 2016 at 10:51:13PM -0500, Bjorn Helgaas wrote: >On Tue, Oct 25, 2016 at 12:47:28PM +1100, Gavin Shan wrote: >> On Mon, Oct 24, 2016 at 09:03:16AM -0500, Bjorn Helgaas wrote: >> >On Mon, Oct 24, 2016 at 10:28:02AM +1100, Gavin Shan wrote: >> >> On F

Re: [PATCH v2 2/2] PCI: Don't disable PF's memory decoding when enabling SRIOV

2016-10-24 Thread Gavin Shan
On Mon, Oct 24, 2016 at 09:03:16AM -0500, Bjorn Helgaas wrote: >On Mon, Oct 24, 2016 at 10:28:02AM +1100, Gavin Shan wrote: >> On Fri, Oct 21, 2016 at 11:50:34AM -0500, Bjorn Helgaas wrote: >> >Hi Gavin, >> > >> >On Fri, Sep 30, 2016 at 09:47:50AM +1000, Gavin S

Re: [PATCH v2 2/2] PCI: Don't disable PF's memory decoding when enabling SRIOV

2016-10-23 Thread Gavin Shan
On Fri, Oct 21, 2016 at 11:50:34AM -0500, Bjorn Helgaas wrote: >Hi Gavin, > >On Fri, Sep 30, 2016 at 09:47:50AM +1000, Gavin Shan wrote: >> pci_update_resource() might be called to update (shift) IOV BARs >> in PPC PowerNV specific pcibios_sriov_enable() when enabling PF'

Re: [PATCH v2 1/2] pci: Call pcibios_sriov_enable() before IOV BARs are enabled

2016-10-10 Thread Gavin Shan
On Fri, Sep 30, 2016 at 09:47:49AM +1000, Gavin Shan wrote: >In current implementation, pcibios_sriov_enable() is used by PPC >PowerNV platform only. In PowerNV specific pcibios_sriov_enable(), >PF's IOV BARs might be updated (shifted) by pci_update_resource(). >It means the IOV

Re: [PATCH] powerpc/eeh: Quieten EEH message when no adapters are found

2016-10-02 Thread Gavin Shan
On Sun, Oct 02, 2016 at 11:09:38AM +1100, Anton Blanchard wrote: >From: Anton Blanchard > >No real need for this to be pr_warn(), reduce it to pr_info(). > >Signed-off-by: Anton Blanchard Acked-by: Gavin Shan

Re: [PATCH] PCI: Add parameter @mmio_force_on to pci_update_resource()

2016-09-29 Thread Gavin Shan
On Wed, Sep 28, 2016 at 11:14:08AM +1000, Gavin Shan wrote: >On Wed, Sep 28, 2016 at 10:06:44AM +1000, Benjamin Herrenschmidt wrote: >>On Wed, 2016-09-28 at 09:37 +1000, Gavin Shan wrote: >>> >>> Yeah, it's safe to update it with memory decoding on. As the functi

[PATCH v2 2/2] PCI: Don't disable PF's memory decoding when enabling SRIOV

2016-09-29 Thread Gavin Shan
i_update_resource() in the above path. Reported-by: Carol Soto Signed-off-by: Gavin Shan Tested-by: Carol Soto --- arch/powerpc/platforms/powernv/pci-ioda.c | 2 +- drivers/pci/iov.c | 2 +- drivers/pci/pci.c | 2 +- drivers/pci/setup-res.c

[PATCH v2 1/2] pci: Call pcibios_sriov_enable() before IOV BARs are enabled

2016-09-29 Thread Gavin Shan
iov_enable() returns. This calls pcibios_sriov_enable() earlier before the IOV BARs are enabled. As the result, the IOV BARs have been configured correctly when they are enabled. Signed-off-by: Gavin Shan Tested-by: Carol Soto --- drivers/pci/iov.c | 14 +++--- 1 file changed, 7 insert

[PATCH v4 5/7] drivers/pci/hotplug: Remove likely() and unlikely() in powernv driver

2016-09-28 Thread Gavin Shan
This removes likely() and unlikely() in pnv_php.c as the code isn't running in hot path. Those macros to affect CPU's branch stream don't help a lot for performance. I used them to identify the cases are likely or unlikely to happen. No logical changes introduced. Signed-off

[PATCH v4 2/7] powerpc/eeh: Export confirm_error_lock

2016-09-28 Thread Gavin Shan
This exports @confirm_error_lock so that eeh_serialize_{lock, unlock}() can be used to freeze the affected PE in PCI surprise hot remove path. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/eeh.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc

[PATCH v4 3/7] powerpc/eeh: Export eeh_pe_state_mark()

2016-09-28 Thread Gavin Shan
This exports eeh_pe_state_mark(). It will be used to mark the surprise hot removed PE as isolated to avoid unexpected EEH error reporting in surprise remove path. Signed-off-by: Gavin Shan --- arch/powerpc/kernel/eeh_pe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/kernel

[PATCH v4 4/7] powerpc/powernv: Unfreeze PE on allocation

2016-09-28 Thread Gavin Shan
This unfreezes PE when it's initialized because the PE might be put into frozen state in the last hot remove path. It's not harmful to do so if the PE is already in unfrozen state. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/pci-ioda.c | 12 1 file c

  1   2   3   4   5   6   7   8   9   10   >