[PATCH V4 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds

2015-11-04 Thread Zhiqiang Hou
From: Harninder Rai Signed-off-by: Harninder Rai Signed-off-by: Minghuan Lian Signed-off-by: Hou Zhiqiang --- V4: V3: - Remove gerrit stuff. V2: - Remove property clock-frequency. arch/powerpc/boot/dts/bsc9132qds.dts | 15 ++ arch/powerpc/boot/dts/fsl/bsc9132si-post.dt

[PATCH V4 2/2] powerpc/85xx: Add PCIe controller support for bsc9132qds

2015-11-04 Thread Zhiqiang Hou
From: Harninder Rai 1. Use machine_arch_initcall to hook mpc85xx_common_publish_devices This can ensure before pcibios_init() is called, pci controllers have been probed and added to the hose_list. 2. Add a workaround for errata A-005434 For the BSC9132, PEX_PEXIWARn[TRGT] for all windows default

[PATCH V3 2/2] powerpc/85xx: Add PCIe controller support for bsc9132qds

2015-11-04 Thread Zhiqiang Hou
From: Harninder Rai 1. Use machine_arch_initcall to hook mpc85xx_common_publish_devices This can ensure before pcibios_init() is called, pci controllers have been probed and added to the hose_list. 2. Add a workaround for errata A-005434 For the BSC9132, PEX_PEXIWARn[TRGT] for all windows default

[PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds

2015-11-04 Thread Zhiqiang Hou
From: Harninder Rai Signed-off-by: Harninder Rai Signed-off-by: Minghuan Lian Reviewed-by: Zang Tiefei-R61911 Reviewed-by: Kushwaha Prabhakar-B32579 Reviewed-by: Fleming Andrew-AFLEMING Tested-by: Fleming Andrew-AFLEMING Signed-off-by: Hou Zhiqiang --- V3: - Remove gerrit stuff. V2: - Re

[PATCH v2 14/20] powerpc: Use generic copy_siginfo_{to,from}_user32

2015-11-04 Thread Amanieu d'Antras
Signed-off-by: Amanieu d'Antras --- arch/powerpc/include/asm/compat.h | 5 --- arch/powerpc/kernel/signal_32.c | 72 +-- 2 files changed, 1 insertion(+), 76 deletions(-) diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h ind

[PATCH v2 13/20] powerpc: Use generic compat_siginfo_t

2015-11-04 Thread Amanieu d'Antras
Signed-off-by: Amanieu d'Antras --- arch/powerpc/include/asm/compat.h | 62 ++- 1 file changed, 2 insertions(+), 60 deletions(-) diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h index cdc8638..f0f8392 100644 --- a/arch/powerp

[PATCH v2 02/20] compat: Add generic copy_siginfo_{to,from}_user32

2015-11-04 Thread Amanieu d'Antras
These routines try to match the behavior of native 32-bit kernels as closely as possible. They will replace architecture-specific versions that are missing support for some fields and have various bugs that cause behavior to diverge from that of a 32-bit kernel. The only problematic situation is w

[PATCH v2 01/20] compat: Add generic compat_siginfo_t

2015-11-04 Thread Amanieu d'Antras
This matches the normal siginfo_t as closely as possible, unlike some architecture-specific versions which are missing some fields. Signed-off-by: Amanieu d'Antras --- arch/arm64/include/asm/compat.h | 2 ++ arch/mips/include/asm/compat.h| 1 + arch/parisc/include/asm/compat.h | 2 ++

[PATCH v2 00/20] Fix handling of compat_siginfo_t

2015-11-04 Thread Amanieu d'Antras
The current handling of compat_siginfo_t is a mess: each architecture has its own implementation, all of which are incorrect in different ways. This patch series replaces all of the arch-specific versions with a single generic one that is guaranteed to produce the same results as a 32-bit kernel.

RE: [PATCH V3] thermal: qoriq: Add thermal management support

2015-11-04 Thread Hongtao Jia
> -Original Message- > From: Eduardo Valentin [mailto:edubez...@gmail.com] > Sent: Thursday, November 05, 2015 3:25 AM > To: Jia Hongtao-B38951 > Cc: Wood Scott-B07421; linux...@vger.kernel.org; linuxppc- > d...@lists.ozlabs.org > Subject: Re: [PATCH V3] thermal: qoriq: Add thermal manage

RE: [PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds

2015-11-04 Thread Hou Zhiqiang
> -Original Message- > From: Wood Scott-B07421 > Sent: 2015年11月5日 11:09 > To: Zhiqiang Hou > Cc: linuxppc-dev@lists.ozlabs.org; ga...@kernel.crashing.org; > b...@kernel.crashing.org; pau...@samba.org; m...@ellerman.id.au; > devicet...@vger.kernel.org; robh...@kernel.org; pawel.m...@arm.co

Re: [PATCH V3 1/2] powerpc/fsl: Add PCI node in device tree of bsc9132qds

2015-11-04 Thread Scott Wood
On Thu, 2015-11-05 at 10:52 +0800, Zhiqiang Hou wrote: > From: Harninder Rai > > Signed-off-by: Harninder Rai > Signed-off-by: Minghuan Lian > Reviewed-by: Zang Tiefei-R61911 > Reviewed-by: Kushwaha Prabhakar-B32579 > Reviewed-by: Fleming Andrew-AFLEMING > Tested-by: Fleming Andrew-AFLEMING

Re: [PATCH] powerpc: on crash, kexec'ed kernel needs all CPUs are online

2015-11-04 Thread David Gibson
On Wed, 4 Nov 2015 14:54:51 +0100 Laurent Vivier wrote: > > > On 04/11/2015 13:34, Hari Bathini wrote: > > On 10/16/2015 12:30 AM, Laurent Vivier wrote: > >> On kexec, all secondary offline CPUs are onlined before > >> starting the new kernel, this is not done in the case of kdump. > >> > >> If

Re: [PATCH v7 45/50] drivers/of: Avoid recursively calling unflatten_dt_node()

2015-11-04 Thread Gavin Shan
On Thu, Nov 05, 2015 at 10:23:15AM +1100, Gavin Shan wrote: >On Wed, Nov 04, 2015 at 10:07:50AM -0600, Rob Herring wrote: >>On Wed, Nov 4, 2015 at 7:12 AM, Gavin Shan wrote: >>> In current implementation, unflatten_dt_node() is called recursively >>> to unflatten device nodes in FDT blob. It's str

Re: [PATCH v7 49/50] drivers/of: Export OF changeset functions

2015-11-04 Thread Gavin Shan
On Wed, Nov 04, 2015 at 10:12:00AM -0600, Rob Herring wrote: >On Wed, Nov 4, 2015 at 7:12 AM, Gavin Shan wrote: >> The PowerNV PCI hotplug driver is going to use the OF changeset >> to manage the changed device sub-tree. This exports those OF >> changeset functions for that. >> >> Signed-off-by: G

Re: [PATCH v7 45/50] drivers/of: Avoid recursively calling unflatten_dt_node()

2015-11-04 Thread Gavin Shan
On Wed, Nov 04, 2015 at 10:07:50AM -0600, Rob Herring wrote: >On Wed, Nov 4, 2015 at 7:12 AM, Gavin Shan wrote: >> In current implementation, unflatten_dt_node() is called recursively >> to unflatten device nodes in FDT blob. It's stress to limited stack >> capacity. > >Did you actually hit a prob

Re: [PATCH v7 44/50] drivers/of: Split unflatten_dt_node()

2015-11-04 Thread Gavin Shan
On Wed, Nov 04, 2015 at 12:43:08PM -0600, Rob Herring wrote: >On Wed, Nov 4, 2015 at 7:12 AM, Gavin Shan wrote: >> The function unflatten_dt_node() is called recursively to unflatten >> device nodes and properties in the FDT blob. It looks complicated >> and hard to be understood. >> >> This split

Re: [PATCH V3] thermal: qoriq: Add thermal management support

2015-11-04 Thread Scott Wood
On Wed, 2015-11-04 at 11:24 -0800, Eduardo Valentin wrote: > On Fri, Sep 25, 2015 at 03:09:42AM +, Hongtao Jia wrote: > > > > > -Original Message- > > > From: Wood Scott-B07421 > > > Sent: Friday, September 25, 2015 6:10 AM > > > To: Jia Hongtao-B38951 > > > Cc: edubez...@gmail.com; li

Pull request: powerpc/mpc5xxx next

2015-11-04 Thread Anatolij Gustschin
Highlights include a driver for MPC512x LocalPlus Bus FIFO with its device tree binding documentation, mpc512x device tree updates and some minor fixes. These patches have already been queued for linux-next for a while. The following changes since commit 353169acf1858bb2dc3f91475dafabce547de14c:

[RFC PATCH 3/3]perf/powerpc: Functions to update arch_misc_regs

2015-11-04 Thread Madhavan Srinivasan
Patch adds function to update the arch_misc_reg struct and an arch specific perf_sample_regs_intr() to hook up arch_misc_regs to perf_regs pointer. Also makes perf_sample_regs_intr() in kernel/event/core.c as __weak__ function to make arch specific implementation to replace. Signed-off-by: Madhava

[RFC PATCH 2/3]perf/powerpc: update macros and add regs to arch_misc_reg struct

2015-11-04 Thread Madhavan Srinivasan
Patch updates the arch_misc_regs struct (arch/powerpc/ptrace.h) with arch/powerpc specific regs (PMU regs). Updates asm/perf_regs.h and perf_regs.c with corresponding macros to export the arch_misc_reg values. Signed-off-by: Madhavan Srinivasan Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Peter Zijl

[RFC PATCH 1/3] perf/core: extend perf_regs to include arch specific regs

2015-11-04 Thread Madhavan Srinivasan
As a foundation patch, new structure called arch_misc_regs added to perf_regs. And perf_reg_value() is modified to expect perf_regs instead of pt_regs. This way, perf_reg_value() can decide on the struct to pick based on the register idx. Signed-off-by: Madhavan Srinivasan Cc: Thomas Gleixner Cc

[RFC PATCH 0/3]perf/core: extend perf_reg and perf_sample_regs_intr

2015-11-04 Thread Madhavan Srinivasan
This patchset extend the perf sample regs infrastructure to include architecture specific regs. Current perf_sample_regs_intr exports only registers in the pt_regs to perf.data using PERF_SAMPLE_REGS_INTR sample type. But sometimes we end up looking for or prefer raw register values at the interrup

Re: [PATCH V3] thermal: qoriq: Add thermal management support

2015-11-04 Thread Eduardo Valentin
On Fri, Sep 25, 2015 at 03:09:42AM +, Hongtao Jia wrote: > > > -Original Message- > > From: Wood Scott-B07421 > > Sent: Friday, September 25, 2015 6:10 AM > > To: Jia Hongtao-B38951 > > Cc: edubez...@gmail.com; linux...@vger.kernel.org; linuxppc- > > d...@lists.ozlabs.org > > Subject:

Re: [PATCH v7 44/50] drivers/of: Split unflatten_dt_node()

2015-11-04 Thread Rob Herring
On Wed, Nov 4, 2015 at 7:12 AM, Gavin Shan wrote: > The function unflatten_dt_node() is called recursively to unflatten > device nodes and properties in the FDT blob. It looks complicated > and hard to be understood. > > This splits the function into 3 functions: populate_properties(), > populate_

Re: [PATCH v7 49/50] drivers/of: Export OF changeset functions

2015-11-04 Thread Rob Herring
On Wed, Nov 4, 2015 at 7:12 AM, Gavin Shan wrote: > The PowerNV PCI hotplug driver is going to use the OF changeset > to manage the changed device sub-tree. This exports those OF > changeset functions for that. > > Signed-off-by: Gavin Shan Acked-by: Rob Herring > --- > drivers/of/dynamic.c

Re: [PATCH v7 45/50] drivers/of: Avoid recursively calling unflatten_dt_node()

2015-11-04 Thread Rob Herring
On Wed, Nov 4, 2015 at 7:12 AM, Gavin Shan wrote: > In current implementation, unflatten_dt_node() is called recursively > to unflatten device nodes in FDT blob. It's stress to limited stack > capacity. Did you actually hit a problem? Now we have a max depth of 64. Seems like that should be plen

[PATCH v7 25/50] powerpc/powernv: Reserve PE for root bus

2015-11-04 Thread Gavin Shan
We're going to reserve/assign PEs when pcibios_setup_bridge() is called. The function won't be called for root bus as it doesn't have parent bridge. However, the root bus still needs a PE to be covered. This reserves PE numbers that are adjacent to the reserved one for root buses. Signed-off-by:

[PATCH v7 26/50] powerpc/powernv: Create PEs at PCI hot plugging time

2015-11-04 Thread Gavin Shan
Currently, the PEs and their associated resources are assigned in ppc_md.pcibios_fixup() except those used by SRIOV VFs. The function is called for once after PCI probing and resources assignment is completed. So it isn't hotplug friendly. This creates PEs dynamically by ppc_md.pcibios_setup_bridg

[PATCH v7 36/50] powerpc/pci: Update bridge windows on PCI plug

2015-11-04 Thread Gavin Shan
On the PCI plugging event, PCI slot's subordinate devices are scanned and their (IO and MMIO) resources are assigned. Platform dependent resources (PE#, IO/MMIO/DMA windows) are allocated or created on updating windows of the slot's upstream bridge. This updates the windows of the hot plugged slot

[PATCH v7 06/50] powerpc/powernv: Drop phb->bdfn_to_pe()

2015-11-04 Thread Gavin Shan
This drops struct pnv_phb::bdfn_to_pe() as nobody uses it. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/pci-ioda.c | 9 - arch/powerpc/platforms/powernv/pci.h | 1 - 2 files changed, 10 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powe

Re: [PATCH] powerpc: on crash, kexec'ed kernel needs all CPUs are online

2015-11-04 Thread Laurent Vivier
On 04/11/2015 13:34, Hari Bathini wrote: > On 10/16/2015 12:30 AM, Laurent Vivier wrote: >> On kexec, all secondary offline CPUs are onlined before >> starting the new kernel, this is not done in the case of kdump. >> >> If kdump is configured and a kernel crash occurs whereas >> some secondaries

[PATCH v7 39/50] powerpc/powernv: Fundamental reset in pnv_pci_reset_secondary_bus()

2015-11-04 Thread Gavin Shan
In pnv_pci_reset_secondary_bus(), we should issue fundamental reset if any one subordinate device of the specified is requesting that. Otherwise, the device might not come up after the reset. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/eeh-powernv.c | 21 - 1

[PATCH v7 32/50] powerpc/pci: Introduce pci_remove_device_node_info()

2015-11-04 Thread Gavin Shan
This implements and exports pci_remove_device_node_info(). It's used to remove the pdn (struct pci_dn) for the indicated device node. The function is going to be used by PowerNV PCI hotplug driver. Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/pci-bridge.h | 1 + arch/powerpc/kernel/pc

[PATCH v7 31/50] powerpc/pci: Export pci_add_device_node_info()

2015-11-04 Thread Gavin Shan
This renames update_dn_pci_info() to pci_add_device_node_info() with corresponding adjustment on the parameter type and exports it. The function is used to create pdn (struct pci_dn) for the indicated device node. Another function add_pdn(), almost wrapper of pci_add_device_node_info(), to be used

[PATCH v7 35/50] powerpc/pci: Don't scan empty slot

2015-11-04 Thread Gavin Shan
In hotplug case, function pcibios_add_pci_devices() is called to rescan the specified PCI bus, which might not have any child devices. Access to the PCI bus's child device node will cause kernel crash without exception. This adds condition to skip scanning PCI bus that doesn't have any subordinate

[PATCH v7 13/50] powerpc/powernv: Rename M64 related functions

2015-11-04 Thread Gavin Shan
This renames those functions picking PE number based on consumed M64 segments, mapping M64 segments to PEs as those functions are going to be shared by IODA1/IODA2 in next patch. No logical changes introduced. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/pci-ioda.c | 22 +

[PATCH v7 33/50] powerpc/pci: Export pci_traverse_device_nodes()

2015-11-04 Thread Gavin Shan
This renames traverse_pci_devices() to pci_traverse_device_nodes(). The function traverses all subordinate device nodes of the specified one. Also, below cleanup applied to the function. No logical changes introduced. * Rename "pre" to "fn". * Avoid assignment in if condition reported from c

[PATCH v7 01/50] PCI: Add pcibios_setup_bridge()

2015-11-04 Thread Gavin Shan
Currently, PowerPC PowerNV platform utilizes ppc_md.pcibios_fixup(), which is called for once after PCI probing and resource assignment are completed, to allocate platform required resources for PCI devices: PE#, IO and MMIO mapping, DMA address translation (TCE) table etc. Obviously, it's not hotp

[PATCH v7 08/50] powerpc/powernv: Rename PE# fields in struct pnv_phb

2015-11-04 Thread Gavin Shan
This renames the fields related to PE number in "struct pnv_phb" for better reflecting of their usages as Alexey suggested. No logical changes introduced. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/eeh-powernv.c | 2 +- arch/powerpc/platforms/powernv/pci-ioda.c| 56 +++

[PATCH v7 21/50] powerpc/powernv: Increase PE# capacity

2015-11-04 Thread Gavin Shan
Each PHB maintains an array helping to translate 2-bytes Request ID (RID) to PE# with the assumption that PE# takes one byte, meaning that we can't have more than 256 PEs. However, pci_dn->pe_number already had 4-bytes for the PE#. This extends the PE# capacity so that each of them will be 4-bytes

[PATCH v7 30/50] powerpc/pci: Move pci_find_bus_by_node() around

2015-11-04 Thread Gavin Shan
This moves pci_find_bus_by_node() from arch/powerpc/platforms/ pseries/pci_dlpar.c to arch/powerpc/kernel/pci-hotplug.c so that the function can be used by pSeries and PowerNV platform at the same time. Also, below cleanup applied. No functional changes introduced. * Remove variable "busdn" in

[PATCH v7 28/50] powerpc/pci: Rename pcibios_{add, remove}_pci_devices()

2015-11-04 Thread Gavin Shan
This renames pcibios_{add,remove}_pci_devices() to avoid conflicts with names of the weak functions in PCI subsystem, which have the prefix "pcibios". No logical changes introduced. Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/pci-bridge.h | 4 ++-- arch/powerpc/kernel/eeh_driver.c

[PATCH v7 22/50] powerpc/powernv: Introduce pnv_ioda_init_pe()

2015-11-04 Thread Gavin Shan
This introduces pnv_ioda_init_pe() to initialize the specified PE instance (phb->ioda.pe_array[x]). It's used by pnv_ioda_alloc_pe() and pnv_ioda_reserve_pe(). No logical changes introduced. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/pci-ioda.c | 14 ++ 1 file chang

[PATCH v7 19/50] powerpc/powernv: Track DMA32 segment consumption

2015-11-04 Thread Gavin Shan
Similar to the mechanism tracking consumed IO/M32/M64 segments, this introduces an array for each PHB to track the consumed DMA32 segments, which are going to be released on PCI unplugging time. The index of the array is the DMA32 segment number while the value stored in the element is the assigned

[PATCH v7 18/50] powerpc/powernv: Remove DMA32 PE list

2015-11-04 Thread Gavin Shan
PEs are put into PHB DMA32 list (phb->ioda.pe_dma_list) according to their DMA32 weight. The PEs on the list are iterated to setup their TCE32 tables at system booting time. The list is used for once and there is no good reason for it to survive. This moves the logic calculating DMA32 weight of PH

[PATCH v7 40/50] powerpc/powernv: Support PCI slot ID

2015-11-04 Thread Gavin Shan
PowerNV platforms runs on top of skiboot firmware that includes changes to support PCI slots. PCI slots are identified by PHB's ID or the combo of that and PCI slot ID. This changes the EEH PowerNV backend to support PCI slots: * Rename arguments of opal_pci_reset() and opal_pci_poll(). * O

[PATCH v7 47/50] drivers/of: Specify parent node in of_fdt_unflatten_tree()

2015-11-04 Thread Gavin Shan
This adds one more argument to of_fdt_unflatten_tree() to specify the parent node of the FDT blob that is going to be unflattened. In the result, the function can be used to unflatten FDT blob that represents device sub-tree in PowerNV PCI hotplug driver. Signed-off-by: Gavin Shan --- drivers/of

[PATCH v7 12/50] powerpc/powernv: Track M64 segment consumption

2015-11-04 Thread Gavin Shan
As we track M32 segment consumption, this introduces an array to the PHB to track the mapping between M64 segment and PE number. The information is going to be used to find M64 segment from the PE number during PCI unplugging time in subsequent patches. Signed-off-by: Gavin Shan --- arch/powerpc

[PATCH v7 50/50] PCI/hotplug: PowerPC PowerNV PCI hotplug driver

2015-11-04 Thread Gavin Shan
This adds standalone driver to support PCI hotplug for PowerPC PowerNV platform that runs on top of skiboot firmware. The firmware identifies hotpluggable slots and marked their device tree node with proper "ibm,slot-pluggable" and "ibm,reset-by-firmware". The driver scans device tree nodes to crea

[PATCH v7 11/50] powerpc/powernv: IO and M32 mapping based on PCI device resources

2015-11-04 Thread Gavin Shan
Currently, the IO and M32 segments are mapped to the corresponding PE based on the windows of the parent bridge of PE's primary bus. It's not going to work when the windows of root port or upstream port of the PCIe switch behind root port are extended to PHB's aperatuses in order to support hotplug

[PATCH v7 49/50] drivers/of: Export OF changeset functions

2015-11-04 Thread Gavin Shan
The PowerNV PCI hotplug driver is going to use the OF changeset to manage the changed device sub-tree. This exports those OF changeset functions for that. Signed-off-by: Gavin Shan --- drivers/of/dynamic.c| 65 ++--- drivers/of/of_private.h | 2 ++

[PATCH v7 43/50] powerpc/powernv: Select OF_DYNAMIC

2015-11-04 Thread Gavin Shan
The device tree will change dynamically in PowerNV PCI hotplug driver. This enables CONFIG_OF_DYNAMIC to support that. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/platforms/powernv/Kconfig b/arch/powerpc/p

[PATCH v7 10/50] powerpc/powernv: Simplify pnv_ioda_setup_pe_seg()

2015-11-04 Thread Gavin Shan
The original implementation of pnv_ioda_setup_pe_seg() configures IO and M32 segments by separate logics, which can be merged by by caching @segmap, @seg_size, @win in advance. This shouldn't cause any behavioural changes. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/pci-ioda.c |

[PATCH v7 20/50] powerpc/powernv: Improve DMA32 segment calculation

2015-11-04 Thread Gavin Shan
In current implementation, the DMA32 segments required by one specific PE isn't calculated with the information hold in the PE independently. It conflicts with the PCI hotplug design: PE centralized, meaning the PE's DMA32 segments should be calculated from the information hold in the PE independen

[PATCH v7 15/50] powerpc/powernv: Rename pnv_pci_ioda_setup_dma_pe()

2015-11-04 Thread Gavin Shan
This renames pnv_pci_ioda_setup_dma_pe() to pnv_pci_ioda1_setup_dma_pe() as it's the counter-part of IODA2's pnv_pci_ioda2_setup_dma_pe(). No logical changes introduced. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/pci-ioda.c | 9 + 1 file changed, 5 insertions(+), 4 dele

[PATCH v7 42/50] powerpc/powernv: Functions to get/set PCI slot status

2015-11-04 Thread Gavin Shan
This exports 4 functins, which base on the corresponding OPAL APIs to get/set PCI slot status. Those functions are going to be used by PowerNV PCI hotplug driver: pnv_pci_get_device_tree()opal_get_device_tree() pnv_pci_get_presence_state() opal_pci_get_presence_state() pnv_pci_get_pow

[PATCH v7 41/50] powerpc/powernv: Use firmware PCI slot reset infrastructure

2015-11-04 Thread Gavin Shan
The skiboot firmware might provide the PCI slot reset capability which is identified by property "ibm,reset-by-firmware" on the PCI slot associated device node. This checks the property. If it exists, the reset request is routed to firmware. Otherwise, the reset is done by kernel as before. Signe

[PATCH v7 37/50] powerpc/powernv: Simplify pnv_eeh_reset()

2015-11-04 Thread Gavin Shan
This drops unnecessary nested if statements in pnv_eeh_reset() to improve the code readability. After the changes, the unused local variable "ret" is dropped as well. No logical changes introduced. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/eeh-powernv.c | 61 --

[PATCH v7 29/50] powerpc/pci: Rename pcibios_find_pci_bus()

2015-11-04 Thread Gavin Shan
This renames pcibios_find_pci_bus() to pci_find_bus_by_node() to avoid conflicts with those PCI subsystem weak function names, which have prefix "pcibios". No logical changes introduced. Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/pci-bridge.h | 2 +- arch/powerpc/platforms/pseri

[PATCH v7 38/50] powerpc/powernv: Exclude root bus in pnv_pci_reset_secondary_bus()

2015-11-04 Thread Gavin Shan
When pnv_pci_reset_secondary_bus() is called to issue reset on the indicated secondary bus, the bus can't be root bus. So we needn't consider root bus in the function. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/eeh-powernv.c | 12 ++-- 1 file changed, 2 insertions(+), 1

[PATCH v7 24/50] powerpc/powernv: Allocate PE# in reverse order

2015-11-04 Thread Gavin Shan
PE number for one particular PE can be allocated dynamically or reserved according to the consumed M64 (64-bits prefetchable) segments of the PE. The M64 resources, and hence their segments and PE number are assigned/reserved in ascending order. The PE numbers are allocated dynamically in ascending

[PATCH v7 07/50] powerpc/powernv: Reorder fields in struct pnv_phb

2015-11-04 Thread Gavin Shan
This moves those fields in struct pnv_phb that are related to PE allocation around. No logical change. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/pci.h | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci.h b/arch/powerp

[PATCH v7 34/50] powerpc/pci: Delay populating pdn

2015-11-04 Thread Gavin Shan
The pdn (struct pci_dn) instances are allocated from memblock or bootmem when creating PCI controller (hoses) in setup_arch(). PCI hotplug, which will be supported by proceeding patches, release PCI device nodes and their corresponding pdn on unplugging event. The memory chunks for pdn instances al

[PATCH v7 48/50] drivers/of: Return allocated memory from of_fdt_unflatten_tree()

2015-11-04 Thread Gavin Shan
This returns the allocate memory chunk, storing the unflattened device tree, from of_fdt_unflatten_tree() so that memory chunk can be released on demand in PowerNV PCI hotplug driver. Signed-off-by: Gavin Shan Acked-by: Rob Herring --- drivers/of/fdt.c | 25 - incl

[PATCH v7 27/50] powerpc/powernv: Dynamically release PEs

2015-11-04 Thread Gavin Shan
This adds a reference count of PE, representing the number of PCI devices associated with the PE. The reference count is increased or decreased when PCI devices join or leave the PE. Once it becomes zero, the PE together with its used resources (IO, MMIO, DMA, PELTM, PELTV) are released to support

[PATCH v7 00/50] powerpc/powernv: PCI hotplug support

2015-11-04 Thread Gavin Shan
This series of patches rebases on powerpc/next branch, plus below additional patches: https://patchwork.ozlabs.org/patch/534804/ (PATCH[1/1] Andrew's EEH fix) https://patchwork.ozlabs.org/patch/534154/ (PATCH[7/7] Richard's SRIOV Rework) commit 3b0e21e Merge branch 'next' of git://g

[PATCH v7 05/50] powerpc/powernv: Drop pnv_ioda_setup_dev_PE()

2015-11-04 Thread Gavin Shan
Nobody uses this function and this just drops it. Signed-off-by: Gavin Shan Reviewed-by: Alexey Kardashevskiy --- arch/powerpc/platforms/powernv/pci-ioda.c | 71 --- 1 file changed, 71 deletions(-) diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/power

[PATCH v7 03/50] powerpc/pci: Cleanup on struct pci_controller_ops

2015-11-04 Thread Gavin Shan
Each PHB has one instance of "struct pci_controller_ops", which includes various callbacks called by PCI subsystem. In the definition of this struct, some callbacks have explicit names for its arguments, but the left don't have. This adds all explicit names of the arguments to the callbacks in "st

[PATCH v7 45/50] drivers/of: Avoid recursively calling unflatten_dt_node()

2015-11-04 Thread Gavin Shan
In current implementation, unflatten_dt_node() is called recursively to unflatten device nodes in FDT blob. It's stress to limited stack capacity. This avoids calling the function recursively, meaning the device nodes are unflattened in one call on unflatten_dt_node(): two arrays are introduced to

[PATCH v7 23/50] powerpc/powernv: Use PE instead of number during setup and release

2015-11-04 Thread Gavin Shan
In current implementation, the PEs that are allocated or picked from the reserved list are identified by PE number. The PE instance has to be picked according to the PE number eventually. We have same issue when PE is released. For pnv_ioda_pick_m64_pe() and pnv_ioda_alloc_pe(), this returns PE in

[PATCH v7 17/50] powerpc/powernv: Avoid calculating DMA32 segments on PHB3

2015-11-04 Thread Gavin Shan
In pnv_ioda_setup_dma(), it's unnecessary to calculate the DMA32 segments for PEs on PHB3 as the whole available DMA32 space can be assigned to one specific PE on PHB3. This splits pnv_ioda_setup_dma() to pnv_pci_ioda1_setup_dma() and pnv_pci_ioda2_setup_dma() in order to avoid calculating DMA32 s

[PATCH v7 46/50] drivers/of: Rename unflatten_dt_node()

2015-11-04 Thread Gavin Shan
This renames unflatten_dt_node() to unflatten_dt_nodes() as it populates multiple device nodes from FDT blob. No logical changes introduced. Signed-off-by: Gavin Shan --- drivers/of/fdt.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/of/fdt.c b/driv

[PATCH v7 44/50] drivers/of: Split unflatten_dt_node()

2015-11-04 Thread Gavin Shan
The function unflatten_dt_node() is called recursively to unflatten device nodes and properties in the FDT blob. It looks complicated and hard to be understood. This splits the function into 3 functions: populate_properties(), populate_node() and unflatten_dt_node(). populate_properties(), which i

[PATCH v7 14/50] powerpc/powernv: M64 support on P7IOC

2015-11-04 Thread Gavin Shan
This enables M64 window on P7IOC, which has been enabled on PHB3. Different from PHB3 where 16 M64 BARs are supported and each of them can be owned by one particular PE# exclusively or divided evenly to 256 segments, every P7IOC PHB has 16 M64 BARs and each of them are divided to 8 segments. So eve

[PATCH v7 16/50] powerpc/powernv: Define PNV_IODA1_DMA32_SEGSIZE

2015-11-04 Thread Gavin Shan
Currently, there is one macro (TCE32_TABLE_SIZE) representing the TCE table size for one DMA32 segment. The constant representing the DMA32 segment size (1 << 28) is still used in the code. This defines PNV_IODA1_DMA32_SEGSIZE representing one DMA32 segment size. the TCE table size can be calcualt

[PATCH v7 04/50] powerpc/powernv: Cleanup on pnv_pci_ioda_controller_ops

2015-11-04 Thread Gavin Shan
This cleans up on pnv_pci_ioda_controller_ops struct to use tab instead of space indent of statement to avoid complains from scripts/checkpatch.pl. No logical changes introduced. Signed-off-by: Gavin Shan --- arch/powerpc/platforms/powernv/pci-ioda.c | 18 +- 1 file changed, 9 in

[PATCH v7 09/50] powerpc/powernv: Fix initial IO and M32 segmap

2015-11-04 Thread Gavin Shan
There are two arrays for IO and M32 segment maps on every PHB. The index of the arrays are segment number and the value stored in the corresponding element is PE number, indicating the segment is assigned to the PE. Initially, all elements in those two arrays are zeroes, meaning all segments are as

[PATCH v7 02/50] powerpc/pci: Override pcibios_setup_bridge()

2015-11-04 Thread Gavin Shan
This overrides pcibios_setup_bridge() that is called to update PCI bridge windows when PCI resource assignment is completed, to assign PE and setup various (resource) mapping for the PE in subsequent patches. Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/pci-bridge.h | 2 ++ arch/powerp

Re: [PATCH] powerpc: on crash, kexec'ed kernel needs all CPUs are online

2015-11-04 Thread Hari Bathini
On 10/16/2015 12:30 AM, Laurent Vivier wrote: On kexec, all secondary offline CPUs are onlined before starting the new kernel, this is not done in the case of kdump. If kdump is configured and a kernel crash occurs whereas some secondaries CPUs are offline (SMT=off), the new kernel is not able t

Re: [PATCH] Enable MSI/MSI-X caps and disable MSI interrupts at PCI probe time - code move

2015-11-04 Thread Guilherme G. Piccoli
Bjorn, ping? ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RESEND, tip/locking/core, v5, 1/6] powerpc: atomic: Make _return atomics and *{cmp}xchg fully ordered

2015-11-04 Thread Will Deacon
On Wed, Nov 04, 2015 at 09:22:13AM +0800, Boqun Feng wrote: > Will, AFAIK, you are currently working on variants on arm64, right? I > wonder whether you depend on patch 3 (allow archictures to provide > self-defined __atomic_op_*), if so I can also send patch 3 as a patch > for tip tree and wait un

Re: [PATCH V3 0/3] perf/powerpc:Add ability to sample intr machine state in powerpc

2015-11-04 Thread Denis Kirjanov
On 11/3/15, Anju T wrote: > This short patch series adds the ability to sample the interrupted > machine state for each hardware sample. > > To test this patchset, > Eg: > > $perf record -I ls // record machine state at interrupt > $perf script -D //read the perf.data file Uncovered the fo