Re: [RFC PATCH v2 10/11] powerpc: Support to replay PMIs

2016-08-01 Thread Benjamin Herrenschmidt
On Mon, 2016-08-01 at 18:07 +1000, Nicholas Piggin wrote: > This will replay hardware_interrupt_common in the case we got a PMI > interrupt but no EE. > > Should we just follow the normal pattern here, return 0xf00 for PMI, > and replay the same as the other cases? Agreed. Cheers, Ben.

Re: [PATCH v3 12/21] powerpc/mm: Convert early cpu/mmu feature check to use the new helpers

2016-07-27 Thread Benjamin Herrenschmidt
On Thu, 2016-07-28 at 00:18 +1000, Michael Ellerman wrote: > --- a/arch/powerpc/mm/hash_utils_64.c > +++ b/arch/powerpc/mm/hash_utils_64.c > @@ -530,7 +530,7 @@ static bool might_have_hea(void) > * we will never see an HEA ethernet device. > */ >  #ifdef CONFIG_IBMEBUS > -   

Re: [PATCH v3 12/21] powerpc/mm: Convert early cpu/mmu feature check to use the new helpers

2016-07-27 Thread Benjamin Herrenschmidt
On Thu, 2016-07-28 at 00:18 +1000, Michael Ellerman wrote: > > diff --git a/arch/powerpc/include/asm/book3s/64/mmu.h > b/arch/powerpc/include/asm/book3s/64/mmu.h > index 70c995870297..6deda6ecc4f7 100644 > --- a/arch/powerpc/include/asm/book3s/64/mmu.h > +++

Re: _PAGE_PRESENT and _PAGE_ACCESSED

2016-07-27 Thread Benjamin Herrenschmidt
On Tue, 2016-07-26 at 19:52 +0200, LEROY Christophe wrote: > In ppc8xx tlbmiss handler, we consider a page valid if both   > _PAGE_PRESENT and _PAGE_ACCESSED are set. > Is there any chance to have _PAGE_ACCESSED set and not _PAGE_PRESENT ? > Otherwise we could simplify the handler by considering

Re: [PATCH] Make system_reset_pSeries relocatable

2016-07-27 Thread Benjamin Herrenschmidt
On Wed, 2016-07-27 at 17:32 +1000, Balbir Singh wrote: > From: Balbir Singh > > Currently the power management bits are broken w.r.t. relocation. > There are direct branches from system_reset_pSeries to > power7_wakeup_*. Side track: we should really get rid of the

Re: [RFC PATCH 0/9]powerpc: "paca->soft_enabled" based local atomic operation implementation

2016-07-26 Thread Benjamin Herrenschmidt
On Mon, 2016-07-25 at 20:22 +0530, Madhavan Srinivasan wrote: > But this patchset uses Benjamin Herrenschmidt suggestion of using > arch_local_irq_disable_var() to soft_disable interrupts (including PMIs). > After finishing the "op", arch_local_irq_restore() called and correspon

Re: [PATCH 2/3] powerpc/mm: Rename hpte_init_lpar() & put fallback in a header

2016-07-25 Thread Benjamin Herrenschmidt
On Mon, 2016-07-25 at 20:36 +1000, Michael Ellerman wrote: > That would be nice, but these look fishy at least: > > arch/powerpc/platforms/cell/spu_manage.c:   if > (!firmware_has_feature(FW_FEATURE_LPAR)) > arch/powerpc/platforms/cell/spu_manage.c:   if >

Re: [PATCH 2/3] powerpc/mm: Rename hpte_init_lpar() & put fallback in a header

2016-07-25 Thread Benjamin Herrenschmidt
On Mon, 2016-07-25 at 15:33 +1000, Michael Ellerman wrote: > When we detect a PS3 we set both PS3_LV1 and LPAR at the same time, > so > there should be no way they can get out of sync, other than due to a > bug in the code. I thought I had changed PS3 to no longer set LPAR ? I like having a flag

Re: [PATCH 2/3] powerpc/mm: Rename hpte_init_lpar() & put fallback in a header

2016-07-24 Thread Benjamin Herrenschmidt
On Mon, 2016-07-25 at 14:13 +1000, Stephen Rothwell wrote: > Hi Michael, > > On Mon, 25 Jul 2016 12:57:50 +1000 Michael Ellerman > wrote: > > > > hpte_init_lpar() is part of the pseries platform, so name it as such. > > Provide the fallback implementation in a header,

Re: [PATCH] powerpc/64: implement a slice mask cache

2016-07-23 Thread Benjamin Herrenschmidt
On Sat, 2016-07-23 at 17:10 +1000, Nicholas Piggin wrote: > I wanted to avoid doing more work under slice_convert_lock, but > we should just make that a per-mm lock anyway shouldn't we? Aren't the readers under the mm sem taken for writing or has this changed ? Cheers, Ben.

Re: [for-4.8, 1/2] powerpc/mm: Switch user slb fault handling to translation enabled

2016-07-22 Thread Benjamin Herrenschmidt
On Fri, 2016-07-22 at 22:37 +1000, Nicholas Piggin wrote: > > We also handle fault with proper stack initialized. This enable us > to > > callout to C in fault handling routines. We don't do this for > kernel > > mapping, because of the possibility of taking recursive fault if > > kernel stack in

[PATCH] powerpc/book64s: Move a few exception common handlers to make room

2016-07-16 Thread Benjamin Herrenschmidt
k. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- Written in an airline lounge after about 30h spent in planes and airports, so I apologize in advance if something is just plain wrong here, but it seems to compile ;-) arch/powerpc/kernel/exceptions-64s.S | 17 +

Re: [PATCH 02/14] powerpc/irq: Add support for HV virtualization interrupts

2016-07-16 Thread Benjamin Herrenschmidt
On Sat, 2016-07-16 at 16:33 -0500, Benjamin Herrenschmidt wrote: > On Sat, 2016-07-16 at 20:40 +1000, Michael Ellerman wrote:s > > This is breaking allmodconfig with: > > > > arch/powerpc/kernel/exceptions-64s.S:778: Error: attempt to move > > .org backwards > &g

Re: [PATCH 02/14] powerpc/irq: Add support for HV virtualization interrupts

2016-07-16 Thread Benjamin Herrenschmidt
On Sat, 2016-07-16 at 20:40 +1000, Michael Ellerman wrote: > This is breaking allmodconfig with: > > arch/powerpc/kernel/exceptions-64s.S:778: Error: attempt to move .org > backwards > arch/powerpc/kernel/exceptions-64s.S:779: Error: attempt to move .org > backwards >

Re: [patch] ide: missing break statement in set_timings_mdma()

2016-07-14 Thread Benjamin Herrenschmidt
d the static checker warning. > > Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> Acked-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> Should probably also: CC: sta...@vger.kernel.org > diff --git a/drivers/ide/pmac.c b/drivers/ide/pmac.c > index 7f0434f..0c5d3

Re: [bug report] [PATCH] powerpc: Thermal control for dual core G5s

2016-07-13 Thread Benjamin Herrenschmidt
On Wed, 2016-07-13 at 13:15 +0300, Dan Carpenter wrote: > Hello Benjamin Herrenschmidt, > > The patch ac171c46667c: "[PATCH] powerpc: Thermal control for dual > core G5s" from Feb 8, 2006, leads to the following static checker > warning: > > drivers/macin

Re: [PATCH for-4.8 02/10] powerpc/mm: Convert early cpu/mmu feature check to use the new helpers

2016-07-13 Thread Benjamin Herrenschmidt
On Wed, 2016-07-13 at 19:36 +0530, Aneesh Kumar K.V wrote: > > I'm not sure about that. This is converting way way way way more > > functions than is needed. Especially if Michael applies my series > > there will be very little code run before the patching, really only > the > > MMU

Re: [PATCH for-4.8 02/10] powerpc/mm: Convert early cpu/mmu feature check to use the new helpers

2016-07-13 Thread Benjamin Herrenschmidt
On Wed, 2016-07-13 at 15:08 +0530, Aneesh Kumar K.V wrote: > This switch most of the early feature check to use the non static key > variant of the function. In later patches we will be switching > cpu_has_feature and mmu_has_feature to use static keys and we can use > them only after static

Re: [PATCH for-4.8_set4 0/2] Segment table support

2016-07-13 Thread Benjamin Herrenschmidt
On Wed, 2016-07-13 at 15:10 +0530, Aneesh Kumar K.V wrote: > Hi, > > This series add support for ISA 3.0 memory segment table. > > Aneesh Kumar K.V (2): >   powerpc/mm: Switch user slb fault handling to translation enabled >   powerpc/mm: Support segment table for Power9 The segment table will

[PATCH v2 11/14] powerpc/powernv/pci: Fallback to OPAL for TCE invalidations

2016-07-08 Thread Benjamin Herrenschmidt
If we don't find registers for the PHB or don't know the model specific invalidation method, use OPAL calls instead. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v2. Missed some new invalidation calls that went upstream since I wrote the original patch. arch/p

[PATCH 14/14] powerpc/pci: Don't try to allocate resources that will be reassigned

2016-07-08 Thread Benjamin Herrenschmidt
When we know we will reassign all resources, trying (and failing) to allocate them initially is fairly pointless and leads to a lot of scary messages in the kernel log Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/pci-common.c | 6 -- 1 file c

[PATCH 13/14] powerpc/powernv/pci: Check status of a PHB before using it

2016-07-08 Thread Benjamin Herrenschmidt
If the firmware encounters an error (internal or HW) during initialization of a PHB, it might leave the device-node in the tree but mark it disabled using the "status" property. We should check it. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/p

[PATCH 12/14] powerpc/powernv/pci: Use the device-tree to get available range of M64's

2016-07-08 Thread Benjamin Herrenschmidt
newer OPALs will provide a property we can use to know what range of windows is available. The property is named so that it can eventually support multiple ranges but we only use the first one for now. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/pla

[PATCH 11/14] powerpc/powernv/pci: Fallback to OPAL for TCE invalidations

2016-07-08 Thread Benjamin Herrenschmidt
If we don't find registers for the PHB or don't know the model specific invalidation method, use OPAL calls instead. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/platforms/powernv/pci-ioda.c | 33 +++ 1 file changed, 29 inse

[PATCH 10/14] powerpc/powernv/pci: Rework accessing the TCE invalidate register

2016-07-08 Thread Benjamin Herrenschmidt
It's architected, always in a known place, so there is no need to keep a separate pointer to it, we use the existing "regs", and we complement it with a real mode variant. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> # Conflicts: # arch/powerpc/platf

[PATCH 09/14] powerpc/powernv/pci: Remove SWINV constants and obsolete TCE code

2016-07-08 Thread Benjamin Herrenschmidt
We have some obsolete code in pnv_pci_p7ioc_tce_invalidate() to handle some internal lab tools that have stopped being useful a long time ago. Remove that along with the definition and test for the TCE_PCI_SWINV_* flags whose value is basically always the same. Signed-off-by: Benjamin

[PATCH 08/14] powerpc/powernv/pci: Rename TCE invalidation calls

2016-07-08 Thread Benjamin Herrenschmidt
relationship between an IODA version and a PHB implementation. There exist another variant of IODA1 (Torrent) but we never supported in with OPAL and never will. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/platforms/powernv/npu-dma.c | 8 +++ arch/p

[PATCH 07/14] powerpc/opal: Add real mode call wrappers

2016-07-08 Thread Benjamin Herrenschmidt
Replace the old generic opal_call_realmode() with proper per-call wrappers similar to the normal ones and convert callers. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/opal-api.h| 10 +++- arch/powerpc/include/asm/

[PATCH 06/14] powerpc/pseries/pci: Remove obsolete SW invalidate

2016-07-08 Thread Benjamin Herrenschmidt
That was used by some old IBM internal bringup tools and is no longer relevant. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/platforms/pseries/iommu.c | 53 +- 1 file changed, 1 insertion(+), 52 deletions(-) diff --git

[PATCH 05/14] powerpc/powernv: Discover IODA3 PHBs

2016-07-08 Thread Benjamin Herrenschmidt
We instanciate them as IODA2. We also change the MSI EOI hack to only kick on PHB3 since it will not be needed on any new implementation. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/platforms/powernv/pci-ioda.c | 3 ++- arch/powerpc/platforms/powernv

[PATCH 04/14] powerpc/xics: Add ICP OPAL backend

2016-07-08 Thread Benjamin Herrenschmidt
This adds a new XICS backend that uses OPAL calls, which can be used when we don't have native support for the platform interrupt controller. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/xics.h| 8 +- arch/powerpc/sysdev/xics/Ma

[PATCH 03/14] powerpc/irq: Add mechanism to force a replay of interrupts

2016-07-08 Thread Benjamin Herrenschmidt
since the hardware won't issue another HW interrupt in that case. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/hw_irq.h | 2 ++ arch/powerpc/kernel/irq.c | 14 ++ 2 files changed, 16 insertions(+) diff --git a/arch/powerpc/i

[PATCH 02/14] powerpc/irq: Add support for HV virtualization interrupts

2016-07-08 Thread Benjamin Herrenschmidt
This will be delivering external interrupts from the XIVE to the Hypervisor. We treat it as a normal external interrupt for the lazy irq disable code (so it will be replayed as a 0x500) and route it to do_IRQ. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/p

[PATCH 01/14] powerpc/powernv: Add XICS emulation APIs

2016-07-08 Thread Benjamin Herrenschmidt
OPAL provides an emulated XICS interrupt controller to use as a fallback on newer processors that don't have a XICS. It's meant as a way to provide backward compatibility with future processors. Add the corresponding interfaces. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.

[PATCH v2] powerpc/pnv/pci: Fix incorrect PE reservation attempt on some 64-bit BARs

2016-07-07 Thread Benjamin Herrenschmidt
and leads to insane PE numbers. Instead, compare the addresses to figure it out. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> CC: sta...@vger.kernel.org --- v2. Rebased to powerpc/next arch/powerpc/platforms/powernv/pci-ioda.c | 28 ++-- 1 file chang

Re: [RFC/PATCH 2/4] powerpc/64/kexec: Fix MMU cleanup on radix

2016-07-07 Thread Benjamin Herrenschmidt
On Fri, 2016-07-08 at 12:55 +1000, Balbir Singh wrote: > + > > +/* For use by kexec */ > > +void mmu_cleanup_all(void) > > +{ > > + if (radix_enabled()) > > + radix__mmu_cleanup_all(); > > > Should this be more than just radix -- cpu_has_feature(CPU_FTR_ARCH_300)? I don't

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Benjamin Herrenschmidt
On Thu, 2016-07-07 at 23:21 +1000, Benjamin Herrenschmidt wrote: >  > I think the right fix is that if a restore_sigcontext() has the MSR > bits set, > it should set the corresponding used_* flag. Something like this: (totally untested) diff --git a/arch/powerpc/kernel/signal

Re: [v4] powerpc: Export thread_struct.used_vr/used_vsr to user space

2016-07-07 Thread Benjamin Herrenschmidt
On Thu, 2016-07-07 at 15:12 +0200, Laurent Dufour wrote: > > Basically, CRIU checkpoints the process register's state through the > ptrace API, and it restores it through a signal frame at restart time. > This is quite odd but that the way it works on all the CRIU's supported > architectures. >

Re: [PATCH 02/41] drm: Fix broken use of _PAGE_NO_CACHE on powerpc

2016-07-07 Thread Benjamin Herrenschmidt
On Thu, 2016-07-07 at 22:38 +1000, Michael Ellerman wrote: > Benjamin Herrenschmidt <b...@kernel.crashing.org> writes: > > > That constant no longer exist. Use the proper accessor instead > > I still see it? Hrm, right, it does, I think it's just not always acce

[RFC/PATCH 4/4] powerpc/64/kexec: Remove BookE special default_machine_kexec_prepare()

2016-07-05 Thread Benjamin Herrenschmidt
The only difference is now the TCE table check which doesn't need to be ifdef'ed out, it will basically do nothing on BookE (it is only useful for ancient IBM machines). Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- Currently only compile tested arch/powerpc/

[RFC/PATCH 3/4] powerpc/64/kexec: Copy image with MMU off when possible

2016-07-05 Thread Benjamin Herrenschmidt
, that way we can get rid of the collision check completely. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- Currently only compile tested arch/powerpc/kernel/machine_kexec_64.c | 50 +++--- arch/powerpc/kernel/misc_64.S

[RFC/PATCH 2/4] powerpc/64/kexec: Fix MMU cleanup on radix

2016-07-05 Thread Benjamin Herrenschmidt
. Currently set it to NULL on BookE thought it might be a good idea to wipe the TLB there (Scott ?) Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- Currently only compile tested arch/powerpc/include/asm/book3s/64/mmu.h | 3 +++ arch/powerpc/include/asm/mmu-book3e.h

[RFC/PATCH 1/4] powerpc/64/kexec: NULL check "clear_all" in kexec_sequence

2016-07-05 Thread Benjamin Herrenschmidt
With Radix, it can be NULL even on !BOOKE these days so replace the ifdef with a NULL check which is cleaner anyway. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- Currently only compile tested arch/powerpc/kernel/misc_64.S | 7 --- 1 file changed, 4 insertions

[PATCH 22/41] powerpc/mm: Move hash table ops to a separate structure

2016-07-05 Thread Benjamin Herrenschmidt
quite fix is update_partition_table since this is not specific to hash, so I moved it to a standalone variable for now. We can revisit later if needed. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 39

[PATCH 11/41] powerpc/dart: Use a cachable DART

2016-07-05 Thread Benjamin Herrenschmidt
get rid of the copy of the DART for suspend/resume as the original memory can just be saved/restored now, as long as we properly sync the caches. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/iommu.h| 1 - arch/powerpc/mm/hash_util

[PATCH 12/41] powerpc: Move FW feature probing out of pseries probe()

2016-07-05 Thread Benjamin Herrenschmidt
We move the function itself to pseries/firmware.c and call it along with almost all other flat device-tree parsers from early_init_devtree() Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/firmware.h | 4 +++ arch/powerpc/kernel/

[PATCH 33/41] powerpc/64: Move the content of setup_system() to setup_arch()

2016-07-05 Thread Benjamin Herrenschmidt
And kill setup_system() Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/head_64.S | 5 +- arch/powerpc/kernel/setup_64.c | 137 +++-- 2 files changed, 64 insertions(+), 78 deletions(-) diff --git a/arch/p

[PATCH 14/41] powerpc/pmac: Remove early allocation of the SMU command buffer

2016-07-05 Thread Benjamin Herrenschmidt
. So move the allocation to the SMU driver itself. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/smu.h | 7 --- arch/powerpc/platforms/powermac/setup.c | 16 drivers/macintosh/smu.c | 9 ++

[PATCH 31/41] powerpc/64: Move the boot time info banner to a separate function

2016-07-05 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/setup_64.c | 66 ++ 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index a

[PATCH 16/41] powerpc/pasemi: Remove IOBMAP allocation from platform probe()

2016-07-05 Thread Benjamin Herrenschmidt
These days, memblocks is available later, so we can just allocate it as part of iob_init. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/platforms/pasemi/iommu.c | 15 +-- arch/powerpc/platforms/pasemi/pasemi.h | 1 - arch/powerpc/platforms/

[PATCH 34/41] powerpc/32: Move cache info inits to a separate function

2016-07-05 Thread Benjamin Herrenschmidt
Matches 64-bit. Also move the call to the same spot as ppc64 Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/setup_32.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/arch/powerpc/kernel/setup_32.c

[PATCH 23/41] powerpc: Ensure that ppc_md is empty before probing for machine type

2016-07-05 Thread Benjamin Herrenschmidt
Anything in there will be overwritten, so it helps catching nasty bugs if we check that it's indeed full of NULL's before we do so. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/setup-common.c | 11 +++ 1 file changed, 11 insertions(+)

[PATCH 20/41] powerpc/mm/hash64: Don't test for machine type to detect HEA special case

2016-07-05 Thread Benjamin Herrenschmidt
Instead, check for FW_FEATURE_SPLPAR. This should be roughtly equivalent as all pseries machiens that can have an HEA also support SPLPAR and no other machine type does. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/mm/hash_utils_64.c | 5 +++-- 1 file c

[PATCH 10/41] powerpc: Add comment explaining the purpose of setup_kdump_trampoline()

2016-07-04 Thread Benjamin Herrenschmidt
Anything in early_setup() needs to be justified to be there, in this case, we need the trampolines before we can take exceptions and thus before we turn on the MMU. Also remove a pretty meaningless and misplaced debug message Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.

[PATCH 26/41] powerpc/85xx/ge_imp3a: Don't use the flat device-tree after boot

2016-07-04 Thread Benjamin Herrenschmidt
ge_imp3a_pic_init() is called way beyond the unflattening of the tree, it shouldn't be using of_flat_dt_* Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/platforms/85xx/ge_imp3a.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/p

[PATCH 27/41] powerpc/85xx/mpc85xx_ds: Don't use the flat device-tree after boot

2016-07-04 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/platforms/85xx/mpc85xx_ds.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index f858306..64a7e8c

Re: [PATCH 36/41] powerpc: Re-order setup_panic()

2016-07-04 Thread Benjamin Herrenschmidt
On Tue, 2016-07-05 at 15:04 +1000, Benjamin Herrenschmidt wrote: > Do it right after probe_machine() since it's about testing ppc_md, > and put the test in the common code. Ignore the second copy of that patch,  they are identical, my SSH tunnel broke down half way through sending the

Re: [PATCH] powerpc/pci: Fix build with PCI_IOV=y and EEH=n

2016-07-04 Thread Benjamin Herrenschmidt
On Tue, 2016-07-05 at 14:30 +1000, Russell Currey wrote: > On Tue, 2016-07-05 at 14:13 +1000, Michael Ellerman wrote: > > Despite attempting to fix this in commit fb36e9073693 > ("powerpc/pci: Fix > > SRIOV not building without EEH enabled"), the build is still broken > when > > PCI_IOV=y and

[PATCH 41/41] powerpc: Fix build with CONFIG_MEMORY_HOTPLUG on some configs

2016-07-04 Thread Benjamin Herrenschmidt
with configurations such as 64-bit BookE with CONFIG_MEMORY_HOTPLUG enabled. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/mm/mem.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 2

[PATCH 40/41] powerpc/pci: Fix build of Book3E/64 without EEH

2016-07-04 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/pci_dn.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/pci_dn.c b/arch/powerpc/kernel/pci_dn.c index ecdccce..4fc6ede 100644 --- a/arch/powerpc/

[PATCH 39/41] powerpc/mm: Fix build of Book3E/64 with 64K pages

2016-07-04 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/nohash/64/pgtable-64k.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/include/asm/nohash/64/pgtable-64k.h b/arch/powerpc/include/asm/nohash/64/pgtable-64k.h index 570fb30..9

[PATCH 38/41] powerpc: Merge 32-bit and 64-bit setup_arch()

2016-07-04 Thread Benjamin Herrenschmidt
There is little enough differences now. Use a few __weak stubs for functions that may not be around in order to avoid too many ifdefs. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v2. Fix include problems with kvm_ppc.h on some CPU archs v3. Give up on fixing i

[PATCH 37/41] powerpc/64: Make a few boot functions __init

2016-07-04 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/setup_64.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index bb1b65e..46787d9 100644 --- a/arch/powerpc/

[PATCH 36/41] powerpc: Re-order setup_panic()

2016-07-04 Thread Benjamin Herrenschmidt
Do it right after probe_machine() since it's about testing ppc_md, and put the test in the common code. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/setup-common.c | 2 ++ arch/powerpc/kernel/setup_32.c | 5 ++--- arch/powerpc/kernel/setu

[PATCH 36/41] powerpc: Re-order setup_panic()

2016-07-04 Thread Benjamin Herrenschmidt
Do it right after probe_machine() since it's about testing ppc_md, and put the test in the common code. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/setup-common.c | 2 ++ arch/powerpc/kernel/setup_32.c | 5 ++--- arch/powerpc/kernel/setu

[PATCH 35/41] powerpc: Re-order the call to smp_setup_cpu_maps()

2016-07-04 Thread Benjamin Herrenschmidt
It makes more sense to do it before intializing xmon() as xmon might use the info in there. We do want to register the console early though in case we want some functioning printk's in the cpu map setup. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/

[PATCH 29/41] powerpc: Move 32-bit probe() machine to later in the boot process

2016-07-04 Thread Benjamin Herrenschmidt
though it's a bigger patch. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v2. Fix typos v3. Fix more typos --- arch/powerpc/kernel/setup_32.c| 35 +++- arch/powerpc/platforms/40x/ep405.c| 4 +-- arch/powerpc/platfor

[PATCH 32/41] powerpc/64: Move setting of {i, d}cache_bsize to initialize_cache_info()

2016-07-04 Thread Benjamin Herrenschmidt
Also remove the completely osbolete comment. We *do* look in the device-tree. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/setup_64.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/setup_

[PATCH 30/41] powerpc: Get rid of ppc_md.init_early()

2016-07-04 Thread Benjamin Herrenschmidt
It is now called right after platform probe, so the probe function can just do the job. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/machdep.h| 1 - arch/powerpc/kernel/setup_32.c| 3 --- arch/powerpc/kernel/se

[PATCH 25/41] powerpc/cell: Don't use flat device-tree after boot

2016-07-04 Thread Benjamin Herrenschmidt
Some bit of SPU code was using the FDT rather than the expanded device-tree. Fix it. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/platforms/cell/spu_manage.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/platform

[PATCH 28/41] powerpc/85xx/mpc85xx_rdb: Don't use the flat device-tree after boot

2016-07-04 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c index 3f4dad1..761e504

[PATCH 24/41] powerpc: Move 64-bit probe_machine() to later in the boot process

2016-07-04 Thread Benjamin Herrenschmidt
We no long need the machine type that early, so we can move probe_machine() to after the device-tree has been expanded. This will allow further consolidation. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/setup_64.c | 6 +++--- arch/p

[PATCH 21/41] powerpc/pmac: Remove spurrious machine type test

2016-07-04 Thread Benjamin Herrenschmidt
pmac_declare_of_platform_devices() is already a machine initcall, thus it won't be called on a non-powermac machine. Testing for chrp there is pointless. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/platforms/powermac/setup.c | 3 --- 1 file chan

[PATCH 19/41] powerpc: Don't test for machine type in smp_setup_cpu_maps()

2016-07-04 Thread Benjamin Herrenschmidt
The subsequent test for RTAS along with the LPAR test are sufficient Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/setup-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/setup-common.c b/arch/p

[PATCH 15/41] powerpc/64: Move MMU backend selection out of platform code

2016-07-04 Thread Benjamin Herrenschmidt
We move it into early_mmu_init() based on firmware features. For PS3, we have to move the setting of these into early_init_devtree(). Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/ps3.h | 2 ++ arch/powerpc/kernel/prom.c

[PATCH 17/41] powerpc/mm/hash: Don't use machine_is() early during boot

2016-07-04 Thread Benjamin Herrenschmidt
Use the device-tree instead as we'll be moving probe_machine() out of early_setup Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/mm/hash_utils_64.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/arch/powe

[PATCH 18/41] powerpc/rtas: Don't test for machine type in rtas_initialize()

2016-07-04 Thread Benjamin Herrenschmidt
The test is unnecessary, the FW_FEATURE_LPAR is sufficient as there exist no other LPAR type that has RTAS. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/rtas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/

[PATCH 13/41] powerpc: Put exception configuration in a common place

2016-07-04 Thread Benjamin Herrenschmidt
The various calls to establish exception endianness and AIL are now done from a single point using already established CPU and FW feature bits to decide what to do. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- v3: Rework a bit, move error handling in the fun

[PATCH 07/41] powerpc: Move 64-bit memory reserves to setup_arch()

2016-07-04 Thread Benjamin Herrenschmidt
There is really no need to do them that early, early_setup() runs before MMU is on, we should do the strict minimum there to get the MMU going. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/setup_64.c | 22 +++--- 1 file chang

[PATCH 09/41] powerpc: Update obsolete comments in setup_32.c about entry conditions

2016-07-04 Thread Benjamin Herrenschmidt
form of bolted TLB on others). Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/setup_32.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index 34e61d68..3

[PATCH 08/41] powerpc: Move epapr_paravirt_early_init() to early_init_devtree()

2016-07-04 Thread Benjamin Herrenschmidt
The function is called by both 32-bit and 64-bit early setup right after early_init_devtree(). All it does is run yet another early DT parser which is precisely what early_init_devtree() is about, so move it in there. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> ---

[PATCH 03/41] powerpc/prom_init: PTRRELOC is not needed

2016-07-04 Thread Benjamin Herrenschmidt
There's one line of code still using PTRRELOC in prom_init, it shouldn't be necessary since that code is relocatable. Take it out. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/kernel/prom_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 06/41] powerpc: Move 64-bit feature fixup earlier

2016-07-04 Thread Benjamin Herrenschmidt
Make it part of early_setup() as we really want the feature fixups to be applied before we turn on the MMU since they can have an impact on the various assembly path related to MMU management and interrupts. This makes 64-bit match what 32-bit does. Signed-off-by: Benjamin Herrenschmidt &l

[PATCH 05/41] powerpc: Factor do_feature_fixup calls

2016-07-04 Thread Benjamin Herrenschmidt
32 and 64-bit do a similar set of calls early on, we move it all to a single common function to make the boot code more readable. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/feature-fixups.h | 4 arch/powerpc/include/asm/s

[PATCH 04/41] powerpc: Make PTRRELOC() 32-bit only

2016-07-04 Thread Benjamin Herrenschmidt
PTRRELOC is only used by 32-bit code since on 32-bit systems, early_init can be run with relocation off and running at an offset. Define it to identity on 64-bit Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/setup.h | 4 1 file chan

[PATCH 01/41] dt: Add of_device_compatible_match()

2016-07-04 Thread Benjamin Herrenschmidt
This provides an equivalent of of_fdt_match() for non-flat trees. This is more practical than matching an array of of_device_id structs when converting a bunch of existing users of of_fdt_match(). Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/of/base.c

[PATCH 02/41] drm: Fix broken use of _PAGE_NO_CACHE on powerpc

2016-07-04 Thread Benjamin Herrenschmidt
That constant no longer exist. Use the proper accessor instead Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- drivers/gpu/drm/drm_memory.c | 2 +- drivers/gpu/drm/drm_scatter.c | 2 +- drivers/gpu/drm/drm_vm.c | 4 ++-- 3 files changed, 4 insertions(+), 4 del

[PATCH v2 00/41] Reorganize setup code and merge 32 and 64-bit setup_arch()

2016-07-04 Thread Benjamin Herrenschmidt
This series reorganizes the setup code, moving probe_machine() later than when it's currently done, and sync'ing 32-bit and 64-bit enough to merge their implementations of setup_arch(). We get rid of ppc64 setup_system() which is subsumed by the new setup_arch(). Note: The first 2 patches could

Re: [PATCH] powerpc: fix oops in pcibios_release_device() after pcibios_free_controller()

2016-07-04 Thread Benjamin Herrenschmidt
On Mon, 2016-07-04 at 22:44 -0300, Mauricio Faria de Oliveira wrote: > It's possible to hit an oops/crash if pcibios_release_device() accesses the > phb struct and it had been freed earlier -- by pcibios_free_controller() -- > as the memory it pointed to can be reused. > > If after reuse

Re: [PATCH][v2] driver/memory: Update dependency of IFC for Layerscape

2016-07-04 Thread Benjamin Herrenschmidt
On Mon, 2016-07-04 at 11:29 +0200, Boris Brezillon wrote: > +PPC maintainers. + Scott for FSL stuff > Hi Raghav, > > Since you're touching powerpc drivers, the least you could do is add > ppc maintainers in Cc, so that they can ack/review your patch... > > On Fri, 1 Jul 2016 21:32:30 +0530 >

Re: powerpc/opal: Wake up kopald polling thread before waiting for events

2016-07-04 Thread Benjamin Herrenschmidt
On Mon, 2016-07-04 at 16:11 +1000, Michael Ellerman wrote: > On Mon, 2016-04-07 at 04:51:44 UTC, Benjamin Herrenschmidt wrote: > > On some environments (prototype machines, some simulators, etc...) > > there is no functional interrupt source to signal completion, so > > we re

[PATCH] powerpc/opal: Wake up kopald polling thread before waiting for events

2016-07-03 Thread Benjamin Herrenschmidt
the OPAL heartbeat thread before waiting for event in those cases, it will call OPAL immediately to collect completions for anything that finished fast enough. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> --- arch/powerpc/include/asm/opal.h | 2 ++ arch/p

[PATCH v2 13/38] powerpc: Put exception configuration in a common place

2016-06-29 Thread Benjamin Herrenschmidt
The various calls to establish exception endianness and AIL are now done from a single point using already established CPU and FW feature bits to decide what to do. Signed-off-by: Benjamin Herrenschmidt <b...@kernel.crashing.org> ---   v2: Add/fix prototypes of exported function, remove &

Re: [PATCH 29/38] powerpc: Move 32-bit probe() machine to later in the boot process

2016-06-28 Thread Benjamin Herrenschmidt
On Tue, 2016-06-28 at 15:25 +0200, Gerhard Pircher wrote: > > No we could just add something to early_init_devtree that does clear > > that bit if it sees the relevant piece of broken HW, it's not the AmigaOne > > per-se, it's the northbridge right ? > Does that work for CPU_FTR_NEED_COHERENT,

Re: [PATCH 29/38] powerpc: Move 32-bit probe() machine to later in the boot process

2016-06-28 Thread Benjamin Herrenschmidt
On Tue, 2016-06-28 at 13:42 +0200, Gerhard Pircher wrote: > The question is, if a compile time option that simply clear ?s > CPU_FTR_NEED_COHERENT after identify_cpu() would be acceptable. And > then I still wonder why KVM needs its own similar fix to work on the > AmigaOne. I specifically had to

Re: [PATCH 06/38] powerpc: Move 64-bit feature fixup earlier

2016-06-28 Thread Benjamin Herrenschmidt
On Tue, 2016-06-28 at 17:19 +0530, Aneesh Kumar K.V wrote: > If we can do feature fixup early. Then this patch series become > simpler. > > https://lkml.kernel.org/r/1465887288-12952-1-git-send-email-aneesh.ku > m...@linux.vnet.ibm.com > > ie, we can now start using

Re: [PATCH 07/17] powerpc/opal: Add real mode call wrappers

2016-06-28 Thread Benjamin Herrenschmidt
On Tue, 2016-06-28 at 21:37 +1000, Michael Ellerman wrote: > Yeah Ben already told me. > > I don't know which will go in first yet, this has had zero revisions and zero > reviews so it might not go in straight away ;) The point was that patch could go in independently of the rest but I really

Re: [PATCH 06/38] powerpc: Move 64-bit feature fixup earlier

2016-06-28 Thread Benjamin Herrenschmidt
On Tue, 2016-06-28 at 16:35 +0530, Aneesh Kumar K.V wrote: > Why not move it immediately after we finish all the device tress > scan. Do you need it in early_init_mmu ? The important thing is to have it done before we *turn on* the MMU but yeah, there's no big deal moving it even further up I

Re: arch/powerpc/xmon/dis-asm.h: 2 * wrong specifiers ?

2016-06-28 Thread Benjamin Herrenschmidt
On Tue, 2016-06-28 at 08:06 +0100, David Binderman wrote: > > I don't know the code, but given that insn is unsigned long and so > can go > past 32 bits, using a cast to unsigned int might throw away the > possibly important > upper bits. our instructions are only ever 32-bits. That xmon code is

Re: [PATCH 2/2] tty/hvc: Use opal irqchip interface if available

2016-06-27 Thread Benjamin Herrenschmidt
On Tue, 2016-06-28 at 13:34 +1000, Benjamin Herrenschmidt wrote: > On Tue, 2016-06-28 at 13:11 +1000, Samuel Mendoza-Jonas wrote: > > Update the hvc driver to use the OPAL irqchip if made available by > > the > > running firmware. If it is not present, the driver falls back to

<    5   6   7   8   9   10   11   12   13   14   >