Re: [PATCH V2 2/2] sched: Remove un-necessary iteration over sched domains to update nr_busy_cpus

2013-10-30 Thread Kamalesh Babulal
Hi Preeti, nr_busy_cpus parameter is used by nohz_kick_needed() to find out the number of busy cpus in a sched domain which has SD_SHARE_PKG_RESOURCES flag set. Therefore instead of updating nr_busy_cpus at every level of sched domain, since it is irrelevant, we can update this parameter only

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Paul E. McKenney
On Mon, Oct 28, 2013 at 10:58:58PM +0200, Victor Kaplansky wrote: Oleg Nesterov o...@redhat.com wrote on 10/28/2013 10:17:35 PM: mb(); // : do we really need it? I think yes. Oh, it is hard to argue with feelings. Also, it is easy to be on conservative side and put the

[b42...@freescale.com: Re: [PATCH 1/3] dma: imx-sdma: Add ssi dual fifo script support]

2013-10-30 Thread Nicolin Chen
Just found that I missed Sascha's mail address in my TO list of last reply. So resend it. And sorry for the duplicated mails. - Forwarded message from Nicolin Chen b42...@freescale.com - Date: Wed, 30 Oct 2013 12:48:48 +0800 From: Nicolin Chen b42...@freescale.com Subject: Re: [PATCH

Re: [PATCH V2 2/2] sched: Remove un-necessary iteration over sched domains to update nr_busy_cpus

2013-10-30 Thread Preeti U Murthy
Hi Kamalesh, On 10/30/2013 02:53 PM, Kamalesh Babulal wrote: Hi Preeti, nr_busy_cpus parameter is used by nohz_kick_needed() to find out the number of busy cpus in a sched domain which has SD_SHARE_PKG_RESOURCES flag set. Therefore instead of updating nr_busy_cpus at every level of sched

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Peter Zijlstra
On Tue, Oct 29, 2013 at 03:27:05PM -0400, Vince Weaver wrote: On Tue, 29 Oct 2013, Peter Zijlstra wrote: On Tue, Oct 29, 2013 at 11:21:31AM +0100, Peter Zijlstra wrote: --- linux-2.6.orig/include/uapi/linux/perf_event.h +++ linux-2.6/include/uapi/linux/perf_event.h @@ -479,13 +479,15 @@

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Peter Zijlstra
On Wed, Oct 30, 2013 at 02:27:25AM -0700, Paul E. McKenney wrote: On Mon, Oct 28, 2013 at 10:58:58PM +0200, Victor Kaplansky wrote: Oleg Nesterov o...@redhat.com wrote on 10/28/2013 10:17:35 PM: mb(); // : do we really need it? I think yes. Oh, it is hard to argue

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread James Hogan
Hi Peter, On 30/10/13 10:42, Peter Zijlstra wrote: Subject: perf, tool: Add required memory barriers To match patch bf378d341e48 (perf: Fix perf ring buffer memory ordering) change userspace to also adhere to the ordering outlined. Most barrier implementations were gleaned from

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Peter Zijlstra
On Wed, Oct 30, 2013 at 11:48:44AM +, James Hogan wrote: Hi Peter, On 30/10/13 10:42, Peter Zijlstra wrote: Subject: perf, tool: Add required memory barriers To match patch bf378d341e48 (perf: Fix perf ring buffer memory ordering) change userspace to also adhere to the ordering

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Victor Kaplansky
Paul E. McKenney paul...@linux.vnet.ibm.com wrote on 10/30/2013 11:27:25 AM: If you were to back up that insistence with a description of the orderings you are relying on, why other orderings are not important, and how the important orderings are enforced, I might be tempted to pay attention

[PATCH 1/3] powerpc/nvram: scan partitions only once

2013-10-30 Thread Cédric Le Goater
From: Cedric Le Goater c...@fr.ibm.com nvram_scan_partitions() is called twice when initializing the lnx,oops-log partition and the ibm,rtas-log partition. This fills the partition list with duplicate entries. This patch moves the partition scan in the init routine

[PATCH 0/3] nvram fixes

2013-10-30 Thread Cédric Le Goater
Hi, Here are a few fixes for nvram, mostly endian issues. The patches are based on 3.12-rc7. Cedric Le Goater (3): powerpc/nvram: scan partitions only once powerpc/nvram: fix endian issue when reading the NVRAM size powerpc/nvram: fix endian issue when reading the partition length

[PATCH 3/3] powerpc/nvram: fix endian issue when using the partition length

2013-10-30 Thread Cédric Le Goater
From: Cedric Le Goater c...@fr.ibm.com When reading partitions, the length has to be translated from big endian to the endian order of the host. Similarly, when writing partitions, the length needs to be in big endian order. The userspace tool 'nvram' needs a similar fix as it is reading and

[PATCH 2/3] powerpc/nvram: fix endian issue when reading the NVRAM size

2013-10-30 Thread Cédric Le Goater
From: Cedric Le Goater c...@fr.ibm.com Signed-off-by: Cedric Le Goater c...@fr.ibm.com --- arch/powerpc/platforms/chrp/nvram.c|4 ++-- arch/powerpc/platforms/pseries/nvram.c |4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/platforms/chrp/nvram.c

[RFC PATCH v5 00/12] Machine check handling in linux host.

2013-10-30 Thread Mahesh J Salgaonkar
Hi, Please find the patch set that performs the machine check handling inside linux host. The design is to be able to handle re-entrancy so that we do not clobber the machine check information during nested machine check interrupt. The patch 2 introduces separate emergency stack in paca

[RFC PATCH v5 02/12] powerpc/book3s: Introduce exclusive emergency stack for machine check exception.

2013-10-30 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com This patch introduces exclusive emergency stack for machine check exception. We use emergency stack to handle machine check exception so that we can save MCE information (srr1, srr0, dar and dsisr) before turning on ME bit and be ready for

[RFC PATCH v5 01/12] powerpc/book3s: Split the common exception prolog logic into two section.

2013-10-30 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com This patch splits the common exception prolog logic into three parts to facilitate reuse of existing code in the next patch. This patch also re-arranges few instructions in such a way that the second part now deals with saving register values from

[RFC PATCH v5 03/12] powerpc/book3s: handle machine check in Linux host.

2013-10-30 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com Move machine check entry point into Linux. So far we were dependent on firmware to decode MCE error details and handover the high level info to OS. This patch introduces early machine check routine that saves the MCE information (srr1, srr0, dar

[RFC PATCH v5 04/12] powerpc/book3s: Return from interrupt if coming from evil context.

2013-10-30 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com We can get machine checks from any context. We need to make sure that we handle all of them correctly. If we are coming from hypervisor user-space, we can continue in host kernel in virtual mode to deliver the MC event. If we got woken up from

[RFC PATCH v5 05/12] powerpc/book3s: Introduce a early machine check hook in cpu_spec.

2013-10-30 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com This patch adds the early machine check function pointer in cputable for CPU specific early machine check handling. The early machine handle routine will be called in real mode to handle SLB and TLB errors. We can not reuse the existing

[RFC PATCH v5 06/12] powerpc/book3s: Add flush_tlb operation in cpu_spec.

2013-10-30 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com This patch introduces flush_tlb operation in cpu_spec structure. This will help us to invoke appropriate CPU-side flush tlb routine. This patch adds the foundation to invoke CPU specific flush routine for respective architectures. Currently this

[RFC PATCH v5 07/12] powerpc/book3s: Flush SLB/TLBs if we get SLB/TLB machine check errors on power7.

2013-10-30 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com If we get a machine check exception due to SLB or TLB errors, then flush SLBs/TLBs and reload SLBs to recover. We do this in real mode before turning on MMU. Otherwise we would run into nested machine checks. If we get a machine check when we are

[RFC PATCH v5 08/12] powerpc/book3s: Flush SLB/TLBs if we get SLB/TLB machine check errors on power8.

2013-10-30 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com This patch handles the memory errors on power8. If we get a machine check exception due to SLB or TLB errors, then flush SLBs/TLBs and reload SLBs to recover. Signed-off-by: Mahesh Salgaonkar mah...@linux.vnet.ibm.com Acked-by: Paul Mackerras

[RFC PATCH v5 09/12] powerpc/book3s: Decode and save machine check event.

2013-10-30 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com Now that we handle machine check in linux, the MCE decoding should also take place in linux host. This info is crucial to log before we go down in case we can not handle the machine check errors. This patch decodes and populates a machine check

[RFC PATCH v5 10/12] powerpc/book3s: Queue up and process delayed MCE events.

2013-10-30 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com When machine check real mode handler can not continue into host kernel in V mode, it returns from the interrupt and we loose MCE event which never gets logged. In such a situation queue up the MCE event so that we can log it later when we get back

[RFC PATCH v5 11/12] powerpc/powernv: Remove machine check handling in OPAL.

2013-10-30 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com Now that we are ready to handle machine check directly in linux, do not register with firmware to handle machine check exception. Signed-off-by: Mahesh Salgaonkar mah...@linux.vnet.ibm.com --- arch/powerpc/platforms/powernv/opal.c |8

[RFC PATCH v5 12/12] powerpc/powernv: Machine check exception handling.

2013-10-30 Thread Mahesh J Salgaonkar
From: Mahesh Salgaonkar mah...@linux.vnet.ibm.com Add basic error handling in machine check exception handler. - If MSR_RI isn't set, we can not recover. - Check if disposition set to OpalMCE_DISPOSITION_RECOVERED. - Check if address at fault is inside kernel address space, if not then send

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Victor Kaplansky
Peter Zijlstra pet...@infradead.org wrote on 10/30/2013 01:25:26 PM: Also, I'm not entirely sure on C, that too seems like a dependency, we simply cannot read the buffer @tail before we've read the tail itself, now can we? Similarly we cannot compare tail to head without having the head read

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Peter Zijlstra
On Wed, Oct 30, 2013 at 04:52:05PM +0200, Victor Kaplansky wrote: Peter Zijlstra pet...@infradead.org wrote on 10/30/2013 01:25:26 PM: Also, I'm not entirely sure on C, that too seems like a dependency, we simply cannot read the buffer @tail before we've read the tail itself, now can we?

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Peter Zijlstra
On Wed, Oct 30, 2013 at 03:28:54PM +0200, Victor Kaplansky wrote: one of the authors of Documentation/memory-barriers.txt is on cc: list ;-) Disclaimer: it is anyway impossible to prove lack of *any* problem. Having said that, lets look into an example in

[PATCH] offb: make the screen properties endian safe

2013-10-30 Thread Cédric Le Goater
The screen properties : depth, width, height, linebytes need to be converted to the host endian order when read from the device tree. Signed-off-by: Cédric Le Goater c...@fr.ibm.com --- drivers/video/offb.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Victor Kaplansky
Peter Zijlstra pet...@infradead.org wrote on 10/30/2013 05:39:31 PM: Although I suppose speculative reads are allowed -- they don't have the destructive behaviour speculative writes have -- and thus we could in fact get reorder issues. I agree. But since it is still a dependent load in

Re: [PATCH 1/3] powerpc: Enable emulate_step In Little Endian Mode

2013-10-30 Thread Andreas Schwab
Tom Musta tommu...@gmail.com writes: +#ifdef __LITTLE_ENDIAN__ + if (!regs-msr MSR_LE) That won't work. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 And now for something completely different.

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Peter Zijlstra
On Wed, Oct 30, 2013 at 07:14:29PM +0200, Victor Kaplansky wrote: We need a complete rmb() here IMO. I think there is a fundamental difference between load and stores in this aspect. Load are allowed to be hoisted by compiler or executed speculatively by HW. To prevent load *(ubuf-data + tail)

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Peter Zijlstra
On Wed, Oct 30, 2013 at 04:51:16PM +0100, Peter Zijlstra wrote: On Wed, Oct 30, 2013 at 03:28:54PM +0200, Victor Kaplansky wrote: one of the authors of Documentation/memory-barriers.txt is on cc: list ;-) Disclaimer: it is anyway impossible to prove lack of *any* problem. Having said

Re: [PATCH 29/51] DMA-API: ata: pata_octeon_cf: convert to use dma_coerce_mask_and_coherent()

2013-10-30 Thread Geert Uytterhoeven
On Thu, Sep 19, 2013 at 11:54 PM, Russell King rmk+ker...@arm.linux.org.uk wrote: diff --git a/drivers/ata/pata_octeon_cf.c b/drivers/ata/pata_octeon_cf.c index c51bbb9..6231d43 100644 --- a/drivers/ata/pata_octeon_cf.c +++ b/drivers/ata/pata_octeon_cf.c @@ -1014,8 +1014,9 @@ static int

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Peter Zijlstra
On Wed, Oct 30, 2013 at 07:29:30PM +0100, Peter Zijlstra wrote: + page_shift = PAGE_SHIFT + page_order(rb); + + handle-page = (offset page_shift) (rb-nr_pages - 1); + + offset = page_shift - 1; offset = (1UL page_shift) - 1; Weird that it even appeared to work.. /me wonders

Re: [PATCH 1/3] powerpc: Enable emulate_step In Little Endian Mode

2013-10-30 Thread Tom Musta
On 10/30/2013 12:43 PM, Andreas Schwab wrote: Tom Musta tommu...@gmail.com writes: +#ifdef __LITTLE_ENDIAN__ + if (!regs-msr MSR_LE) That won't work. Andreas. Please elaborate. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org

Re: [PATCH 1/3] powerpc: Enable emulate_step In Little Endian Mode

2013-10-30 Thread Geert Uytterhoeven
On Wed, Oct 30, 2013 at 8:35 PM, Tom Musta tommu...@gmail.com wrote: On 10/30/2013 12:43 PM, Andreas Schwab wrote: Tom Musta tommu...@gmail.com writes: +#ifdef __LITTLE_ENDIAN__ + if (!regs-msr MSR_LE) That won't work. Andreas. Please elaborate. You want to test for !(regs

[PATCH v4 0/7] Getting rid of get_unused_fd()

2013-10-30 Thread Yann Droneaud
Hi, Please find the fourth revision of my patchset to remove get_unused_fd() macro in order to encourage subsystems to use get_unused_fd_flags() or anon_inode_getfd() with open flags set to O_CLOEXEC were appropriate. The patchset convert all calls to get_unused_fd() to get_unused_fd_flags(0)

[PATCH v4 2/7] ppc/cell: use get_unused_fd_flags(0) instead of get_unused_fd()

2013-10-30 Thread Yann Droneaud
Macro get_unused_fd() is used to allocate a file descriptor with default flags. Those default flags (0) can be unsafe: O_CLOEXEC must be used by default to not leak file descriptor across exec(). Instead of macro get_unused_fd(), functions anon_inode_getfd() or get_unused_fd_flags() should be

Re: [PATCH 1/3] powerpc: Enable emulate_step In Little Endian Mode

2013-10-30 Thread Tom Musta
On 10/30/2013 2:43 PM, Geert Uytterhoeven wrote: On Wed, Oct 30, 2013 at 8:35 PM, Tom Musta tommu...@gmail.com wrote: On 10/30/2013 12:43 PM, Andreas Schwab wrote: Tom Musta tommu...@gmail.com writes: +#ifdef __LITTLE_ENDIAN__ + if (!regs-msr MSR_LE) That won't work. Andreas.

Re: [PATCH v2] powerpc/mpc512x: remove unnecessary #if

2013-10-30 Thread Anatolij Gustschin
On Fri, 11 Oct 2013 10:37:38 -0700 Brian Norris computersforpe...@gmail.com wrote: Several functions are only ever referenced locally, so make them static. Of those functions, many of them are protected by an #if. However, the code which can compile fine in either case. Now that (1) the

Re: [PATCH] ADB_PMU_LED_IDE selects LEDS_TRIGGER_IDE_DISK which has unmet direct dependencies

2013-10-30 Thread Benjamin Herrenschmidt
On Tue, 2013-10-29 at 21:25 -0700, Christian Kujau wrote: On Wed, 30 Oct 2013 at 10:13, Benjamin Herrenschmidt wrote: You probably want to do that to the ADB_PMU_LED_IDE entry not the ADB_PMU_LED one which doesn't have a dependency and isn't the one selecting LEDS_TRIGGER_IDE_DISK :-)

Re: [PATCH] offb: make the screen properties endian safe

2013-10-30 Thread Benjamin Herrenschmidt
On Wed, 2013-10-30 at 17:14 +0100, Cédric Le Goater wrote: @@ -552,25 +552,25 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node) if (pp == NULL) pp = of_get_property(dp, depth, len); if (pp len == sizeof(u32)) - depth =

[Suggestion] drivers: powercap: 'dev_attrs' has already removed from 'struct class'

2013-10-30 Thread Chen Gang
Hello Maintainers It is removed by bcc8edb driver core: remove dev_attrs from struct class in Oct 5 2013. But 75d2364 PowerCap: Add class driver still use it in Oct 11 2013. The related error (for powerpc with allmodconfig): CC drivers/powercap/powercap_sys.o

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Paul E. McKenney
On Wed, Oct 30, 2013 at 04:51:16PM +0100, Peter Zijlstra wrote: On Wed, Oct 30, 2013 at 03:28:54PM +0200, Victor Kaplansky wrote: one of the authors of Documentation/memory-barriers.txt is on cc: list ;-) Disclaimer: it is anyway impossible to prove lack of *any* problem. Having said

Re: perf events ring buffer memory barrier on powerpc

2013-10-30 Thread Paul E. McKenney
On Wed, Oct 30, 2013 at 03:28:54PM +0200, Victor Kaplansky wrote: Paul E. McKenney paul...@linux.vnet.ibm.com wrote on 10/30/2013 11:27:25 AM: If you were to back up that insistence with a description of the orderings you are relying on, why other orderings are not important, and how the

Re: [PATCH 2/2] of: move definition of of_find_next_cache_node into common code.

2013-10-30 Thread Benjamin Herrenschmidt
On Wed, 2013-09-18 at 11:53 +0100, Sudeep KarkadaNagesha wrote: From: Sudeep KarkadaNagesha sudeep.karkadanage...@arm.com Since the definition of_find_next_cache_node is architecture independent, the existing definition in powerpc can be moved to driver/of/base.c Cc: Benjamin Herrenschmidt