Re: [PATCH 3/5] xhci: Add rmb() between reading event validity & event data access.

2011-03-25 Thread Segher Boessenkool
> On weakly-ordered systems, the reading of an event's content must occur > after reading the event's validity. Put a comment on the rmb() saying what it orders? Segher ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.o

[PATCH] nvram: Don't overwrite oops/panic report on normal shutdown

2011-03-25 Thread Jim Keniston
For normal halt, reboot, and poweroff events, refrain from overwriting the lnx,oops-log partition. Also, don't save the dmesg buffer on an emergency-restart event if we've already saved it earlier in panic(). Signed-off-by: Jim Keniston --- arch/powerpc/platforms/pseries/nvram.c | 24 +++

[patch 10/14] powerpc: uic: Cleanup flow type handling

2011-03-25 Thread Thomas Gleixner
The core irq_set_type() function updates the flow type when the chip callback returns 0. So setting the type is bogus. The core also updates IRQ_LEVEL. Use irq_data to get the level type information in the chip functions. Signed-off-by: Thomas Gleixner --- arch/powerpc/sysdev/uic.c | 25 +

[patch 11/14] powerpc: xilinx: Cleanup flow type handling

2011-03-25 Thread Thomas Gleixner
The core irq_set_type() function updates the flow type when the chip callback returns 0. So setting the type is bogus. The core also updates the LEVEL flag. Signed-off-by: Thomas Gleixner --- arch/powerpc/sysdev/xilinx_intc.c |6 -- 1 file changed, 6 deletions(-) Index: linux-2.6-tip/ar

[patch 09/14] powerpc: mpic: Cleanup flow type handling

2011-03-25 Thread Thomas Gleixner
The core irq_set_type() function updates the flow type when the chip callback returns 0. So setting the type is bogus. The new core code allows to update the type in irq_data and return IRQ_SET_MASK_OK_NOCOPY, so the core code will not touch it, except for setting the IRQ_LEVEL flag. Retrieve the

[patch 06/14] powerpc: cpm2_pic: Use IRQCHIP_EOI_IF_HANDLED

2011-03-25 Thread Thomas Gleixner
The core code provides the same functionality when the IRQCHIP_EOI_IF_HANDLED flag is set for the irq chip. Signed-off-by: Thomas Gleixner --- arch/powerpc/sysdev/cpm2_pic.c | 29 - 1 file changed, 12 insertions(+), 17 deletions(-) Index: linux-2.6-tip/arch/powerpc

[patch 14/14] powerpc: Use generic show_interrupts()

2011-03-25 Thread Thomas Gleixner
Signed-off-by: Thomas Gleixner --- arch/powerpc/Kconfig |2 + arch/powerpc/kernel/irq.c | 61 -- 2 files changed, 3 insertions(+), 60 deletions(-) Index: linux-2.6-tip/arch/powerpc/Kconfig

[patch 05/14] powerpc: cpm2_pic: Cleanup flow type handling

2011-03-25 Thread Thomas Gleixner
The core irq_set_type() function updates the flow type when the chip callback returns 0. So setting the type is bogus. The new core code allows to update the type in irq_data and return IRQ_SET_MASK_OK_NOCOPY, so the core code will not touch it, except for setting the IRQ_LEVEL flag. Use the prop

[patch 08/14] powerpc: mpc8xx_pic: Cleanup flow type handling

2011-03-25 Thread Thomas Gleixner
The core irq_set_type() function updates the flow type when the chip callback returns 0. So setting the type is bogus. The level flag is updated in the core as well. Use the proper accessors for setting the irq handlers. Signed-off-by: Thomas Gleixner --- arch/powerpc/sysdev/mpc8xx_pic.c |9

[patch 04/14] powerpc: cell: Fix the irq_desc access

2011-03-25 Thread Thomas Gleixner
The core irq_set_type() function updates the flow type when the chip callback returns 0. It also updates irq_data, so this can be used in irq_ack() to check for the level bit. That avoids a redundant sparse irq lookup. Signed-off-by: Thomas Gleixner --- arch/powerpc/platforms/cell/spider-pic.c |

[patch 02/14] powerpc: media5200: Remove pointless set_irq_type()

2011-03-25 Thread Thomas Gleixner
The irq chip has no irq_set_type() callback. So calling the call is pointless. Set IRQ_LEVEL via the proper accessor. Signed-off-by: Thomas Gleixner --- arch/powerpc/platforms/52xx/media5200.c |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) Index: linux-2.6-tip/arch/powerpc/platf

[patch 00/14] powerpc: Final irq bits for .39

2011-03-25 Thread Thomas Gleixner
Ben, the following series cleans up the remaining odds and ends of the powerpc irq code. It further contains a coccinelle scripted conversion of the irq functions to the new naming convention irq_*. The last patch which makes power switch to the generic show_interrupts() code selects GENERIC_IRQ_

[patch 12/14] powerpc: irq: Use irqdata based information

2011-03-25 Thread Thomas Gleixner
We want to tighten the irq_desc access. So use the new accessors for the same information. Signed-off-by: Thomas Gleixner --- arch/powerpc/kernel/irq.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) Index: linux-2.6-tip/arch/powerpc/kernel/irq.c ==

[patch 07/14] powerpc: ipic: Cleanup flow type handling

2011-03-25 Thread Thomas Gleixner
The core irq_set_type() function updates the flow type when the chip callback returns 0. So setting the type is bogus. The new core code allows to update the type in irq_data and return IRQ_SET_MASK_OK_NOCOPY, so the core code will not touch it, except for setting the IRQ_LEVEL flag. Use the prop

[patch 03/14] powerpc: mac: pic: Use irqd_is_level_type()

2011-03-25 Thread Thomas Gleixner
No need for a redundant sparse irq lookup. irqdata provides the same information. Signed-off-by: Thomas Gleixner --- arch/powerpc/platforms/powermac/pic.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-2.6-tip/arch/powerpc/platforms/powermac/pic.c

[patch 01/14] powerpc: Use proper accessors for IRQ_* flags

2011-03-25 Thread Thomas Gleixner
Use the proper accessors instead of open access to irq_desc. Converted with coccinelle. Signed-off-by: Thomas Gleixner --- arch/powerpc/kernel/irq.c|2 +- arch/powerpc/platforms/512x/mpc5121_ads_cpld.c |2 +- arch/powerpc/platforms/82xx/pq2ads-pci-pic.c |

[PATCH] powerpc: Add Initiate Coprocessor Store Word (icswx) support

2011-03-25 Thread Anton Blanchard
From: Tseng-Hui (Frank) Lin Icswx is a PowerPC instruction to send data to a co-processor. On Book-S processors the LPAR_ID and process ID (PID) of the owning process are registered in the window context of the co-processor at initialization time. When the icswx instruction is executed the L2 gen

Re: High load average (~2.0) on an idle PowerPC 64 machine

2011-03-25 Thread Nathan Lynch
On Fri, 2011-03-25 at 09:23 +, David Laight wrote: > We also have the related fubar (on x64/amd64) of the > kernel generating stack traces for processes that are > sleeping uninterruptibly for long periods. Turn off CONFIG_DETECT_HUNG_TASK? ___ Lin

[PATCH] POWER: perf_event: Skip updating kernel counters if register value shrinks

2011-03-25 Thread Eric B Munson
It is possible on POWER7 for some perf events to have values decrease. This causes a problem with the way the kernel counters are updated. Deltas are computed and then stored in a 64 bit value while the registers are 32 bits wide so if new value is smaller than previous value, the delta is a very

Re: [BUG] pgprot_noncached() is -NOT- safe for mapping vmalloc buffers into userspace

2011-03-25 Thread Takashi Iwai
At Fri, 25 Mar 2011 21:23:26 +1100, Benjamin Herrenschmidt wrote: > > On Fri, 2011-03-25 at 11:12 +0100, Takashi Iwai wrote: > > At Fri, 25 Mar 2011 20:15:33 +1100, > > Benjamin Herrenschmidt wrote: > > > > > > > > We > > > > > must also make sure we don't go down that path for vmalloc memory > >

Re: [PATCH 5/5] xhci: Remove recursive call to xhci_handle_event

2011-03-25 Thread Sergei Shtylyov
Hello. On 25-03-2011 10:44, Matt Evans wrote: Make the caller loop while there are events to handle, instead. Signed-off-by: Matt Evans --- drivers/usb/host/xhci-ring.c | 16 +--- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b

Re: [BUG] pgprot_noncached() is -NOT- safe for mapping vmalloc buffers into userspace

2011-03-25 Thread Benjamin Herrenschmidt
On Fri, 2011-03-25 at 11:12 +0100, Takashi Iwai wrote: > At Fri, 25 Mar 2011 20:15:33 +1100, > Benjamin Herrenschmidt wrote: > > > > > > We > > > > must also make sure we don't go down that path for vmalloc memory > > > > though. > > > > > > Yes. > > > > I haven't actually checked, but I assume t

Re: ALSA: vmalloc buffers should use normal mmap

2011-03-25 Thread Takashi Iwai
At Fri, 25 Mar 2011 17:51:54 +1100, Benjamin Herrenschmidt wrote: > > It's a big no-no to use pgprot_noncached() when mmap'ing such buffers > into userspace since they are mapped cachable in kernel space. > > This can cause all sort of interesting things ranging from to garbled > sound to lockups

Re: [BUG] pgprot_noncached() is -NOT- safe for mapping vmalloc buffers into userspace

2011-03-25 Thread Takashi Iwai
At Fri, 25 Mar 2011 20:15:33 +1100, Benjamin Herrenschmidt wrote: > > > > We > > > must also make sure we don't go down that path for vmalloc memory > > > though. > > > > Yes. > > I haven't actually checked, but I assume that the test > > substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV > >

Re: How to define an I2C-to-SPI bridge device ?

2011-03-25 Thread Andre Schwarz
Grant, Anton, we're about to get new MPC8377 based hardware with various peripherals. There are two I2C-to-SPI bridge devices (NXP SC18IS602) and I'm not sure how to define a proper dts... Of course it's an easy thing creating 2 child nodes on the CPU's I2C device - but how can I represent the

High load average (~2.0) on an idle PowerPC 64 machine

2011-03-25 Thread David Laight
> I've this Quad G5 machine that's sitting pretty much idle with the > latest Debian stable installed, and yet it's got an abnormaly high > load average. The 'load average' value is rather useless since it seems to contain any process that is sleeping uninterruptibly, and IIRC any process that has

Re: High load average (~2.0) on an idle PowerPC 64 machine

2011-03-25 Thread Benjamin Herrenschmidt
On Thu, 2011-03-24 at 21:23 +0100, Romain Goyet wrote: > I there, > > I've this Quad G5 machine that's sitting pretty much idle with the > latest Debian stable installed, and yet it's got an abnormaly high > load average. > I've detailed the situation over here, maybe you guys will find it > inte

Re: [BUG] pgprot_noncached() is -NOT- safe for mapping vmalloc buffers into userspace

2011-03-25 Thread Benjamin Herrenschmidt
On Fri, 2011-03-25 at 09:01 +0100, Takashi Iwai wrote: > > In fact, cache coherent architectures often don't support mapping memory > > uncached -at-all- so something like snd_pcm_lib_mmap_noncached() > > shouldn't exist, or at least be under arch control. There's no case > > where it's "always saf

Re: [PATCH] powerpc: Implement dma_mmap_coherent()

2011-03-25 Thread Takashi Iwai
At Fri, 25 Mar 2011 20:11:57 +1100, Benjamin Herrenschmidt wrote: > > On Fri, 2011-03-25 at 09:06 +0100, Takashi Iwai wrote: > > > @@ -52,6 +53,7 @@ extern void __dma_sync_page(struct page *page, > > unsigned long offset, > > > #define __dma_free_coherent(size, addr) ((void)0) > > >

Re: [PATCH] powerpc: Implement dma_mmap_coherent()

2011-03-25 Thread Benjamin Herrenschmidt
On Fri, 2011-03-25 at 09:06 +0100, Takashi Iwai wrote: > > @@ -52,6 +53,7 @@ extern void __dma_sync_page(struct page *page, > unsigned long offset, > > #define __dma_free_coherent(size, addr) ((void)0) > > #define __dma_sync(addr, size, rw) ((void)0) > > #define __dma_sync

Early kernel debugging

2011-03-25 Thread Guillaume Dargaud
Hello all, what can you do when the kernel you try to run stops before printing anything on the console ? I tried enabling the 'early printk' option, but still I get nothing. I posted something about it in the 'Booting with ramdisk in kernel' message and I haven't improved the situation since

Re: hvc_console: Don't access hvc_task if not initialised

2011-03-25 Thread Amit Shah
On (Thu) 24 Mar 2011 [08:58:04], Milton Miller wrote: > On Thu, 24 Mar 2011 07:29:58 -, Amit Shah wrote: > > hvc_open() can be called without having any backing device. This > > results in a call to hvc_kick() which calls wake_up_process on a NULL > > pointer. > > How is hvc_open called wit

Re: [PATCH] powerpc: Implement dma_mmap_coherent()

2011-03-25 Thread Takashi Iwai
At Fri, 25 Mar 2011 17:50:06 +1100, Benjamin Herrenschmidt wrote: > > This is used by Alsa to mmap buffers allocated with dma_alloc_coherent() > into userspace. We need a special variant to handle machines with > non-coherent DMAs as those buffers have "special" virt addresses and > require non-ca

Re: [BUG] pgprot_noncached() is -NOT- safe for mapping vmalloc buffers into userspace

2011-03-25 Thread Takashi Iwai
At Fri, 25 Mar 2011 09:16:48 +1100, Benjamin Herrenschmidt wrote: > > Hi Takashi ! > > While working on endian-fixing xHCI with Matt (CC), we discovered the > source of our problems with usb-audio on a board we were working on. > > c32d977b8157bf67cdf47729ce7dd054a26eb534 > "ALSA: pcm - Call pgp

[PATCH 5/5] xhci: Remove recursive call to xhci_handle_event

2011-03-25 Thread Matt Evans
Make the caller loop while there are events to handle, instead. Signed-off-by: Matt Evans --- drivers/usb/host/xhci-ring.c | 16 +--- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index b46efd9..97bedd6 10

[PATCH 4/5] xhci: Add an assertion to check for virt_dev=0 bug.

2011-03-25 Thread Matt Evans
During a "plug-unplug" stress test on an NEC xHCI card, a null pointer dereference was observed. xhci_address_device() dereferenced a null virt_dev (possibly an erroneous udev->slot_id?); this patch adds a WARN_ON & message to aid debug if it can be recreated. Signed-off-by: Matt Evans --- driv

[PATCH 3/5] xhci: Add rmb() between reading event validity & event data access.

2011-03-25 Thread Matt Evans
On weakly-ordered systems, the reading of an event's content must occur after reading the event's validity. Signed-off-by: Matt Evans --- drivers/usb/host/xhci-ring.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ri

[PATCH 2/5] xhci: Extend debug messages

2011-03-25 Thread Matt Evans
Add more debug to print queued transfers, show control intentions and modify an existing message to hexify address output. Signed-off-by: Matt Evans --- drivers/usb/host/xhci-dbg.c |2 +- drivers/usb/host/xhci-hub.c |3 +++ drivers/usb/host/xhci-ring.c |5 + 3 files changed, 9

[PATCH 0/5] Make xHCI driver endian-safe, add a barrier, some debug

2011-03-25 Thread Matt Evans
Hi Sarah, This series addresses the endian issues with the xHCI driver, and has brought lovely USB 3 to PPC. :-) I've tested various types of traffic on ppc4xx and POWER7 and (some sound driver bugs notwithstanding) all seems fine. Also addresses an ordering problem we found and the recursive n