[PATCH 09/27] powerpc/eeh: Delay EEH probe during hotplug

2013-06-15 Thread Gavin Shan
While doing EEH recovery, the PCI devices of the problematic PE should be removed and then added to the system again. During the so-called hotplug event, the PCI devices of the problematic PE will be probed through early/late phase. We would delay EEH probe on late point for PowerNV platform since

[PATCH 07/27] powerpc/eeh: EEH post initialization operation

2013-06-15 Thread Gavin Shan
The patch adds new EEH operation post_init. It's used to notify the platform that EEH core has completed the EEH probe. By that, PowerNV platform starts to use the services supplied by EEH functionality. Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com --- arch/powerpc/include/asm/eeh.h |

[PATCH 04/27] powerpc/eeh: Make eeh_pe_get() public

2013-06-15 Thread Gavin Shan
While processing EEH event interrupt from P7IOC, we need function to retrieve the PE according to the indicated EEH device. The patch makes function eeh_pe_get() public so that other source files can call it for that purpose. Also, the patch fixes referring to wrong BDF (Bus/Device/Function)

[PATCH 03/27] powerpc/eeh: Make eeh_phb_pe_get() public

2013-06-15 Thread Gavin Shan
One of the possible cases indicated by P7IOC interrupt is fenced PHB. For that case, we need fetch the PE corresponding to the PHB and disable the PHB and all subordinate PCI buses/devices, recover from the fenced state and eventually enable the whole PHB. We need one function to fetch the PHB PE

[PATCH 12/27] powerpc/eeh: EEH backend for P7IOC

2013-06-15 Thread Gavin Shan
For EEH on PowerNV platform, the overall architecture is different from that on pSeries platform. In order to support multiple I/O chips in future, we split EEH to 3 layers for PowerNV platform: EEH core, platform layer, I/O layer. It would give EEH implementation on PowerNV platform much more

[PATCH v4 00/27] EEH Support for PowerNV platform

2013-06-15 Thread Gavin Shan
Initially, the series of patches is built based on 3.10.RC1 and the patchset doesn't intend to enable EEH functionality for PHB3 for now. Obviously, PHB3 EEH support on PowerNV platform is something to do in future. The series of patches intends to support EEH for PowerNV platform. The EEH core

[PATCH 02/27] powerpc/eeh: Cleanup for EEH core

2013-06-15 Thread Gavin Shan
While moving EEH core around from pSeries platform directory to arch/powerpc/kernel (in previous one patch), there has lots of complaints for coding style from git show. The patch is going to fix them. Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com --- arch/powerpc/kernel/eeh.c|

[PATCH 11/27] powerpc/eeh: Sync OPAL API with firmware

2013-06-15 Thread Gavin Shan
The patch synchronizes OPAL APIs between kernel and firmware. Also, we starts to replace opal_pci_get_phb_diag_data() with the similar opal_pci_get_phb_diag_data2() and the former OPAL API would return OPAL_UNSUPPORTED from now on. Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com ---

[PATCH 06/27] powerpc/eeh: Make eeh_init() public

2013-06-15 Thread Gavin Shan
For EEH on PowerNV platform, we will do EEH probe based on the real PCI devices. The PCI devices are available after PCI probe. So we have to call eeh_init() explicitly on PowerNV platform after PCI probe. The patch also does EEH probe for PowerNV platform in eeh_init(). Signed-off-by: Gavin Shan

[PATCH 14/27] powerpc/eeh: I/O chip EEH enable option

2013-06-15 Thread Gavin Shan
The patch adds the backend to enable or disable EEH functionality for the specified PE. The backend is also used to enable MMIO or DMA path for the problematic PE. It's notable that all PEs on PowerNV platform support EEH functionality by default, and we disallow to disable EEH for the specific

[PATCH 13/27] powerpc/eeh: I/O chip post initialization

2013-06-15 Thread Gavin Shan
The post initialization (struct eeh_ops::post_init) is called after the EEH probe is done. On the other hand, the EEH core post initialization is designed to call platform and then I/O chip backend on PowerNV platform. The patch adds the backend for I/O chip to notify the platform that the

[PATCH 15/27] powerpc/eeh: I/O chip EEH state retrieval

2013-06-15 Thread Gavin Shan
The patch adds I/O chip backend to retrieve the state for the indicated PE. While the PE state is temperarily unavailable, the upper layer (powernv platform) should return default delay (1 second). Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/eeh-ioda.c

[PATCH 17/27] powerpc/eeh: I/O chip PE log and bridge setup

2013-06-15 Thread Gavin Shan
The patch adds backends to retrieve error log and configure p2p bridges for the indicated PE. Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/eeh-ioda.c | 57 - 1 files changed, 55 insertions(+), 2 deletions(-) diff --git

[PATCH 16/27] powerpc/eeh: I/O chip PE reset

2013-06-15 Thread Gavin Shan
The patch adds the I/O chip backend to do PE reset. For now, we focus on PCI bus dependent PE. If PHB PE has been put into error state, the PHB will take complete reset. Besides, the root bridge will take fundamental or hot reset accordingly if the indicated PE locates at the toppest of PCI

[PATCH 20/27] powerpc/eeh: Enable EEH check for config access

2013-06-15 Thread Gavin Shan
The patch enables EEH check and let EEH core to process the EEH errors for PowerNV platform while accessing config space. Originally, the implementation already had mechanism to check EEH errors and tried to recover from them. However, we never let EEH core to handle the EEH errors.

[PATCH 19/27] powerpc/eeh: Initialization for PowerNV

2013-06-15 Thread Gavin Shan
The patch initializes EEH for PowerNV platform. Because the OPAL APIs requires HUB ID, we need trace that through struct pnv_phb. Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/pci-ioda.c | 16 +---

[PATCH 21/27] powerpc/eeh: Process interrupts caused by EEH

2013-06-15 Thread Gavin Shan
On PowerNV platform, the EEH event is produced either by detect on accessing config or I/O registers, or by interrupts dedicated for EEH report. The patch adds support to process the interrupts dedicated for EEH report. Firstly, the kernel thread will be waken up to process incoming interrupt.

[PATCH 23/27] powernv/opal: Notifier for OPAL events

2013-06-15 Thread Gavin Shan
This patch implements a notifier to receive a notification on OPAL event mask changes. The notifier is only called as a result of an OPAL interrupt, which will happen upon reception of FSP messages or PCI errors. Any event mask change detected as a result of opal_poll_events() will not result in a

[PATCH 26/27] powerpc/powernv: Debugfs directory for PHB

2013-06-15 Thread Gavin Shan
The patch creates one debugfs directory (powerpc/PCI) for each PHB so that we can hook EEH error injection debugfs entry there in proceeding patch. Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/pci-ioda.c | 22 ++

[PATCH 24/27] powernv/opal: Disable OPAL notifier upon poweroff

2013-06-15 Thread Gavin Shan
While we're restarting or powering off the system, we needn't the OPAL notifier any more. So just to disable that. Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/setup.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git

[PATCH 27/27] powerpc/eeh: Debugfs for error injection

2013-06-15 Thread Gavin Shan
The patch creates debugfs entries (powerpc/PCI/err_injct) for injecting EEH errors for testing purpose. Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/eeh-ioda.c | 33 - 1 files changed, 32 insertions(+), 1 deletions(-)

[PATCH 08/27] powerpc/eeh: Refactor eeh_reset_pe_once()

2013-06-15 Thread Gavin Shan
We shouldn't check that the returned PE status is exactly equal to (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE) but instead only check that they are both set. [benh: changelog] Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com --- arch/powerpc/kernel/eeh.c |3 ++- 1 files changed, 2

[PATCH 05/27] powerpc/eeh: Trace PCI bus from PE

2013-06-15 Thread Gavin Shan
There're several types of PEs can be supported for now: PHB, Bus and Device dependent PE. For PCI bus dependent PE, tracing the corresponding PCI bus from PE (struct eeh_pe) would make the code more efficient. The patch also enables the retrieval of PCI bus based on the PCI bus dependent PE.

[PATCH 10/27] powerpc/eeh: Export confirm_error_lock

2013-06-15 Thread Gavin Shan
An EEH event is created and queued to the event queue for each ingress EEH error. When there're mutiple EEH errors, we need serialize the process to keep consistent PE state (flags). The spinlock confirm_error_lock was introduced for the purpose. We'll inject EEH event upon error reporting

[PATCH 18/27] powerpc/eeh: PowerNV EEH backends

2013-06-15 Thread Gavin Shan
The patch adds EEH backends for PowerNV platform. It's notable that part of those EEH backends call to the I/O chip dependent backends. Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/Makefile |2 +- arch/powerpc/platforms/powernv/eeh-powernv.c |

[PATCH 25/27] powerpc/eeh: Register OPAL notifier for PCI error

2013-06-15 Thread Gavin Shan
The patch intends to register OPAL event notifier and process the PCI errors from firmware. If we have pending PCI errors, the kthread will be invoked to handle that in turn. Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/pci-err.c | 17 +

[PATCH 22/27] powerpc/eeh: Allow to check fenced PHB proactively

2013-06-15 Thread Gavin Shan
It's meaningless to handle frozen PE if we already had fenced PHB. The patch intends to check the PHB state before checking PE. If the PHB has been put into fenced state, we need take care of that firstly. Signed-off-by: Gavin Shan sha...@linux.vnet.ibm.com --- arch/powerpc/kernel/eeh.c | 60

Re: [RFC 10/10] irqchip: Make versatile fpga irq driver a generic chip

2013-06-15 Thread Linus Walleij
On Mon, Jun 10, 2013 at 12:50 PM, Grant Likely grant.lik...@linaro.org wrote: On Mon, Jun 10, 2013 at 8:40 AM, Linus Walleij linus.wall...@linaro.org wrote: On Mon, Jun 10, 2013 at 2:49 AM, Grant Likely grant.lik...@linaro.org wrote: This is an RFC patch to convert the versatile FPGA irq

Re: [RFC 10/10] irqchip: Make versatile fpga irq driver a generic chip

2013-06-15 Thread Linus Walleij
On Sat, Jun 15, 2013 at 11:19 PM, Linus Walleij linus.wall...@linaro.org wrote: On Mon, Jun 10, 2013 at 12:50 PM, Grant Likely grant.lik...@linaro.org wrote: On Mon, Jun 10, 2013 at 8:40 AM, Linus Walleij linus.wall...@linaro.org wrote: On Mon, Jun 10, 2013 at 2:49 AM, Grant Likely

Re: [RFC 10/10] irqchip: Make versatile fpga irq driver a generic chip

2013-06-15 Thread Grant Likely
On Sat, Jun 15, 2013 at 10:22 PM, Linus Walleij linus.wall...@linaro.org wrote: On Sat, Jun 15, 2013 at 11:19 PM, Linus Walleij linus.wall...@linaro.org wrote: It still works like a charm on the Integrator/AP. Tested-by: Linus Walleij linus.wall...@linaro.org BTW here is the new hwirq output

Re: [PATCH] MDIO: FSL_PQ_MDIO: Fix bug on incorrect offset of tbipa register

2013-06-15 Thread Timur Tabi
On Wed, Jun 12, 2013 at 1:31 PM, Scott Wood scottw...@freescale.com wrote: I'm not sure it's stable material if this is something that has never worked... The device tree binding will also need to be fixed to note the difference in reg between fsl,gianfar-mdio and fsl-gianfar-tbi -- and

Re: [PATCH -V10 00/15] THP support for PPC64

2013-06-15 Thread Benjamin Herrenschmidt
On Wed, 2013-06-05 at 20:58 +0530, Aneesh Kumar K.V wrote: This is the second patchset needed to support THP on ppc64. Some of the changes included in this series are tricky in that it changes the powerpc linux page table walk subtly. We also overload few of the pte flags for ptes at PMD

Re: [PATCH -V10 00/15] THP support for PPC64

2013-06-15 Thread Benjamin Herrenschmidt
On Sun, 2013-06-16 at 12:00 +1000, Benjamin Herrenschmidt wrote: So at this point, hash_page might *still* see the old pmd. Unless I missed something, you did nothing that will prevent that (the only way to lock against hash_page is really an IPI wait or to take the PTE's busy and make them

Re: [PATCH -V10 00/15] THP support for PPC64

2013-06-15 Thread Benjamin Herrenschmidt
On Sun, 2013-06-16 at 13:37 +1000, Benjamin Herrenschmidt wrote: On Sun, 2013-06-16 at 12:00 +1000, Benjamin Herrenschmidt wrote: So at this point, hash_page might *still* see the old pmd. Unless I missed something, you did nothing that will prevent that (the only way to lock against

Re: [PATCH 1/4] KVM: PPC: Add support for multiple-TCE hcalls

2013-06-15 Thread Benjamin Herrenschmidt
On Wed, 2013-06-05 at 16:11 +1000, Alexey Kardashevskiy wrote: This adds real mode handlers for the H_PUT_TCE_INDIRECT and H_STUFF_TCE hypercalls for QEMU emulated devices such as IBMVIO devices or emulated PCI. These calls allow adding multiple entries (up to 512) into the TCE table in one

Re: [PATCH 2/4] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-06-15 Thread Benjamin Herrenschmidt
+#if defined(CONFIG_SPARSEMEM_VMEMMAP) || defined(CONFIG_FLATMEM) +int realmode_get_page(struct page *page) +{ + if (PageCompound(page)) + return -EAGAIN; + + get_page(page); + + return 0; +} +EXPORT_SYMBOL_GPL(realmode_get_page); + +int

Re: [PATCH 2/4] powerpc: Prepare to support kernel handling of IOMMU map/unmap

2013-06-15 Thread Benjamin Herrenschmidt
On Sun, 2013-06-16 at 14:26 +1000, Benjamin Herrenschmidt wrote: +int realmode_get_page(struct page *page) +{ + if (PageCompound(page)) + return -EAGAIN; + + get_page(page); + + return 0; +} Shouldn't it be get_page_unless_zero ? Cheers, Ben.

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-06-15 Thread Benjamin Herrenschmidt
static pte_t kvmppc_lookup_pte(pgd_t *pgdir, unsigned long hva, bool writing, - unsigned long *pte_sizep) + unsigned long *pte_sizep, bool do_get_page) { pte_t *ptep; unsigned int shift = 0; @@ -135,6 +136,14 @@ static pte_t

[PATCH 2/9] PTR_RET is now PTR_ERR_OR_ZERO(): Replace most.

2013-06-15 Thread Rusty Russell
Sweep of the simple cases. Cc: net...@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-arm-ker...@lists.infradead.org Cc: Julia Lawall julia.law...@lip6.fr Signed-off-by: Rusty Russell ru...@rustcorp.com.au --- arch/arm/mach-omap2/i2c.c | 2 +-

Re: [PATCH 4/4] KVM: PPC: Add hugepage support for IOMMU in-kernel handling

2013-06-15 Thread Benjamin Herrenschmidt
On Wed, 2013-06-05 at 16:11 +1000, Alexey Kardashevskiy wrote: @@ -185,7 +186,31 @@ static unsigned long kvmppc_realmode_gpa_to_hpa(struct kvm_vcpu *vcpu, unsigned long hva, hpa, pg_size = 0, offset; unsigned long gfn = gpa PAGE_SHIFT; bool writing = gpa TCE_PCI_WRITE;

Re: [PATCH 21/27] powerpc/eeh: Process interrupts caused by EEH

2013-06-15 Thread Benjamin Herrenschmidt
On Sat, 2013-06-15 at 17:03 +0800, Gavin Shan wrote: On PowerNV platform, the EEH event is produced either by detect on accessing config or I/O registers, or by interrupts dedicated for EEH report. The patch adds support to process the interrupts dedicated for EEH report. Firstly, the