[PATCH] powerpc/nohash: Allocate stale_map[cpu] on CPU_UP_PREPARE not CPU_ONLINE

2011-04-04 Thread Michael Ellerman
Currently we allocate the stale_map for a cpu when it comes online, this leaves open a small window where a process can be scheduled on the cpu before the stale_map is allocated. Instead allocate the stale_map at CPU_UP_PREPARE time, that way it will be always available before tasks start running.

Re: [PATCH 15/15] powerpc: Improve prom_printf()

2011-04-04 Thread Benjamin Herrenschmidt
On Tue, 2011-04-05 at 08:47 +0200, Segher Boessenkool wrote: > Hi Ben, > > > + case 'd': > > + ++q; > > + vs = va_arg(args, long); > > 'd' takes an int, not a long. Oops :-) Indeed ... copy/lpaste bogon I think > > + if (vs < 0) {

Re: [PATCH 02/15] powerpc/rtas: Check RTAS presence when testing indicators

2011-04-04 Thread Benjamin Herrenschmidt
> Why? of_get_property() returns NULL if np is NULL, implemented in > of_find_property(). It doesn't look like a fast path. Fun... not sure, I though I had a problem but maybe I don't remember properly :-) Cheers, Ben. ___ Linuxppc-dev mailing list L

Re: [PATCH 04/15] powerpc: Define CPU feature for Architected 2.06 HV mode

2011-04-04 Thread Benjamin Herrenschmidt
On Tue, 2011-04-05 at 16:30 +1000, Michael Neuling wrote: > In message <1301984051-18413-5-git-send-email-b...@kernel.crashing.org> you > wrote: > > This bit indicates that we are operating in hypervisor mode on a CPU > > compliant to architecture 2.06 or later (currently server only). > > > > We

Re: [PATCH 15/15] powerpc: Improve prom_printf()

2011-04-04 Thread Segher Boessenkool
Hi Ben, > + case 'd': > + ++q; > + vs = va_arg(args, long); 'd' takes an int, not a long. > + if (vs < 0) { > + prom_print("-"); RELOC()? Segher ___

Re: [PATCH] mm: Check we have the right vma in access_process_vm()

2011-04-04 Thread Michel Lespinasse
On Mon, Apr 4, 2011 at 11:24 PM, Michael Ellerman wrote: > In access_process_vm() we need to check that we have found the right > vma, not the following vma, before we try to access it. Otherwise > we might call the vma's access routine with an address which does > not fall inside the vma. > > Sig

Re: [RFC/PATCH] of: Match PCI devices to OF nodes generically

2011-04-04 Thread Benjamin Herrenschmidt
> > The benefit is that all archs now get the matching for free. There's one > > hook the arch might want to provide to match a PHB bus to its device > > node. A default weak implementation is provided that looks for the > > parent device device node, but it's not entirely reliable on powerpc for

Re: [PATCH 02/15] powerpc/rtas: Check RTAS presence when testing indicators

2011-04-04 Thread Michael Ellerman
On Tue, 2011-04-05 at 16:13 +1000, Benjamin Herrenschmidt wrote: > Signed-off-by: Benjamin Herrenschmidt > --- > arch/powerpc/kernel/rtas.c |2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c > index 2097f2b..c2bf

Re: [PATCH 04/15] powerpc: Define CPU feature for Architected 2.06 HV mode

2011-04-04 Thread Michael Neuling
In message <1301984051-18413-5-git-send-email-b...@kernel.crashing.org> you wrote: > This bit indicates that we are operating in hypervisor mode on a CPU > compliant to architecture 2.06 or later (currently server only). > > We set it on POWER7 and have a boot-time CPU setup function that > clear

[PATCH] powerpc/nohash: Allocate stale_map[cpu] on CPU_UP_PREPARE not CPU_ONLINE

2011-04-04 Thread Michael Ellerman
Currently we allocate the stale_map for a cpu when it comes online, this leaves open a small window where a process can be scheduled on the cpu before the stale_map is allocated. Instead allocate the stale_map at CPU_UP_PREPARE time, that way it will be always available before tasks start running.

[PATCH] powerpc/book3e: Fix extlb size

2011-04-04 Thread Michael Ellerman
The calculation of the size for the exception save area of the TLB miss handler is wrong, luckily it's too big not too small. Rework it to make it a bit clearer, and also correct. We want 3 save areas, each EX_TLB_SIZE _bytes_. Signed-off-by: Michael Ellerman --- arch/powerpc/include/asm/paca.h

[PATCH] mm: Check we have the right vma in access_process_vm()

2011-04-04 Thread Michael Ellerman
In access_process_vm() we need to check that we have found the right vma, not the following vma, before we try to access it. Otherwise we might call the vma's access routine with an address which does not fall inside the vma. Signed-off-by: Michael Ellerman --- mm/memory.c |2 +- 1 files cha

Re: [PATCH] powerpc/85xx: Don't add disabled PCIe devices

2011-04-04 Thread Kumar Gala
On Mar 31, 2011, at 2:01 AM, Prabhakar Kushwaha wrote: > PCIe nodes with the property status="disabled" are not usable and so > avoid adding "disabled" PCIe bridge with the system. > > Signed-off-by: Prabhakar Kushwaha > Acked-by: Kumar Gala > --- > Based upon > git://git.kernel.org/pub/scm/l

[PATCH 04/15] powerpc: Define CPU feature for Architected 2.06 HV mode

2011-04-04 Thread Benjamin Herrenschmidt
This bit indicates that we are operating in hypervisor mode on a CPU compliant to architecture 2.06 or later (currently server only). We set it on POWER7 and have a boot-time CPU setup function that clears it if MSR:HV isn't set (booting under a hypervisor). Signed-off-by: Benjamin Herrenschmidt

[PATCH 14/15] powerpc: Perform an isync to synchronize CPUs coming out of secondary_hold

2011-04-04 Thread Benjamin Herrenschmidt
We need to do that to guarantee they see any code change done by dynamic patching during boot. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/head_64.S |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/hea

[PATCH 08/15] powerpc: Always use SPRN_SPRG_HSCRATCH0 when running in HV mode

2011-04-04 Thread Benjamin Herrenschmidt
From: Paul Mackerras This uses feature sections to arrange that we always use HSPRG1 as the scratch register in the interrupt entry code rather than SPRG2 when we're running in hypervisor mode on POWER7. This will ensure that we don't trash the guest's SPRG2 when we are running KVM guests. To s

[PATCH 15/15] powerpc: Improve prom_printf()

2011-04-04 Thread Benjamin Herrenschmidt
Adds the ability to print decimal numbers and adds some more format string variants Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/prom_init.c | 26 +- 1 files changed, 25 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/prom_init.c b/arch/

[PATCH 13/15] powerpc: Add NAP mode support on Power7 in HV mode

2011-04-04 Thread Benjamin Herrenschmidt
Wakeup comes from the system reset handler with a potential loss of the non-hypervisor CPU state. We save the non-volatile state on the stack and a pointer to it in the PACA, which the system reset handler uses to restore things Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/

[PATCH 11/15] powerpc: Call CPU ->restore callback earlier on secondary CPUs

2011-04-04 Thread Benjamin Herrenschmidt
We do it before we loop on the PACA start flag. This way, we get a chance to set critical SPRs on all CPUs before Linux tries to start them up, which avoids problems when changing some bits such as LPCR bits that need to be identical on all threads of a core or similar things like that. Ideally, so

[PATCH 10/15] powerpc: Initialize TLB and LPID register on HV mode Power7

2011-04-04 Thread Benjamin Herrenschmidt
In case entry from the bootloader isn't "clean" Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/cpu_setup_power7.S | 18 ++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kernel/cpu_setup_power7.S b/arch/powerpc/kernel/cpu_setup_powe

[PATCH 06/15] powerpc: Base support for exceptions using HSRR0/1

2011-04-04 Thread Benjamin Herrenschmidt
Pass the register type to the prolog, also provides alternate "HV" version of hardware interrupt (0x500) and adjust LPES accordingly We tag those interrupts by setting bit 0x2 in the trap number Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/exception-64s.h | 65

[PATCH 12/15] powerpc: Properly handshake CPUs going out of boot spin loop

2011-04-04 Thread Benjamin Herrenschmidt
We need to wait a bit for them to have done their CPU setup or we might end up with translation and EE on with different LPCR values between threads Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/smp.h |1 + arch/powerpc/kernel/head_64.S | 18 +- arch/p

[PATCH 09/15] powerpc: Initialize LPCR:DPFD on power7 to a sane default

2011-04-04 Thread Benjamin Herrenschmidt
This sets the default data stream prefetch size for operating systems that don't set their own value in DSCR. We use 4 which is "medium". Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/cpu_setup_power7.S |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git

[PATCH 03/15] powerpc/xics: Make sure we have a sensible default distribution server

2011-04-04 Thread Benjamin Herrenschmidt
Even when nothing is specified in the device tree, and despite the fact that we don't setup links properly yet, we still need a reasonable value in there or some interrupts won't be setup properly to point to an existing processor. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/sysdev/xi

[PATCH 07/15] powerpc: More work to support HV exceptions

2011-04-04 Thread Benjamin Herrenschmidt
Rework exception macros a bit to split offset from vector and add some basic support for HDEC, HDSI, HISI and a few more. Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/exception-64s.h | 37 arch/powerpc/include/asm/feature-fixups.h |2 +- arch/powerpc/ker

[PATCH 05/15] powerpc: In HV mode, use HSPRG0 for PACA

2011-04-04 Thread Benjamin Herrenschmidt
When running in Hypervisor mode (arch 2.06 or later), we store the PACA in HSPRG0 instead of SPRG1. The architecture specifies that SPRGs may be lost during a "nap" power management operation (though they aren't currently on POWER7) and this enables use of SPRG1 by KVM guests. Signed-off-by: Benja

[PATCH 02/15] powerpc/rtas: Check RTAS presence when testing indicators

2011-04-04 Thread Benjamin Herrenschmidt
Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/rtas.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c index 2097f2b..c2bfc4d 100644 --- a/arch/powerpc/kernel/rtas.c +++ b/arch/powerpc/kernel/rtas.c @@

[PATCH 01/15] powerpc: Add more Power7 specific definitions

2011-04-04 Thread Benjamin Herrenschmidt
This adds more SPR definitions used on newer processors when running in hypervisor mode. Along with some other P7 specific bits and pieces Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/include/asm/ppc_asm.h |1 + arch/powerpc/include/asm/reg.h | 46

[PATCHES] Bits and pieces for Power7 support in HV mode

2011-04-04 Thread Benjamin Herrenschmidt
Here's a patch series which adds bits and pieces (and in some case not directly related cleanups that will be useful for the upcoming platform that uses that stuff) to allow running a recent CPU in hypervisor mode. It applies on top of the few cleanups and the XICS rewrite I've already posted and

[git pull] Please pull powerpc.git merge branch

2011-04-04 Thread Kumar Gala
The following changes since commit c0bb9e45f3a7f67fc358946727bc3d5f23d0f55d: kdump: Allow shrinking of kdump region to be overridden (2011-04-01 16:14:30 +1100) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/galak/powerpc.git merge Kumar Gala (1):

Re: [RFC/PATCH] of: Match PCI devices to OF nodes generically

2011-04-04 Thread Grant Likely
On Mon, Apr 04, 2011 at 05:37:44PM +1000, Benjamin Herrenschmidt wrote: > > > Nice, looks like I forgot to add the new drivers/pci/of.c file :-) > > Here's a new patch. Also added linux-pci to the CC list. > > And this one removes a lot more cruft from the powermac code while at > it, and moves t

Re: [RFC/PATCH] of: Match PCI devices to OF nodes generically

2011-04-04 Thread Benjamin Herrenschmidt
On Mon, 2011-04-04 at 09:25 -0600, Bjorn Helgaas wrote: > Some of this is reminiscent of the ACPI/PCI binding we do on x86/ia64, > e.g., acpi_get_pci_dev() and the stuff in drivers/acpi/glue.c. Have > you looked at that to see if there's any hope of covering both OF and > ACPI with something more

Revert 737a3bb9416ce2a7c7a4170852473a4fcc9c67e8 ?

2011-04-04 Thread Gabriel Paubert
Hi, I've had the following funny crashes on PPC machines, with cataleptic X server as a consequence: kernel: [drm] Setting GART location based on new memory map kernel: Oops: Exception in kernel mode, sig: 4 [#1] kernel: CHRP kernel: last sysfs file: /sys/devices/pci0001:01/0001:01:08.0/r

Re: Pegasos i8042 broken again

2011-04-04 Thread pacman
Gabriel Paubert writes: > > Ok, I got fed up about it. The patch referred above is obviously wrong since > it leaves interrupts at 0 when a device_type or name of 8042 is found, > so what about the following? Looks like the workaround I was using for a while. In the original report I said I was

Re: Pegasos i8042 broken again

2011-04-04 Thread Gabriel Paubert
On Tue, Apr 05, 2011 at 08:28:50AM +1000, Benjamin Herrenschmidt wrote: > > > Ok, I got fed up about it. The patch referred above is obviously wrong since > > it leaves interrupts at 0 when a device_type or name of 8042 is found, > > so what about the following? > > > > I can ship it with a sign

Re: Pegasos i8042 broken again

2011-04-04 Thread Gabriel Paubert
On Sun, Oct 10, 2010 at 06:35:47PM +1100, Benjamin Herrenschmidt wrote: > On Sat, 2010-10-09 at 20:37 -0500, pac...@kosh.dhis.org wrote: > > Pegasos has no keyboard again. I blame commit > > 540c6c392f01887dcc96bef0a41e63e6c1334f01, which tries to find i8042 IRQs in > > the device-tree but doesn't

Re: Pegasos i8042 broken again

2011-04-04 Thread Benjamin Herrenschmidt
> Ok, I got fed up about it. The patch referred above is obviously wrong since > it leaves interrupts at 0 when a device_type or name of 8042 is found, > so what about the following? > > I can ship it with a signed-off-by and proper comments a bit later if people > agree. > > Compiled and test

Re: [RFC/PATCH] of: Match PCI devices to OF nodes generically

2011-04-04 Thread Benjamin Herrenschmidt
On Mon, 2011-04-04 at 09:25 -0600, Bjorn Helgaas wrote: > > Some of this is reminiscent of the ACPI/PCI binding we do on x86/ia64, > e.g., acpi_get_pci_dev() and the stuff in drivers/acpi/glue.c. Have > you looked at that to see if there's any hope of covering both OF and > ACPI with something mo

Re: [RFC/PATCH] of: Match PCI devices to OF nodes generically

2011-04-04 Thread David Miller
From: Benjamin Herrenschmidt Date: Tue, 05 Apr 2011 07:03:17 +1000 > On Mon, 2011-04-04 at 00:48 -0700, David Miller wrote: >> From: Benjamin Herrenschmidt >> Date: Mon, 04 Apr 2011 13:27:10 +1000 >> >> > +struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus) >> > +{ >> > +

Re: [RFC/PATCH] of: Match PCI devices to OF nodes generically

2011-04-04 Thread Benjamin Herrenschmidt
On Mon, 2011-04-04 at 00:48 -0700, David Miller wrote: > From: Benjamin Herrenschmidt > Date: Mon, 04 Apr 2011 13:27:10 +1000 > > > +struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus) > > +{ > > + /* This should only be called for PHBs */ > > + if (WARN_ON(bus->self || b

Re: problem PCIe LSI detected at 32 device addresses (ppc460ex)

2011-04-04 Thread Grant Likely
On Sun, Apr 03, 2011 at 06:22:13PM -0500, Ayman El-Khashab wrote: > > On Sun, Apr 03, 2011 at 04:09:26PM -0600, Grant Likely wrote: > > On Sun, Apr 3, 2011 at 3:52 PM, Benjamin Herrenschmidt > > wrote: > > > > > >> Ok, I've narrowed the scope of the problem some. ?I moved forward > > >> to a more

Re: [RFC/PATCH] of: Match PCI devices to OF nodes generically

2011-04-04 Thread Bjorn Helgaas
On Mon, Apr 4, 2011 at 1:37 AM, Benjamin Herrenschmidt wrote: > powerpc has two different ways of matching PCI devices to their > corresponding OF node (if any) for historical reasons. The ppc64 one > does a scan looking for matching bus/dev/fn, while the ppc32 one does a > scan looking only for

Re: [PATCH v13 08/10] USB ppc4xx: Add Synopsys DWC OTG PCD interrupt function

2011-04-04 Thread Felipe Balbi
On Sun, Apr 03, 2011 at 04:17:13PM -0700, tma...@apm.com wrote: > +void start_next_request(struct pcd_ep *ep) this will probably cause namespace clashes at some point. prepent with dwc_ or make it static. -- balbi ___ Linuxppc-dev mailing list Linuxppc

Re: [PATCH v13 09/10] USB ppc4xx: Add Synopsys DWC OTG driver kernel configuration and Makefile

2011-04-04 Thread Felipe Balbi
On Sun, Apr 03, 2011 at 04:17:24PM -0700, tma...@apm.com wrote: > From: Tirumala Marri > > Add Synopsys DesignWare HS USB OTG driver kernel configuration. > Synopsys OTG driver may operate in host only, device only, or OTG mode. > The driver also allows user configure the core to use its interna

Re: [PATCH v13 07/10] USB/ppc4xx: Add Synopsys DWC OTG PCD function

2011-04-04 Thread Felipe Balbi
Hi, On Sun, Apr 03, 2011 at 04:17:10PM -0700, tma...@apm.com wrote: > +static const struct usb_gadget_ops dwc_otg_pcd_ops = { > + .get_frame = dwc_otg_pcd_get_frame, > + .wakeup = dwc_otg_pcd_wakeup, > + /* not selfpowered */ will you really have a board running this top operating sys

Re: [PATCH v13 03/10] USB/ppc4xx: Add Synopsys DWC OTG Core Interface Layer (CIL)

2011-04-04 Thread Felipe Balbi
Hi, On Sun, Apr 03, 2011 at 04:16:53PM -0700, tma...@apm.com wrote: > +const char *op_state_str(enum usb_otg_state state) please don't introduce yet another version of this. Make the ones available generic. Place a static inline const char *otg_state_string(struct otg_transceiver *x) on include/l

Re: [PATCH v13 02/10] USB/ppc4xx: Add Synopsys DWC OTG driver framework

2011-04-04 Thread Felipe Balbi
On Sun, Apr 03, 2011 at 04:16:50PM -0700, tma...@apm.com wrote: > From: Tirumala Marri > > Platform probing is in dwc_otg_apmppc.c. > Driver parameter and parameter checking are in dwc_otg_param.c. > > Signed-off-by: Tirumala R Marri > Signed-off-by: Fushen Chen > Signed-off-by: Mark Miesfeld

Re: [RFC/PATCH] of: Match PCI devices to OF nodes generically

2011-04-04 Thread David Miller
From: Benjamin Herrenschmidt Date: Mon, 04 Apr 2011 13:27:10 +1000 > +struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus) > +{ > + /* This should only be called for PHBs */ > + if (WARN_ON(bus->self || bus->parent)) > + return NULL; This WARN_ON() will al

Re: [RFC/PATCH] of: Match PCI devices to OF nodes generically

2011-04-04 Thread Benjamin Herrenschmidt
> Nice, looks like I forgot to add the new drivers/pci/of.c file :-) > Here's a new patch. Also added linux-pci to the CC list. And this one removes a lot more cruft from the powermac code while at it, and moves the core matching logic to drivers/of/of_pci.c... >From 917ea61d6afcf443ca467d0a6ffa