Re: [PATCH 1/4] powerpc: Dynamic DMA zone limits

2014-10-13 Thread Anton Blanchard
Hi Scott,

 Platform code can call limit_zone_pfn() to set appropriate limits
 for ZONE_DMA and ZONE_DMA32, and dma_direct_alloc_coherent() will
 select a suitable zone based on a device's mask and the pfn limits
 that platform code has configured.

This patch breaks my POWER8 box:

ipr 0001:08:00.0: Using 64-bit DMA iommu bypass
ipr 0001:08:00.0: dma_direct_alloc_coherent: No suitable zone for pfn 0x1
ipr 0001:08:00.0: Couldn't allocate enough memory for device driver! 
ipr: probe of 0001:08:00.0 failed with error -12

ipr isn't setting a coherent mask, but we shouldn't care on these boxes.
Could we ignore the coherent mask or copy the dma mask to it?

Anton
--

 Signed-off-by: Scott Wood scottw...@freescale.com
 Cc: Shaohui Xie shaohui@freescale.com
 ---
  arch/powerpc/Kconfig   |  4 +++
  arch/powerpc/include/asm/pgtable.h |  3 ++
  arch/powerpc/kernel/dma.c  | 20 +
  arch/powerpc/mm/mem.c  | 61
 ++ 4 files changed, 83
 insertions(+), 5 deletions(-)
 
 diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
 index 80b94b0..56dc47a 100644
 --- a/arch/powerpc/Kconfig
 +++ b/arch/powerpc/Kconfig
 @@ -286,6 +286,10 @@ config PPC_EMULATE_SSTEP
   bool
   default y if KPROBES || UPROBES || XMON || HAVE_HW_BREAKPOINT
  
 +config ZONE_DMA32
 + bool
 + default y if PPC64
 +
  source init/Kconfig
  
  source kernel/Kconfig.freezer
 diff --git a/arch/powerpc/include/asm/pgtable.h
 b/arch/powerpc/include/asm/pgtable.h index d98c1ec..6d74167 100644
 --- a/arch/powerpc/include/asm/pgtable.h
 +++ b/arch/powerpc/include/asm/pgtable.h
 @@ -4,6 +4,7 @@
  
  #ifndef __ASSEMBLY__
  #include linux/mmdebug.h
 +#include linux/mmzone.h
  #include asm/processor.h   /* For TASK_SIZE */
  #include asm/mmu.h
  #include asm/page.h
 @@ -281,6 +282,8 @@ extern unsigned long empty_zero_page[];
  
  extern pgd_t swapper_pg_dir[];
  
 +void limit_zone_pfn(enum zone_type zone, unsigned long max_pfn);
 +int dma_pfn_limit_to_zone(u64 pfn_limit);
  extern void paging_init(void);
  
  /*
 diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
 index ee78f6e..dfd99ef 100644
 --- a/arch/powerpc/kernel/dma.c
 +++ b/arch/powerpc/kernel/dma.c
 @@ -40,6 +40,26 @@ void *dma_direct_alloc_coherent(struct device
 *dev, size_t size, #else
   struct page *page;
   int node = dev_to_node(dev);
 + u64 pfn = (dev-coherent_dma_mask  PAGE_SHIFT) + 1;
 + int zone;
 +
 + zone = dma_pfn_limit_to_zone(pfn);
 + if (zone  0) {
 + dev_err(dev, %s: No suitable zone for pfn %#llx\n,
 + __func__, pfn);
 + return NULL;
 + }
 +
 + switch (zone) {
 + case ZONE_DMA:
 + flag |= GFP_DMA;
 + break;
 +#ifdef CONFIG_ZONE_DMA32
 + case ZONE_DMA32:
 + flag |= GFP_DMA32;
 + break;
 +#endif
 + };
  
   /* ignore region specifiers */
   flag  = ~(__GFP_HIGHMEM);
 diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
 index e0f7a18..3b23e17 100644
 --- a/arch/powerpc/mm/mem.c
 +++ b/arch/powerpc/mm/mem.c
 @@ -261,6 +261,54 @@ static int __init mark_nonram_nosave(void)
   return 0;
  }
  
 +static bool zone_limits_final;
 +
 +static unsigned long max_zone_pfns[MAX_NR_ZONES] = {
 + [0 ... MAX_NR_ZONES - 1] = ~0UL
 +};
 +
 +/*
 + * Restrict the specified zone and all more restrictive zones
 + * to be below the specified pfn.  May not be called after
 + * paging_init().
 + */
 +void __init limit_zone_pfn(enum zone_type zone, unsigned long
 pfn_limit) +{
 + int i;
 +
 + if (WARN_ON(zone_limits_final))
 + return;
 +
 + for (i = zone; i = 0; i--) {
 + if (max_zone_pfns[i]  pfn_limit)
 + max_zone_pfns[i] = pfn_limit;
 + }
 +}
 +
 +/*
 + * Find the least restrictive zone that is entirely below the
 + * specified pfn limit.  Returns  0 if no suitable zone is found.
 + *
 + * pfn_limit must be u64 because it can exceed 32 bits even on 32-bit
 + * systems -- the DMA limit can be higher than any possible real pfn.
 + */
 +int dma_pfn_limit_to_zone(u64 pfn_limit)
 +{
 + enum zone_type top_zone = ZONE_NORMAL;
 + int i;
 +
 +#ifdef CONFIG_HIGHMEM
 + top_zone = ZONE_HIGHMEM;
 +#endif
 +
 + for (i = top_zone; i = 0; i--) {
 + if (max_zone_pfns[i] = pfn_limit)
 + return i;
 + }
 +
 + return -EPERM;
 +}
 +
  /*
   * paging_init() sets up the page tables - in fact we've already
 done this. */
 @@ -268,7 +316,7 @@ void __init paging_init(void)
  {
   unsigned long long total_ram = memblock_phys_mem_size();
   phys_addr_t top_of_ram = memblock_end_of_DRAM();
 - unsigned long max_zone_pfns[MAX_NR_ZONES];
 + enum zone_type top_zone;
  
  #ifdef CONFIG_PPC32
   unsigned long v = __fix_to_virt(__end_of_fixed_addresses -
 1); @@ -290,13 +338,16 @@ void __init paging_init(void)
  

Re: [PATCH 1/4] powerpc: Dynamic DMA zone limits

2014-10-13 Thread Benjamin Herrenschmidt
On Mon, 2014-10-13 at 18:14 +1100, Anton Blanchard wrote:
 Hi Scott,
 
  Platform code can call limit_zone_pfn() to set appropriate limits
  for ZONE_DMA and ZONE_DMA32, and dma_direct_alloc_coherent() will
  select a suitable zone based on a device's mask and the pfn limits
  that platform code has configured.
 
 This patch breaks my POWER8 box:
 
 ipr 0001:08:00.0: Using 64-bit DMA iommu bypass
 ipr 0001:08:00.0: dma_direct_alloc_coherent: No suitable zone for pfn 0x1
 ipr 0001:08:00.0: Couldn't allocate enough memory for device driver! 
 ipr: probe of 0001:08:00.0 failed with error -12
 
 ipr isn't setting a coherent mask, but we shouldn't care on these boxes.
 Could we ignore the coherent mask or copy the dma mask to it?

So this depends what the coherent_mask actually means vs. the dma_mask.
I've always been extremely confused by the distinction. Since the
coherent_mask is set by the driver, I assume it represents a driver
limitation on coherent memory which might be *different* from the
restriction on streaming mappings, in which case we might have to honor
it...

The problem is that our whole mechanism for switching dma_ops is based
on having one mask.

So even if we somewhat fix IPR, we still have an issue in that we
don't honor the coherent mask properly in case a driver really wants a
different mask.

If we new have two, I think we need to (in the long run that is, for
3.18 we can probably find an ifdef based band-aid):

 - Either have a ppc_md hook for set_coherent_mask along with
dma_set_mask and make the decision to flip based on the AND of both
masks (gross)

 - Or, since that's basically what some of our HW can do, basically make
the decision on a per-hook basis. That is, something like powernv would
no longer need to hook dma_set_mask to switch the ops. Instead, it could
permanently set a set of pnv_dma_ops that for each hook chose the
right mask and route the mapping toward either the iommu or the bypass
accordingly.

Both seem like quite a bit of refactoring and the latter would be tricky
for some pseries cases where we actually *remove* the 32-bit window to
establish the 64-bit one (DDW cases).

Any better idea ? Are there any drivers that don't actually have the
same mask for both that we care about ?

Ben.



 Anton
 --
 
  Signed-off-by: Scott Wood scottw...@freescale.com
  Cc: Shaohui Xie shaohui@freescale.com
  ---
   arch/powerpc/Kconfig   |  4 +++
   arch/powerpc/include/asm/pgtable.h |  3 ++
   arch/powerpc/kernel/dma.c  | 20 +
   arch/powerpc/mm/mem.c  | 61
  ++ 4 files changed, 83
  insertions(+), 5 deletions(-)
  
  diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
  index 80b94b0..56dc47a 100644
  --- a/arch/powerpc/Kconfig
  +++ b/arch/powerpc/Kconfig
  @@ -286,6 +286,10 @@ config PPC_EMULATE_SSTEP
  bool
  default y if KPROBES || UPROBES || XMON || HAVE_HW_BREAKPOINT
   
  +config ZONE_DMA32
  +   bool
  +   default y if PPC64
  +
   source init/Kconfig
   
   source kernel/Kconfig.freezer
  diff --git a/arch/powerpc/include/asm/pgtable.h
  b/arch/powerpc/include/asm/pgtable.h index d98c1ec..6d74167 100644
  --- a/arch/powerpc/include/asm/pgtable.h
  +++ b/arch/powerpc/include/asm/pgtable.h
  @@ -4,6 +4,7 @@
   
   #ifndef __ASSEMBLY__
   #include linux/mmdebug.h
  +#include linux/mmzone.h
   #include asm/processor.h /* For TASK_SIZE */
   #include asm/mmu.h
   #include asm/page.h
  @@ -281,6 +282,8 @@ extern unsigned long empty_zero_page[];
   
   extern pgd_t swapper_pg_dir[];
   
  +void limit_zone_pfn(enum zone_type zone, unsigned long max_pfn);
  +int dma_pfn_limit_to_zone(u64 pfn_limit);
   extern void paging_init(void);
   
   /*
  diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
  index ee78f6e..dfd99ef 100644
  --- a/arch/powerpc/kernel/dma.c
  +++ b/arch/powerpc/kernel/dma.c
  @@ -40,6 +40,26 @@ void *dma_direct_alloc_coherent(struct device
  *dev, size_t size, #else
  struct page *page;
  int node = dev_to_node(dev);
  +   u64 pfn = (dev-coherent_dma_mask  PAGE_SHIFT) + 1;
  +   int zone;
  +
  +   zone = dma_pfn_limit_to_zone(pfn);
  +   if (zone  0) {
  +   dev_err(dev, %s: No suitable zone for pfn %#llx\n,
  +   __func__, pfn);
  +   return NULL;
  +   }
  +
  +   switch (zone) {
  +   case ZONE_DMA:
  +   flag |= GFP_DMA;
  +   break;
  +#ifdef CONFIG_ZONE_DMA32
  +   case ZONE_DMA32:
  +   flag |= GFP_DMA32;
  +   break;
  +#endif
  +   };
   
  /* ignore region specifiers */
  flag  = ~(__GFP_HIGHMEM);
  diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
  index e0f7a18..3b23e17 100644
  --- a/arch/powerpc/mm/mem.c
  +++ b/arch/powerpc/mm/mem.c
  @@ -261,6 +261,54 @@ static int __init mark_nonram_nosave(void)
  return 0;
   }
   
  +static bool zone_limits_final;
  +
  +static unsigned long max_zone_pfns[MAX_NR_ZONES] = {
  +   [0 ... 

[PATCH 1/3] powerpc: Reimplement __get_SP() as a function not a define

2014-10-13 Thread Anton Blanchard
Li Zhong points out an issue with our current __get_SP()
implementation. If ftrace function tracing is enabled (ie -pg
profiling using _mcount) we spill a stack frame on 64bit all the
time.

If a function calls __get_SP() and later calls a function that is
tail call optimised, we will pop the stack frame and the value
returned by __get_SP() is no longer valid. An example from Li can
be found in save_stack_trace - save_context_stack:

c00432c0 .save_stack_trace:
c00432c0:   mflrr0
c00432c4:   std r0,16(r1)
c00432c8:   stdur1,-128(r1) -- stack frame for _mcount
c00432cc:   std r3,112(r1)
c00432d0:   bl  ._mcount
c00432d4:   nop

c00432d8:   mr  r4,r1 -- __get_SP()

c00432dc:   ld  r5,632(r13)
c00432e0:   ld  r3,112(r1)
c00432e4:   li  r6,1

c00432e8:   addir1,r1,128 -- pop stack frame

c00432ec:   ld  r0,16(r1)
c00432f0:   mtlrr0
c00432f4:   b   .save_context_stack -- tail call optimized

save_context_stack ends up with a stack pointer below the current
one, and it is likely to be scribbled over.

Fix this by making __get_SP() a function which returns the
callers stack frame. Also replace inline assembly which grabs
the stack pointer in save_stack_trace and show_stack with
__get_SP().

This also fixes an issue with perf_arch_fetch_caller_regs().
It currently unwinds the stack once, which will skip a
valid stack frame on a leaf function. With the __get_SP() fixes
in this patch, we never need to unwind the stack frame to get
to the first interesting frame.

We have to export __get_SP() because perf_arch_fetch_caller_regs()
(which is used in modules) calls it from a header file.

Reported-by: Li Zhong zh...@linux.vnet.ibm.com
Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/include/asm/perf_event.h | 2 +-
 arch/powerpc/include/asm/reg.h| 3 +--
 arch/powerpc/kernel/misc.S| 4 
 arch/powerpc/kernel/ppc_ksyms.c   | 2 ++
 arch/powerpc/kernel/process.c | 2 +-
 arch/powerpc/kernel/stacktrace.c  | 2 +-
 6 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/include/asm/perf_event.h 
b/arch/powerpc/include/asm/perf_event.h
index 0bb2372..b058568 100644
--- a/arch/powerpc/include/asm/perf_event.h
+++ b/arch/powerpc/include/asm/perf_event.h
@@ -34,7 +34,7 @@
do {\
(regs)-result = 0; \
(regs)-nip = __ip; \
-   (regs)-gpr[1] = *(unsigned long *)__get_SP();  \
+   (regs)-gpr[1] = __get_SP();\
asm volatile(mfmsr %0 : =r ((regs)-msr));  \
} while (0)
 #endif
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index fe3f948..e539d7e 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -1265,8 +1265,7 @@ static inline unsigned long mfvtb (void)
 
 #define proc_trap()asm volatile(trap)
 
-#define __get_SP() ({unsigned long sp; \
-   asm volatile(mr %0,1: =r (sp)); sp;})
+extern unsigned long __get_SP(void);
 
 extern unsigned long scom970_read(unsigned int address);
 extern void scom970_write(unsigned int address, unsigned long value);
diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S
index 7ce26d4..120deb7 100644
--- a/arch/powerpc/kernel/misc.S
+++ b/arch/powerpc/kernel/misc.S
@@ -114,3 +114,7 @@ _GLOBAL(longjmp)
mtlrr0
mr  r3,r4
blr
+
+_GLOBAL(__get_SP)
+   PPC_LL  r3,0(r1)
+   blr
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index c4dfff6..9d84efb 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -41,3 +41,5 @@ EXPORT_SYMBOL(giveup_spe);
 #ifdef CONFIG_EPAPR_PARAVIRT
 EXPORT_SYMBOL(epapr_hypercall_start);
 #endif
+
+EXPORT_SYMBOL(__get_SP);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index aa1df89..3cc6439 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1545,7 +1545,7 @@ void show_stack(struct task_struct *tsk, unsigned long 
*stack)
tsk = current;
if (sp == 0) {
if (tsk == current)
-   asm(mr %0,1 : =r (sp));
+   sp = __get_SP();
else
sp = tsk-thread.ksp;
}
diff --git a/arch/powerpc/kernel/stacktrace.c b/arch/powerpc/kernel/stacktrace.c
index 3d30ef1..7f65bae 100644
--- a/arch/powerpc/kernel/stacktrace.c
+++ b/arch/powerpc/kernel/stacktrace.c
@@ -50,7 +50,7 @@ void save_stack_trace(struct stack_trace *trace)
 {
unsigned long sp;
 
-   asm(mr %0,1 : =r (sp));
+   sp = __get_SP();
 

[PATCH 2/3] powerpc: Rename __get_SP() to current_stack_pointer()

2014-10-13 Thread Anton Blanchard
Michael points out that __get_SP() is a pretty horrible
function name. Let's give it a better name.

Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/include/asm/perf_event.h | 2 +-
 arch/powerpc/include/asm/reg.h| 2 +-
 arch/powerpc/kernel/irq.c | 2 +-
 arch/powerpc/kernel/misc.S| 2 +-
 arch/powerpc/kernel/ppc_ksyms.c   | 2 +-
 arch/powerpc/kernel/process.c | 2 +-
 arch/powerpc/kernel/stacktrace.c  | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/include/asm/perf_event.h 
b/arch/powerpc/include/asm/perf_event.h
index b058568..8bf1b63 100644
--- a/arch/powerpc/include/asm/perf_event.h
+++ b/arch/powerpc/include/asm/perf_event.h
@@ -34,7 +34,7 @@
do {\
(regs)-result = 0; \
(regs)-nip = __ip; \
-   (regs)-gpr[1] = __get_SP();\
+   (regs)-gpr[1] = current_stack_pointer();   \
asm volatile(mfmsr %0 : =r ((regs)-msr));  \
} while (0)
 #endif
diff --git a/arch/powerpc/include/asm/reg.h b/arch/powerpc/include/asm/reg.h
index e539d7e..c998279 100644
--- a/arch/powerpc/include/asm/reg.h
+++ b/arch/powerpc/include/asm/reg.h
@@ -1265,7 +1265,7 @@ static inline unsigned long mfvtb (void)
 
 #define proc_trap()asm volatile(trap)
 
-extern unsigned long __get_SP(void);
+extern unsigned long current_stack_pointer(void);
 
 extern unsigned long scom970_read(unsigned int address);
 extern void scom970_write(unsigned int address, unsigned long value);
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 8eb857f..c143835 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -466,7 +466,7 @@ static inline void check_stack_overflow(void)
 #ifdef CONFIG_DEBUG_STACKOVERFLOW
long sp;
 
-   sp = __get_SP()  (THREAD_SIZE-1);
+   sp = current_stack_pointer()  (THREAD_SIZE-1);
 
/* check for stack overflow: is there less than 2KB free? */
if (unlikely(sp  (sizeof(struct thread_info) + 2048))) {
diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S
index 120deb7..0d43219 100644
--- a/arch/powerpc/kernel/misc.S
+++ b/arch/powerpc/kernel/misc.S
@@ -115,6 +115,6 @@ _GLOBAL(longjmp)
mr  r3,r4
blr
 
-_GLOBAL(__get_SP)
+_GLOBAL(current_stack_pointer)
PPC_LL  r3,0(r1)
blr
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index 9d84efb..202963e 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -42,4 +42,4 @@ EXPORT_SYMBOL(giveup_spe);
 EXPORT_SYMBOL(epapr_hypercall_start);
 #endif
 
-EXPORT_SYMBOL(__get_SP);
+EXPORT_SYMBOL(current_stack_pointer);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 3cc6439..923cd2d 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1545,7 +1545,7 @@ void show_stack(struct task_struct *tsk, unsigned long 
*stack)
tsk = current;
if (sp == 0) {
if (tsk == current)
-   sp = __get_SP();
+   sp = current_stack_pointer();
else
sp = tsk-thread.ksp;
}
diff --git a/arch/powerpc/kernel/stacktrace.c b/arch/powerpc/kernel/stacktrace.c
index 7f65bae..ea43a34 100644
--- a/arch/powerpc/kernel/stacktrace.c
+++ b/arch/powerpc/kernel/stacktrace.c
@@ -50,7 +50,7 @@ void save_stack_trace(struct stack_trace *trace)
 {
unsigned long sp;
 
-   sp = __get_SP();
+   sp = current_stack_pointer();
 
save_context_stack(trace, sp, current, 1);
 }
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 3/3] powerpc/pseries: Use dump_stack instead of show_stack

2014-10-13 Thread Anton Blanchard
We can use the simpler dump_stack() instead of
show_stack(current, __get_SP())

Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/platforms/pseries/iommu.c | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/iommu.c 
b/arch/powerpc/platforms/pseries/iommu.c
index de1ec54..e32e009 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -30,7 +30,6 @@
 #include linux/mm.h
 #include linux/memblock.h
 #include linux/spinlock.h
-#include linux/sched.h   /* for show_stack */
 #include linux/string.h
 #include linux/pci.h
 #include linux/dma-mapping.h
@@ -168,7 +167,7 @@ static int tce_build_pSeriesLP(struct iommu_table *tbl, 
long tcenum,
printk(\tindex   = 0x%llx\n, (u64)tbl-it_index);
printk(\ttcenum  = 0x%llx\n, (u64)tcenum);
printk(\ttce val = 0x%llx\n, tce );
-   show_stack(current, (unsigned long *)__get_SP());
+   dump_stack();
}
 
tcenum++;
@@ -257,7 +256,7 @@ static int tce_buildmulti_pSeriesLP(struct iommu_table 
*tbl, long tcenum,
printk(\tindex   = 0x%llx\n, (u64)tbl-it_index);
printk(\tnpages  = 0x%llx\n, (u64)npages);
printk(\ttce[0] val = 0x%llx\n, tcep[0]);
-   show_stack(current, (unsigned long *)__get_SP());
+   dump_stack();
}
return ret;
 }
@@ -273,7 +272,7 @@ static void tce_free_pSeriesLP(struct iommu_table *tbl, 
long tcenum, long npages
printk(tce_free_pSeriesLP: plpar_tce_put failed. 
rc=%lld\n, rc);
printk(\tindex   = 0x%llx\n, (u64)tbl-it_index);
printk(\ttcenum  = 0x%llx\n, (u64)tcenum);
-   show_stack(current, (unsigned long *)__get_SP());
+   dump_stack();
}
 
tcenum++;
@@ -292,7 +291,7 @@ static void tce_freemulti_pSeriesLP(struct iommu_table 
*tbl, long tcenum, long n
printk(\trc  = %lld\n, rc);
printk(\tindex   = 0x%llx\n, (u64)tbl-it_index);
printk(\tnpages  = 0x%llx\n, (u64)npages);
-   show_stack(current, (unsigned long *)__get_SP());
+   dump_stack();
}
 }
 
@@ -307,7 +306,7 @@ static unsigned long tce_get_pSeriesLP(struct iommu_table 
*tbl, long tcenum)
printk(tce_get_pSeriesLP: plpar_tce_get failed. rc=%lld\n, 
rc);
printk(\tindex   = 0x%llx\n, (u64)tbl-it_index);
printk(\ttcenum  = 0x%llx\n, (u64)tcenum);
-   show_stack(current, (unsigned long *)__get_SP());
+   dump_stack();
}
 
return tce_ret;
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/4] powerpc: Dynamic DMA zone limits

2014-10-13 Thread Michael Ellerman
On Mon, 2014-10-13 at 18:14 +1100, Anton Blanchard wrote:
 Hi Scott,
 
  Platform code can call limit_zone_pfn() to set appropriate limits
  for ZONE_DMA and ZONE_DMA32, and dma_direct_alloc_coherent() will
  select a suitable zone based on a device's mask and the pfn limits
  that platform code has configured.
 
 This patch breaks my POWER8 box:
 
 ipr 0001:08:00.0: Using 64-bit DMA iommu bypass
 ipr 0001:08:00.0: dma_direct_alloc_coherent: No suitable zone for pfn 0x1
 ipr 0001:08:00.0: Couldn't allocate enough memory for device driver! 
 ipr: probe of 0001:08:00.0 failed with error -12
 
 ipr isn't setting a coherent mask, but we shouldn't care on these boxes.
 Could we ignore the coherent mask or copy the dma mask to it?

Talking to Ben the answer seems to be it's complicated.

We shouldn't be ignoring the coherent mask, but we have been, and have been
getting away with it.

The PCI code sets a default 32-bit mask, so we can't even detect when a device
hasn't set it. Though maybe the powernv PCI code could be initialising it to
64-bit ?

For this cycle I'm thinking of the below patch.

Scott  Anton can you test please?

Also the depends on FSL_PCI was totally a guess, so please correct that if it's
wrong Scott.

cheers


[PATCH] powerpc: Only do dynamic DMA zone limits on platforms that need it

Scott's patch 1c98025c6c95 Dynamic DMA zone limits changed
dma_direct_alloc_coherent() to start using dev-coherent_dma_mask.

That seems fair enough, but it exposes the fact that some of the drivers
we care about on IBM platforms aren't setting the coherent mask.

The proper fix is to have drivers set the coherent mask and also have
the platform code honor it.

For now, just restrict the dynamic DMA zone limits to the platforms that
need it, which is those using FSL_PCI.

Fixes: 1c98025c6c95 (powerpc: Dynamic DMA zone limits)
Signed-off-by: Michael Ellerman m...@ellerman.id.au
---
 arch/powerpc/Kconfig  | 2 +-
 arch/powerpc/kernel/dma.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 88eace4e28c3..9b9044aec217 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -290,7 +290,7 @@ config PPC_EMULATE_SSTEP
 
 config ZONE_DMA32
bool
-   default y if PPC64
+   default y if PPC64  FSL_PCI
 
 source init/Kconfig
 
diff --git a/arch/powerpc/kernel/dma.c b/arch/powerpc/kernel/dma.c
index adac9dc54aee..bd443a2e4426 100644
--- a/arch/powerpc/kernel/dma.c
+++ b/arch/powerpc/kernel/dma.c
@@ -53,6 +53,7 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t 
size,
 #else
struct page *page;
int node = dev_to_node(dev);
+#ifdef CONFIG_ZONE_DMA32
u64 pfn = get_pfn_limit(dev);
int zone;
 
@@ -67,12 +68,11 @@ void *dma_direct_alloc_coherent(struct device *dev, size_t 
size,
case ZONE_DMA:
flag |= GFP_DMA;
break;
-#ifdef CONFIG_ZONE_DMA32
case ZONE_DMA32:
flag |= GFP_DMA32;
break;
-#endif
};
+#endif /* CONFIG_ZONE_DMA32 */
 
/* ignore region specifiers */
flag  = ~(__GFP_HIGHMEM);
-- 
1.9.1



___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/2] ipr: Convert to generic DMA API

2014-10-13 Thread Anton Blanchard
Even though the ipr driver is only used on PCI, convert it
to use the generic DMA API.

Signed-off-by: Anton Blanchard an...@samba.org
---
 drivers/scsi/ipr.c | 101 +++--
 drivers/scsi/ipr.h |   2 +-
 2 files changed, 53 insertions(+), 50 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 924b0ba..3aa28bd 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -3932,8 +3932,9 @@ static int ipr_update_ioa_ucode(struct ipr_ioa_cfg 
*ioa_cfg,
return -EIO;
}
 
-   sglist-num_dma_sg = pci_map_sg(ioa_cfg-pdev, sglist-scatterlist,
-   sglist-num_sg, DMA_TO_DEVICE);
+   sglist-num_dma_sg = dma_map_sg(ioa_cfg-pdev-dev,
+   sglist-scatterlist, sglist-num_sg,
+   DMA_TO_DEVICE);
 
if (!sglist-num_dma_sg) {
spin_unlock_irqrestore(ioa_cfg-host-host_lock, lock_flags);
@@ -5575,7 +5576,7 @@ static int ipr_build_ioadl64(struct ipr_ioa_cfg *ioa_cfg,
nseg = scsi_dma_map(scsi_cmd);
if (nseg  0) {
if (printk_ratelimit())
-   dev_err(ioa_cfg-pdev-dev, pci_map_sg failed!\n);
+   dev_err(ioa_cfg-pdev-dev, scsi_dma_map failed!\n);
return -1;
}
 
@@ -5626,7 +5627,7 @@ static int ipr_build_ioadl(struct ipr_ioa_cfg *ioa_cfg,
 
nseg = scsi_dma_map(scsi_cmd);
if (nseg  0) {
-   dev_err(ioa_cfg-pdev-dev, pci_map_sg failed!\n);
+   dev_err(ioa_cfg-pdev-dev, scsi_dma_map failed!\n);
return -1;
}
 
@@ -8421,7 +8422,7 @@ static int ipr_reset_ucode_download_done(struct ipr_cmnd 
*ipr_cmd)
struct ipr_ioa_cfg *ioa_cfg = ipr_cmd-ioa_cfg;
struct ipr_sglist *sglist = ioa_cfg-ucode_sglist;
 
-   pci_unmap_sg(ioa_cfg-pdev, sglist-scatterlist,
+   dma_unmap_sg(ioa_cfg-pdev-dev, sglist-scatterlist,
 sglist-num_sg, DMA_TO_DEVICE);
 
ipr_cmd-job_step = ipr_reset_alert;
@@ -8861,7 +8862,7 @@ static void ipr_free_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
 
for (i = 0; i  IPR_NUM_CMD_BLKS; i++) {
if (ioa_cfg-ipr_cmnd_list[i])
-   pci_pool_free(ioa_cfg-ipr_cmd_pool,
+   dma_pool_free(ioa_cfg-ipr_cmd_pool,
  ioa_cfg-ipr_cmnd_list[i],
  ioa_cfg-ipr_cmnd_list_dma[i]);
 
@@ -8869,7 +8870,7 @@ static void ipr_free_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
}
 
if (ioa_cfg-ipr_cmd_pool)
-   pci_pool_destroy(ioa_cfg-ipr_cmd_pool);
+   dma_pool_destroy(ioa_cfg-ipr_cmd_pool);
 
kfree(ioa_cfg-ipr_cmnd_list);
kfree(ioa_cfg-ipr_cmnd_list_dma);
@@ -8890,25 +8891,24 @@ static void ipr_free_mem(struct ipr_ioa_cfg *ioa_cfg)
int i;
 
kfree(ioa_cfg-res_entries);
-   pci_free_consistent(ioa_cfg-pdev, sizeof(struct ipr_misc_cbs),
-   ioa_cfg-vpd_cbs, ioa_cfg-vpd_cbs_dma);
+   dma_free_coherent(ioa_cfg-pdev-dev, sizeof(struct ipr_misc_cbs),
+ ioa_cfg-vpd_cbs, ioa_cfg-vpd_cbs_dma);
ipr_free_cmd_blks(ioa_cfg);
 
for (i = 0; i  ioa_cfg-hrrq_num; i++)
-   pci_free_consistent(ioa_cfg-pdev,
-   sizeof(u32) * ioa_cfg-hrrq[i].size,
-   ioa_cfg-hrrq[i].host_rrq,
-   ioa_cfg-hrrq[i].host_rrq_dma);
+   dma_free_coherent(ioa_cfg-pdev-dev,
+ sizeof(u32) * ioa_cfg-hrrq[i].size,
+ ioa_cfg-hrrq[i].host_rrq,
+ ioa_cfg-hrrq[i].host_rrq_dma);
 
-   pci_free_consistent(ioa_cfg-pdev, ioa_cfg-cfg_table_size,
-   ioa_cfg-u.cfg_table,
-   ioa_cfg-cfg_table_dma);
+   dma_free_coherent(ioa_cfg-pdev-dev, ioa_cfg-cfg_table_size,
+ ioa_cfg-u.cfg_table, ioa_cfg-cfg_table_dma);
 
for (i = 0; i  IPR_NUM_HCAMS; i++) {
-   pci_free_consistent(ioa_cfg-pdev,
-   sizeof(struct ipr_hostrcb),
-   ioa_cfg-hostrcb[i],
-   ioa_cfg-hostrcb_dma[i]);
+   dma_free_coherent(ioa_cfg-pdev-dev,
+ sizeof(struct ipr_hostrcb),
+ ioa_cfg-hostrcb[i],
+ ioa_cfg-hostrcb_dma[i]);
}
 
ipr_free_dump(ioa_cfg);
@@ -8969,7 +8969,7 @@ static int ipr_alloc_cmd_blks(struct ipr_ioa_cfg *ioa_cfg)
dma_addr_t dma_addr;
int i, entries_each_hrrq, hrrq_id = 0;
 
-   ioa_cfg-ipr_cmd_pool = pci_pool_create(IPR_NAME, ioa_cfg-pdev,
+   ioa_cfg-ipr_cmd_pool = 

[PATCH 2/2] ipr: set coherent DMA mask

2014-10-13 Thread Anton Blanchard
Use dma_set_mask_and_coherent() to set both the DMA and coherent
DMA mask.

Signed-off-by: Anton Blanchard an...@samba.org
---
 drivers/scsi/ipr.c | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 3aa28bd..15f4575 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -9611,16 +9611,17 @@ static int ipr_probe_ioa(struct pci_dev *pdev,
ipr_init_regs(ioa_cfg);
 
if (ioa_cfg-sis64) {
-   rc = dma_set_mask(pdev-dev, DMA_BIT_MASK(64));
+   rc = dma_set_mask_and_coherent(pdev-dev, DMA_BIT_MASK(64));
if (rc  0) {
-   dev_dbg(pdev-dev, Failed to set 64 bit PCI DMA 
mask\n);
-   rc = dma_set_mask(pdev-dev, DMA_BIT_MASK(32));
+   dev_dbg(pdev-dev, Failed to set 64 bit DMA mask\n);
+   rc = dma_set_mask_and_coherent(pdev-dev,
+  DMA_BIT_MASK(32));
}
} else
-   rc = dma_set_mask(pdev-dev, DMA_BIT_MASK(32));
+   rc = dma_set_mask_and_coherent(pdev-dev, DMA_BIT_MASK(32));
 
if (rc  0) {
-   dev_err(pdev-dev, Failed to set PCI DMA mask\n);
+   dev_err(pdev-dev, Failed to set DMA mask\n);
goto cleanup_nomem;
}
 
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: sync pseries_le_defconfig with pseries_defconfig

2014-10-13 Thread Anton Blanchard
Now KVM is working on LE, enable it. Also enable transarent
hugepage which has already been enabled on BE.

Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/configs/pseries_le_defconfig | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/configs/pseries_le_defconfig 
b/arch/powerpc/configs/pseries_le_defconfig
index 4428ee4..96a230c 100644
--- a/arch/powerpc/configs/pseries_le_defconfig
+++ b/arch/powerpc/configs/pseries_le_defconfig
@@ -48,7 +48,6 @@ CONFIG_KEXEC=y
 CONFIG_IRQ_ALL_CPUS=y
 CONFIG_MEMORY_HOTPLUG=y
 CONFIG_MEMORY_HOTREMOVE=y
-CONFIG_CMA=y
 CONFIG_PPC_64K_PAGES=y
 CONFIG_PPC_SUBPAGE_PROT=y
 CONFIG_SCHED_SMT=y
@@ -137,6 +136,7 @@ CONFIG_NETCONSOLE=y
 CONFIG_NETPOLL_TRAP=y
 CONFIG_TUN=m
 CONFIG_VIRTIO_NET=m
+CONFIG_VHOST_NET=m
 CONFIG_VORTEX=y
 CONFIG_ACENIC=m
 CONFIG_ACENIC_OMIT_TIGON_I=y
@@ -302,4 +302,9 @@ CONFIG_CRYPTO_LZO=m
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
 CONFIG_CRYPTO_DEV_NX=y
 CONFIG_CRYPTO_DEV_NX_ENCRYPT=m
+CONFIG_VIRTUALIZATION=y
+CONFIG_KVM_BOOK3S_64=m
+CONFIG_KVM_BOOK3S_64_HV=y
+CONFIG_TRANSPARENT_HUGEPAGE=y
+CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
 CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: Add printk levels to setup_system output

2014-10-13 Thread Anton Blanchard
Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/kernel/setup_64.c | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index cd07d79..4f3cfe1 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -522,36 +522,36 @@ void __init setup_system(void)
smp_release_cpus();
 #endif
 
-   printk(Starting Linux PPC64 %s\n, init_utsname()-version);
+   pr_info(Starting Linux PPC64 %s\n, init_utsname()-version);
 
-   printk(-\n);
-   printk(ppc64_pft_size= 0x%llx\n, ppc64_pft_size);
-   printk(phys_mem_size = 0x%llx\n, memblock_phys_mem_size());
+   pr_info(-\n);
+   pr_info(ppc64_pft_size= 0x%llx\n, ppc64_pft_size);
+   pr_info(phys_mem_size = 0x%llx\n, memblock_phys_mem_size());
 
if (ppc64_caches.dline_size != 0x80)
-   printk(dcache_line_size  = 0x%x\n, ppc64_caches.dline_size);
+   pr_info(dcache_line_size  = 0x%x\n, ppc64_caches.dline_size);
if (ppc64_caches.iline_size != 0x80)
-   printk(icache_line_size  = 0x%x\n, ppc64_caches.iline_size);
+   pr_info(icache_line_size  = 0x%x\n, ppc64_caches.iline_size);
 
-   printk(cpu_features  = 0x%016lx\n, cur_cpu_spec-cpu_features);
-   printk(  possible= 0x%016lx\n, CPU_FTRS_POSSIBLE);
-   printk(  always  = 0x%016lx\n, CPU_FTRS_ALWAYS);
-   printk(cpu_user_features = 0x%08x 0x%08x\n, 
cur_cpu_spec-cpu_user_features,
+   pr_info(cpu_features  = 0x%016lx\n, cur_cpu_spec-cpu_features);
+   pr_info(  possible= 0x%016lx\n, CPU_FTRS_POSSIBLE);
+   pr_info(  always  = 0x%016lx\n, CPU_FTRS_ALWAYS);
+   pr_info(cpu_user_features = 0x%08x 0x%08x\n, 
cur_cpu_spec-cpu_user_features,
cur_cpu_spec-cpu_user_features2);
-   printk(mmu_features  = 0x%08x\n, cur_cpu_spec-mmu_features);
-   printk(firmware_features = 0x%016lx\n, powerpc_firmware_features);
+   pr_info(mmu_features  = 0x%08x\n, cur_cpu_spec-mmu_features);
+   pr_info(firmware_features = 0x%016lx\n, powerpc_firmware_features);
 
 #ifdef CONFIG_PPC_STD_MMU_64
if (htab_address)
-   printk(htab_address  = 0x%p\n, htab_address);
+   pr_info(htab_address  = 0x%p\n, htab_address);
 
-   printk(htab_hash_mask= 0x%lx\n, htab_hash_mask);
+   pr_info(htab_hash_mask= 0x%lx\n, htab_hash_mask);
 #endif
 
if (PHYSICAL_START  0)
-   printk(physical_start= 0x%llx\n,
+   pr_info(physical_start= 0x%llx\n,
   (unsigned long long)PHYSICAL_START);
-   printk(-\n);
+   pr_info(-\n);
 
DBG( - setup_system()\n);
 }
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: Use probe_kernel_address in show_instructions

2014-10-13 Thread Anton Blanchard
We really don't want to take a pagefault in show_instructions,
so use probe_kernel_address instead of __get_user.

Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/kernel/process.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 923cd2d..e5698f1 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -37,9 +37,9 @@
 #include linux/personality.h
 #include linux/random.h
 #include linux/hw_breakpoint.h
+#include linux/uaccess.h
 
 #include asm/pgtable.h
-#include asm/uaccess.h
 #include asm/io.h
 #include asm/processor.h
 #include asm/mmu.h
@@ -921,12 +921,8 @@ static void show_instructions(struct pt_regs *regs)
pc = (unsigned long)phys_to_virt(pc);
 #endif
 
-   /* We use __get_user here *only* to avoid an OOPS on a
-* bad address because the pc *should* only be a
-* kernel address.
-*/
if (!__kernel_text_address(pc) ||
-__get_user(instr, (unsigned int __user *)pc)) {
+probe_kernel_address((unsigned int __user *)pc, instr)) {
printk(KERN_CONT  );
} else {
if (regs-nip == pc)
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: powerpc32: add support for csum_add()

2014-10-13 Thread leroy christophe

Le 12/10/2014 18:22, Jochen Rollwagen a écrit :

This patch

https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-September/121144.html

only compiles after putting an #ifndef ARCH_HAS_CSUM_ADD around the 
definition in include/net/checksum.h


This is missing from the patch




This is already included upstream since May 2014, see patch below

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=07064c6e022ba8dc0c86ce12f7851a1de24e04fc

From 07064c6e022ba8dc0c86ce12f7851a1de24e04fc Mon Sep 17 00:00:00 2001
From: Tom Herbert therb...@google.com
Date: Fri, 2 May 2014 16:28:03 -0700
Subject: net: Allow csum_add to be provided in arch

csum_add is really nothing more then add-with-carry which
can be implemented efficiently in some architectures.
Allow architecture to define this protected by HAVE_ARCH_CSUM_ADD.

Signed-off-by: Tom Herbert therb...@google.com
Signed-off-by: David S. Miller da...@davemloft.net

diff --git a/include/net/checksum.h b/include/net/checksum.h
index a28f4e0..87cb190 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -57,12 +57,14 @@ static __inline__ __wsum csum_and_copy_to_user
 }
 #endif
 
+#ifndef HAVE_ARCH_CSUM_ADD

 static inline __wsum csum_add(__wsum csum, __wsum addend)
 {
u32 res = (__force u32)csum;
res += (__force u32)addend;
return (__force __wsum)(res + (res  (__force u32)addend));
 }
+#endif
 
 static inline __wsum csum_sub(__wsum csum, __wsum addend)

 {
--
cgit v0.10.1



___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 04/20] powerpc/52xx/efika: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de

---

v1 - v2:

  - write pm_power_off in probe function
---
 arch/powerpc/platforms/52xx/efika.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/52xx/efika.c 
b/arch/powerpc/platforms/52xx/efika.c
index 3feffde..6af651e 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -212,6 +212,8 @@ static int __init efika_probe(void)
DMA_MODE_READ = 0x44;
DMA_MODE_WRITE = 0x48;
 
+   pm_power_off = rtas_power_off;
+
return 1;
 }
 
@@ -225,7 +227,6 @@ define_machine(efika)
.init_IRQ   = mpc52xx_init_irq,
.get_irq= mpc52xx_get_irq,
.restart= rtas_restart,
-   .power_off  = rtas_power_off,
.halt   = rtas_halt,
.set_rtc_time   = rtas_set_rtc_time,
.get_rtc_time   = rtas_get_rtc_time,
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 02/20] powerpc/xmon: Support either ppc_md.power_off or pm_power_off

2014-10-13 Thread Alexander Graf
Xmon can manually turn off the machine. We now have 2 code paths for this:

  1) ppc_md.power_off
  2) pm_power_off

This patch allows xmon to support both and makes sure it graciously allows
a path to not be implemented.

Signed-off-by: Alexander Graf ag...@suse.de
---
 arch/powerpc/xmon/xmon.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index b988b5a..531f649 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -981,7 +981,10 @@ static void bootcmds(void)
else if (cmd == 'h')
ppc_md.halt();
else if (cmd == 'p')
-   ppc_md.power_off();
+   if (ppc_md.power_off)
+   ppc_md.power_off();
+   if (pm_power_off)
+   pm_power_off();
 }
 
 static int cpu_cmd(void)
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 00/20] powerpc: Convert power off logic to pm_power_off

2014-10-13 Thread Alexander Graf
The generic Linux framework to power off the machine is a function pointer
called pm_power_off. The trick about this pointer is that device drivers can
potentially implement it rather than board files.

Today on PowerPC we set pm_power_off to invoke our generic full machine power
off logic which then calls ppc_md.power_off to invoke machine specific power
off.

However, when we want to add a power off GPIO via the gpio-poweroff driver,
this card house falls apart. That driver only registers itself if pm_power_off
is NULL to ensure it doesn't override board specific logic. However, since we
always set pm_power_off to the generic power off logic (which will just not
power off the machine if no ppc_md.power_off call is implemented), we can't
implement power off via the generic GPIO power off driver.

To fix this up, let's get rid of the ppc_md.power_off logic and just always use
pm_power_off as was intended. Then individual drivers such as the GPIO power off
driver can implement power off logic via that function pointer.

With this patch set applied and a few patches on top of QEMU that implement a
power off GPIO on the virt e500 machine, I can successfully turn off my virtual
machine after halt.

Michael / Ben, you can find this patch set as a git branch at the URL below.
When applying it, please use that one to ensure that Guenter can easily merge
his work with my work.

  git://github.com/agraf/linux-2.6.git pm_power_off-v2

Alex

---

v1 - v2:

  - fix typo in 47x
  - put ppc_md static replacement setters into probe function

Alexander Graf (20):
  powerpc: Support override of pm_power_off
  powerpc/xmon: Support either ppc_md.power_off or pm_power_off
  powerpc/47x: Use pm_power_off rather than ppc_md.power_off
  powerpc/52xx/efika: Use pm_power_off rather than ppc_md.power_off
  powerpc/mpc8349emitx: Use pm_power_off rather than ppc_md.power_off
  powerpc/corenet: Use pm_power_off rather than ppc_md.power_off
  powerpc/85xx/sgy_cts1000: Use pm_power_off rather than
ppc_md.power_off
  powerpc/celleb: Use pm_power_off rather than ppc_md.power_off
  powerpc/cell/qpace: Use pm_power_off rather than ppc_md.power_off
  powerpc/cell: Use pm_power_off rather than ppc_md.power_off
  powerpc/chrp: Use pm_power_off rather than ppc_md.power_off
  powerpc/6xx/gamecube: Use pm_power_off rather than ppc_md.power_off
  powerpc/6xx/linkstation: Use pm_power_off rather than ppc_md.power_off
  powerpc/6xx/wii: Use pm_power_off rather than ppc_md.power_off
  powerpc/maple: Use pm_power_off rather than ppc_md.power_off
  powerpc/powermac: Use pm_power_off rather than ppc_md.power_off
  powerpc/powernv: Use pm_power_off rather than ppc_md.power_off
  powerpc/ps3: Use pm_power_off rather than ppc_md.power_off
  powerpc/pseries: Use pm_power_off rather than ppc_md.power_off
  powerpc: Remove ppc_md.power_off

 arch/powerpc/include/asm/machdep.h   |   1 -
 arch/powerpc/kernel/setup-common.c   |   6 +-
 arch/powerpc/platforms/44x/ppc476.c  |   2 +-
 arch/powerpc/platforms/52xx/efika.c  |   3 +-
 arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c   |   8 +-
 arch/powerpc/platforms/85xx/corenet_generic.c|   2 +-
 arch/powerpc/platforms/85xx/sgy_cts1000.c|   4 +-
 arch/powerpc/platforms/cell/celleb_setup.c   |   4 +-
 arch/powerpc/platforms/cell/qpace_setup.c|   2 +-
 arch/powerpc/platforms/cell/setup.c  |   2 +-
 arch/powerpc/platforms/chrp/setup.c  |   3 +-
 arch/powerpc/platforms/embedded6xx/gamecube.c|   3 +-
 arch/powerpc/platforms/embedded6xx/linkstation.c |   4 +-
 arch/powerpc/platforms/embedded6xx/wii.c |   3 +-
 arch/powerpc/platforms/maple/setup.c |   4 +-
 arch/powerpc/platforms/powermac/setup.c  | 147 ---
 arch/powerpc/platforms/powernv/setup.c   |   4 +-
 arch/powerpc/platforms/ps3/setup.c   |   2 +-
 arch/powerpc/platforms/pseries/setup.c   |  59 -
 arch/powerpc/sysdev/fsl_soc.c|   2 +-
 arch/powerpc/xmon/xmon.c |   3 +-
 21 files changed, 138 insertions(+), 130 deletions(-)

-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 08/20] powerpc/celleb: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de

---

v1 - v2:

  - write pm_power_off in probe function
---
 arch/powerpc/platforms/cell/celleb_setup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/cell/celleb_setup.c 
b/arch/powerpc/platforms/cell/celleb_setup.c
index 34e8ce2..90be8ec 100644
--- a/arch/powerpc/platforms/cell/celleb_setup.c
+++ b/arch/powerpc/platforms/cell/celleb_setup.c
@@ -142,6 +142,7 @@ static int __init celleb_probe_beat(void)
powerpc_firmware_features |= FW_FEATURE_CELLEB_ALWAYS
| FW_FEATURE_BEAT | FW_FEATURE_LPAR;
hpte_init_beat_v3();
+   pm_power_off = beat_power_off;
 
return 1;
 }
@@ -190,6 +191,7 @@ static int __init celleb_probe_native(void)
 
powerpc_firmware_features |= FW_FEATURE_CELLEB_ALWAYS;
hpte_init_native();
+   pm_power_off = rtas_power_off;
 
return 1;
 }
@@ -204,7 +206,6 @@ define_machine(celleb_beat) {
.setup_arch = celleb_setup_arch_beat,
.show_cpuinfo   = celleb_show_cpuinfo,
.restart= beat_restart,
-   .power_off  = beat_power_off,
.halt   = beat_halt,
.get_rtc_time   = beat_get_rtc_time,
.set_rtc_time   = beat_set_rtc_time,
@@ -230,7 +231,6 @@ define_machine(celleb_native) {
.setup_arch = celleb_setup_arch_native,
.show_cpuinfo   = celleb_show_cpuinfo,
.restart= rtas_restart,
-   .power_off  = rtas_power_off,
.halt   = rtas_halt,
.get_boot_time  = rtas_get_boot_time,
.get_rtc_time   = rtas_get_rtc_time,
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 03/20] powerpc/47x: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de

---

v1 - v2:

  - fix typo
---
 arch/powerpc/platforms/44x/ppc476.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/44x/ppc476.c 
b/arch/powerpc/platforms/44x/ppc476.c
index 58db9d0..c11ce65 100644
--- a/arch/powerpc/platforms/44x/ppc476.c
+++ b/arch/powerpc/platforms/44x/ppc476.c
@@ -94,7 +94,7 @@ static int avr_probe(struct i2c_client *client,
 {
avr_i2c_client = client;
ppc_md.restart = avr_reset_system;
-   ppc_md.power_off = avr_power_off_system;
+   pm_power_off = avr_power_off_system;
return 0;
 }
 
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 07/20] powerpc/85xx/sgy_cts1000: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de
---
 arch/powerpc/platforms/85xx/sgy_cts1000.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/sgy_cts1000.c 
b/arch/powerpc/platforms/85xx/sgy_cts1000.c
index 8162b04..e149c9e 100644
--- a/arch/powerpc/platforms/85xx/sgy_cts1000.c
+++ b/arch/powerpc/platforms/85xx/sgy_cts1000.c
@@ -120,7 +120,7 @@ static int gpio_halt_probe(struct platform_device *pdev)
 
/* Register our halt function */
ppc_md.halt = gpio_halt_cb;
-   ppc_md.power_off = gpio_halt_cb;
+   pm_power_off = gpio_halt_cb;
 
printk(KERN_INFO gpio-halt: registered GPIO %d (%d trigger, %d
irq).\n, gpio, trigger, irq);
@@ -137,7 +137,7 @@ static int gpio_halt_remove(struct platform_device *pdev)
free_irq(irq, halt_node);
 
ppc_md.halt = NULL;
-   ppc_md.power_off = NULL;
+   pm_power_off = NULL;
 
gpio_free(gpio);
 
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 13/20] powerpc/6xx/linkstation: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de

---

v1 - v2:

  - write pm_power_off in probe function
---
 arch/powerpc/platforms/embedded6xx/linkstation.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c 
b/arch/powerpc/platforms/embedded6xx/linkstation.c
index 168e1d8..540eeb5 100644
--- a/arch/powerpc/platforms/embedded6xx/linkstation.c
+++ b/arch/powerpc/platforms/embedded6xx/linkstation.c
@@ -147,6 +147,9 @@ static int __init linkstation_probe(void)
 
if (!of_flat_dt_is_compatible(root, linkstation))
return 0;
+
+   pm_power_off = linkstation_power_off;
+
return 1;
 }
 
@@ -158,7 +161,6 @@ define_machine(linkstation){
.show_cpuinfo   = linkstation_show_cpuinfo,
.get_irq= mpic_get_irq,
.restart= linkstation_restart,
-   .power_off  = linkstation_power_off,
.halt   = linkstation_halt,
.calibrate_decr = generic_calibrate_decr,
 };
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 05/20] powerpc/mpc8349emitx: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de
---
 arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c 
b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
index 463fa91e..15e8021 100644
--- a/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
+++ b/arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c
@@ -167,10 +167,10 @@ static int mcu_probe(struct i2c_client *client, const 
struct i2c_device_id *id)
if (ret)
goto err;
 
-   /* XXX: this is potentially racy, but there is no lock for ppc_md */
-   if (!ppc_md.power_off) {
+   /* XXX: this is potentially racy, but there is no lock for pm_power_off 
*/
+   if (!pm_power_off) {
glob_mcu = mcu;
-   ppc_md.power_off = mcu_power_off;
+   pm_power_off = mcu_power_off;
dev_info(client-dev, will provide power-off service\n);
}
 
@@ -197,7 +197,7 @@ static int mcu_remove(struct i2c_client *client)
device_remove_file(client-dev, dev_attr_status);
 
if (glob_mcu == mcu) {
-   ppc_md.power_off = NULL;
+   pm_power_off = NULL;
glob_mcu = NULL;
}
 
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 01/20] powerpc: Support override of pm_power_off

2014-10-13 Thread Alexander Graf
The pm_power_off callback is what drivers are supposed to modify when they
implement power off support for the system.

Support a modified callback on powerpc. That way power off support code can
now either override ppc_md.power_off or pm_power_off.

Signed-off-by: Alexander Graf ag...@suse.de
---
 arch/powerpc/kernel/setup-common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/kernel/setup-common.c 
b/arch/powerpc/kernel/setup-common.c
index 1362cd6..6398239 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -141,6 +141,8 @@ void machine_power_off(void)
machine_shutdown();
if (ppc_md.power_off)
ppc_md.power_off();
+   if (pm_power_off != machine_power_off)
+   pm_power_off();
 #ifdef CONFIG_SMP
smp_send_stop();
 #endif
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 06/20] powerpc/corenet: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de
---
 arch/powerpc/platforms/85xx/corenet_generic.c | 2 +-
 arch/powerpc/sysdev/fsl_soc.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index e56b89a..1f309cc 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -170,7 +170,7 @@ static int __init corenet_generic_probe(void)
 
ppc_md.get_irq = ehv_pic_get_irq;
ppc_md.restart = fsl_hv_restart;
-   ppc_md.power_off = fsl_hv_halt;
+   pm_power_off = fsl_hv_halt;
ppc_md.halt = fsl_hv_halt;
 #ifdef CONFIG_SMP
/*
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c
index ffd1169..1e04568 100644
--- a/arch/powerpc/sysdev/fsl_soc.c
+++ b/arch/powerpc/sysdev/fsl_soc.c
@@ -238,7 +238,7 @@ void fsl_hv_restart(char *cmd)
 /*
  * Halt the current partition
  *
- * This function should be assigned to the ppc_md.power_off and ppc_md.halt
+ * This function should be assigned to the pm_power_off and ppc_md.halt
  * function pointers, to shut down the partition when we're running under
  * the Freescale hypervisor.
  */
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 09/20] powerpc/cell/qpace: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de

---

v1 - v2:

  - write pm_power_off in probe function
---
 arch/powerpc/platforms/cell/qpace_setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/cell/qpace_setup.c 
b/arch/powerpc/platforms/cell/qpace_setup.c
index 6e3409d..d328140 100644
--- a/arch/powerpc/platforms/cell/qpace_setup.c
+++ b/arch/powerpc/platforms/cell/qpace_setup.c
@@ -127,6 +127,7 @@ static int __init qpace_probe(void)
return 0;
 
hpte_init_native();
+   pm_power_off = rtas_power_off;
 
return 1;
 }
@@ -137,7 +138,6 @@ define_machine(qpace) {
.setup_arch = qpace_setup_arch,
.show_cpuinfo   = qpace_show_cpuinfo,
.restart= rtas_restart,
-   .power_off  = rtas_power_off,
.halt   = rtas_halt,
.get_boot_time  = rtas_get_boot_time,
.get_rtc_time   = rtas_get_rtc_time,
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 20/20] powerpc: Remove ppc_md.power_off

2014-10-13 Thread Alexander Graf
Now that we have all implementations of ppc_md.power_off converted to
pm_power_off we can remove the ppc_md variant.

While at it, also set the default for pm_power_off to NULL so that non
machine drivers can implement overrides.

Signed-off-by: Alexander Graf ag...@suse.de
---
 arch/powerpc/include/asm/machdep.h | 1 -
 arch/powerpc/kernel/setup-common.c | 6 ++
 arch/powerpc/xmon/xmon.c   | 2 --
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/include/asm/machdep.h 
b/arch/powerpc/include/asm/machdep.h
index 307347f..f15f15c 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -142,7 +142,6 @@ struct machdep_calls {
 #endif
 
void(*restart)(char *cmd);
-   void(*power_off)(void);
void(*halt)(void);
void(*panic)(char *str);
void(*cpu_die)(void);
diff --git a/arch/powerpc/kernel/setup-common.c 
b/arch/powerpc/kernel/setup-common.c
index 6398239..44c8d03 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -139,9 +139,7 @@ void machine_restart(char *cmd)
 void machine_power_off(void)
 {
machine_shutdown();
-   if (ppc_md.power_off)
-   ppc_md.power_off();
-   if (pm_power_off != machine_power_off)
+   if (pm_power_off)
pm_power_off();
 #ifdef CONFIG_SMP
smp_send_stop();
@@ -153,7 +151,7 @@ void machine_power_off(void)
 /* Used by the G5 thermal driver */
 EXPORT_SYMBOL_GPL(machine_power_off);
 
-void (*pm_power_off)(void) = machine_power_off;
+void (*pm_power_off)(void);
 EXPORT_SYMBOL_GPL(pm_power_off);
 
 void machine_halt(void)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 531f649..506d256 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -981,8 +981,6 @@ static void bootcmds(void)
else if (cmd == 'h')
ppc_md.halt();
else if (cmd == 'p')
-   if (ppc_md.power_off)
-   ppc_md.power_off();
if (pm_power_off)
pm_power_off();
 }
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 12/20] powerpc/6xx/gamecube: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de
---
 arch/powerpc/platforms/embedded6xx/gamecube.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/embedded6xx/gamecube.c 
b/arch/powerpc/platforms/embedded6xx/gamecube.c
index bd4ba5d..fe0ed6e 100644
--- a/arch/powerpc/platforms/embedded6xx/gamecube.c
+++ b/arch/powerpc/platforms/embedded6xx/gamecube.c
@@ -67,6 +67,8 @@ static int __init gamecube_probe(void)
if (!of_flat_dt_is_compatible(dt_root, nintendo,gamecube))
return 0;
 
+   pm_power_off = gamecube_power_off;
+
return 1;
 }
 
@@ -80,7 +82,6 @@ define_machine(gamecube) {
.probe  = gamecube_probe,
.init_early = gamecube_init_early,
.restart= gamecube_restart,
-   .power_off  = gamecube_power_off,
.halt   = gamecube_halt,
.init_IRQ   = flipper_pic_probe,
.get_irq= flipper_pic_get_irq,
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 14/20] powerpc/6xx/wii: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de

---

v1 - v2:

  - write pm_power_off in probe function
---
 arch/powerpc/platforms/embedded6xx/wii.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/embedded6xx/wii.c 
b/arch/powerpc/platforms/embedded6xx/wii.c
index 388e29b..352592d 100644
--- a/arch/powerpc/platforms/embedded6xx/wii.c
+++ b/arch/powerpc/platforms/embedded6xx/wii.c
@@ -211,6 +211,8 @@ static int __init wii_probe(void)
if (!of_flat_dt_is_compatible(dt_root, nintendo,wii))
return 0;
 
+   pm_power_off = wii_power_off;
+
return 1;
 }
 
@@ -226,7 +228,6 @@ define_machine(wii) {
.init_early = wii_init_early,
.setup_arch = wii_setup_arch,
.restart= wii_restart,
-   .power_off  = wii_power_off,
.halt   = wii_halt,
.init_IRQ   = wii_pic_probe,
.get_irq= flipper_pic_get_irq,
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 16/20] powerpc/powermac: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de

---

v1 - v2:

  - write pm_power_off in probe function
---
 arch/powerpc/platforms/powermac/setup.c | 147 
 1 file changed, 74 insertions(+), 73 deletions(-)

diff --git a/arch/powerpc/platforms/powermac/setup.c 
b/arch/powerpc/platforms/powermac/setup.c
index b127a29..1b03bc1 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -274,6 +274,78 @@ static void __init l2cr_init(void)
 }
 #endif
 
+#ifdef CONFIG_ADB_CUDA
+static void cuda_restart(void)
+{
+   struct adb_request req;
+
+   cuda_request(req, NULL, 2, CUDA_PACKET, CUDA_RESET_SYSTEM);
+   for (;;)
+   cuda_poll();
+}
+
+static void cuda_shutdown(void)
+{
+   struct adb_request req;
+
+   cuda_request(req, NULL, 2, CUDA_PACKET, CUDA_POWERDOWN);
+   for (;;)
+   cuda_poll();
+}
+
+#else
+#define cuda_restart()
+#define cuda_shutdown()
+#endif
+
+#ifndef CONFIG_ADB_PMU
+#define pmu_restart()
+#define pmu_shutdown()
+#endif
+
+#ifndef CONFIG_PMAC_SMU
+#define smu_restart()
+#define smu_shutdown()
+#endif
+
+static void pmac_restart(char *cmd)
+{
+   switch (sys_ctrler) {
+   case SYS_CTRLER_CUDA:
+   cuda_restart();
+   break;
+   case SYS_CTRLER_PMU:
+   pmu_restart();
+   break;
+   case SYS_CTRLER_SMU:
+   smu_restart();
+   break;
+   default: ;
+   }
+}
+
+static void pmac_power_off(void)
+{
+   switch (sys_ctrler) {
+   case SYS_CTRLER_CUDA:
+   cuda_shutdown();
+   break;
+   case SYS_CTRLER_PMU:
+   pmu_shutdown();
+   break;
+   case SYS_CTRLER_SMU:
+   smu_shutdown();
+   break;
+   default: ;
+   }
+}
+
+static void
+pmac_halt(void)
+{
+   pmac_power_off();
+}
+
 static void __init pmac_setup_arch(void)
 {
struct device_node *cpu, *ic;
@@ -382,78 +454,6 @@ void __init_refok note_bootable_part(dev_t dev, int part, 
int goodness)
current_root_goodness = goodness;
 }
 
-#ifdef CONFIG_ADB_CUDA
-static void cuda_restart(void)
-{
-   struct adb_request req;
-
-   cuda_request(req, NULL, 2, CUDA_PACKET, CUDA_RESET_SYSTEM);
-   for (;;)
-   cuda_poll();
-}
-
-static void cuda_shutdown(void)
-{
-   struct adb_request req;
-
-   cuda_request(req, NULL, 2, CUDA_PACKET, CUDA_POWERDOWN);
-   for (;;)
-   cuda_poll();
-}
-
-#else
-#define cuda_restart()
-#define cuda_shutdown()
-#endif
-
-#ifndef CONFIG_ADB_PMU
-#define pmu_restart()
-#define pmu_shutdown()
-#endif
-
-#ifndef CONFIG_PMAC_SMU
-#define smu_restart()
-#define smu_shutdown()
-#endif
-
-static void pmac_restart(char *cmd)
-{
-   switch (sys_ctrler) {
-   case SYS_CTRLER_CUDA:
-   cuda_restart();
-   break;
-   case SYS_CTRLER_PMU:
-   pmu_restart();
-   break;
-   case SYS_CTRLER_SMU:
-   smu_restart();
-   break;
-   default: ;
-   }
-}
-
-static void pmac_power_off(void)
-{
-   switch (sys_ctrler) {
-   case SYS_CTRLER_CUDA:
-   cuda_shutdown();
-   break;
-   case SYS_CTRLER_PMU:
-   pmu_shutdown();
-   break;
-   case SYS_CTRLER_SMU:
-   smu_shutdown();
-   break;
-   default: ;
-   }
-}
-
-static void
-pmac_halt(void)
-{
-   pmac_power_off();
-}
-
 /* 
  * Early initialization.
  */
@@ -632,6 +632,8 @@ static int __init pmac_probe(void)
smu_cmdbuf_abs = memblock_alloc_base(4096, 4096, 0x8000UL);
 #endif /* CONFIG_PMAC_SMU */
 
+   pm_power_off = pmac_power_off;
+
return 1;
 }
 
@@ -663,7 +665,6 @@ define_machine(powermac) {
.get_irq= NULL, /* changed later */
.pci_irq_fixup  = pmac_pci_irq_fixup,
.restart= pmac_restart,
-   .power_off  = pmac_power_off,
.halt   = pmac_halt,
.time_init  = pmac_time_init,
.get_boot_time  = pmac_get_boot_time,
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 11/20] powerpc/chrp: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de

---

v1 - v2:

  - write pm_power_off in probe function
---
 arch/powerpc/platforms/chrp/setup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/chrp/setup.c 
b/arch/powerpc/platforms/chrp/setup.c
index 5b77b19..dbe7d16 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -585,6 +585,8 @@ static int __init chrp_probe(void)
DMA_MODE_READ = 0x44;
DMA_MODE_WRITE = 0x48;
 
+   pm_power_off = rtas_power_off,
+
return 1;
 }
 
@@ -597,7 +599,6 @@ define_machine(chrp) {
.show_cpuinfo   = chrp_show_cpuinfo,
.init_IRQ   = chrp_init_IRQ,
.restart= rtas_restart,
-   .power_off  = rtas_power_off,
.halt   = rtas_halt,
.time_init  = chrp_time_init,
.set_rtc_time   = chrp_set_rtc_time,
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 17/20] powerpc/powernv: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de
---
 arch/powerpc/platforms/powernv/setup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/setup.c 
b/arch/powerpc/platforms/powernv/setup.c
index 3f9546d..941831d 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -268,7 +268,7 @@ static void __init pnv_setup_machdep_opal(void)
ppc_md.get_rtc_time = opal_get_rtc_time;
ppc_md.set_rtc_time = opal_set_rtc_time;
ppc_md.restart = pnv_restart;
-   ppc_md.power_off = pnv_power_off;
+   pm_power_off = pnv_power_off;
ppc_md.halt = pnv_halt;
ppc_md.machine_check_exception = opal_machine_check;
ppc_md.mce_check_early_recovery = opal_mce_check_early_recovery;
@@ -285,7 +285,7 @@ static void __init pnv_setup_machdep_rtas(void)
ppc_md.set_rtc_time = rtas_set_rtc_time;
}
ppc_md.restart = rtas_restart;
-   ppc_md.power_off = rtas_power_off;
+   pm_power_off = rtas_power_off;
ppc_md.halt = rtas_halt;
 }
 #endif /* CONFIG_PPC_POWERNV_RTAS */
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 15/20] powerpc/maple: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de

---

v1 - v2:

  - write pm_power_off in probe function
---
 arch/powerpc/platforms/maple/setup.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/maple/setup.c 
b/arch/powerpc/platforms/maple/setup.c
index cb1b0b3..56b85cd 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -169,7 +169,7 @@ static void __init 
maple_use_rtas_reboot_and_halt_if_present(void)
if (rtas_service_present(system-reboot) 
rtas_service_present(power-off)) {
ppc_md.restart = rtas_restart;
-   ppc_md.power_off = rtas_power_off;
+   pm_power_off = rtas_power_off;
ppc_md.halt = rtas_halt;
}
 }
@@ -312,6 +312,7 @@ static int __init maple_probe(void)
alloc_dart_table();
 
hpte_init_native();
+   pm_power_off = maple_power_off;
 
return 1;
 }
@@ -325,7 +326,6 @@ define_machine(maple) {
.pci_irq_fixup  = maple_pci_irq_fixup,
.pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq,
.restart= maple_restart,
-   .power_off  = maple_power_off,
.halt   = maple_halt,
.get_boot_time  = maple_get_boot_time,
.set_rtc_time   = maple_set_rtc_time,
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 10/20] powerpc/cell: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de

---

v1 - v2:

  - write pm_power_off in probe function
---
 arch/powerpc/platforms/cell/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/cell/setup.c 
b/arch/powerpc/platforms/cell/setup.c
index 6ae25fb..d62aa98 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -259,6 +259,7 @@ static int __init cell_probe(void)
return 0;
 
hpte_init_native();
+   pm_power_off = rtas_power_off;
 
return 1;
 }
@@ -269,7 +270,6 @@ define_machine(cell) {
.setup_arch = cell_setup_arch,
.show_cpuinfo   = cell_show_cpuinfo,
.restart= rtas_restart,
-   .power_off  = rtas_power_off,
.halt   = rtas_halt,
.get_boot_time  = rtas_get_boot_time,
.get_rtc_time   = rtas_get_rtc_time,
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 19/20] powerpc/pseries: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de

---

v1 - v2:

  - write pm_power_off in probe function
---
 arch/powerpc/platforms/pseries/setup.c | 59 +-
 1 file changed, 30 insertions(+), 29 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/setup.c 
b/arch/powerpc/platforms/pseries/setup.c
index 125c589..9ce1cf0 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -659,6 +659,34 @@ static void __init pSeries_init_early(void)
pr_debug( - pSeries_init_early()\n);
 }
 
+/**
+ * pSeries_power_off - tell firmware about how to power off the system.
+ *
+ * This function calls either the power-off rtas token in normal cases
+ * or the ibm,power-off-ups token (if present  requested) in case of
+ * a power failure. If power-off token is used, power on will only be
+ * possible with power button press. If ibm,power-off-ups token is used
+ * it will allow auto poweron after power is restored.
+ */
+static void pSeries_power_off(void)
+{
+   int rc;
+   int rtas_poweroff_ups_token = rtas_token(ibm,power-off-ups);
+
+   if (rtas_flash_term_hook)
+   rtas_flash_term_hook(SYS_POWER_OFF);
+
+   if (rtas_poweron_auto == 0 ||
+   rtas_poweroff_ups_token == RTAS_UNKNOWN_SERVICE) {
+   rc = rtas_call(rtas_token(power-off), 2, 1, NULL, -1, -1);
+   printk(KERN_INFO RTAS power-off returned %d\n, rc);
+   } else {
+   rc = rtas_call(rtas_poweroff_ups_token, 0, 1, NULL);
+   printk(KERN_INFO RTAS ibm,power-off-ups returned %d\n, rc);
+   }
+   for (;;);
+}
+
 /*
  * Called very early, MMU is off, device-tree isn't unflattened
  */
@@ -741,6 +769,8 @@ static int __init pSeries_probe(void)
else
hpte_init_native();
 
+   pm_power_off = pSeries_power_off;
+
pr_debug(Machine is%s LPAR !\n,
 (powerpc_firmware_features  FW_FEATURE_LPAR) ?  :  not);
 
@@ -754,34 +784,6 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus)
return PCI_PROBE_NORMAL;
 }
 
-/**
- * pSeries_power_off - tell firmware about how to power off the system.
- *
- * This function calls either the power-off rtas token in normal cases
- * or the ibm,power-off-ups token (if present  requested) in case of
- * a power failure. If power-off token is used, power on will only be
- * possible with power button press. If ibm,power-off-ups token is used
- * it will allow auto poweron after power is restored.
- */
-static void pSeries_power_off(void)
-{
-   int rc;
-   int rtas_poweroff_ups_token = rtas_token(ibm,power-off-ups);
-
-   if (rtas_flash_term_hook)
-   rtas_flash_term_hook(SYS_POWER_OFF);
-
-   if (rtas_poweron_auto == 0 ||
-   rtas_poweroff_ups_token == RTAS_UNKNOWN_SERVICE) {
-   rc = rtas_call(rtas_token(power-off), 2, 1, NULL, -1, -1);
-   printk(KERN_INFO RTAS power-off returned %d\n, rc);
-   } else {
-   rc = rtas_call(rtas_poweroff_ups_token, 0, 1, NULL);
-   printk(KERN_INFO RTAS ibm,power-off-ups returned %d\n, rc);
-   }
-   for (;;);
-}
-
 #ifndef CONFIG_PCI
 void pSeries_final_fixup(void) { }
 #endif
@@ -796,7 +798,6 @@ define_machine(pseries) {
.pcibios_fixup  = pSeries_final_fixup,
.pci_probe_mode = pSeries_pci_probe_mode,
.restart= rtas_restart,
-   .power_off  = pSeries_power_off,
.halt   = rtas_halt,
.panic  = rtas_os_term,
.get_boot_time  = rtas_get_boot_time,
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v2 18/20] powerpc/ps3: Use pm_power_off rather than ppc_md.power_off

2014-10-13 Thread Alexander Graf
The generic power off callback is pm_power_off. Use that one rather than
the powerpc specific ppc_md.power_off.

Signed-off-by: Alexander Graf ag...@suse.de

---

v1 - v2:

  - write pm_power_off in probe function
---
 arch/powerpc/platforms/ps3/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/ps3/setup.c 
b/arch/powerpc/platforms/ps3/setup.c
index 3f509f8..009a200 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -248,6 +248,7 @@ static int __init ps3_probe(void)
ps3_mm_init();
ps3_mm_vas_create(htab_size);
ps3_hpte_init(htab_size);
+   pm_power_off = ps3_power_off;
 
DBG( - %s:%d\n, __func__, __LINE__);
return 1;
@@ -278,7 +279,6 @@ define_machine(ps3) {
.calibrate_decr = ps3_calibrate_decr,
.progress   = ps3_progress,
.restart= ps3_restart,
-   .power_off  = ps3_power_off,
.halt   = ps3_halt,
 #if defined(CONFIG_KEXEC)
.kexec_cpu_down = ps3_kexec_cpu_down,
-- 
1.8.1.4

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2 00/20] powerpc: Convert power off logic to pm_power_off

2014-10-13 Thread Guenter Roeck

On 10/13/2014 07:01 AM, Alexander Graf wrote:

The generic Linux framework to power off the machine is a function pointer
called pm_power_off. The trick about this pointer is that device drivers can
potentially implement it rather than board files.

Today on PowerPC we set pm_power_off to invoke our generic full machine power
off logic which then calls ppc_md.power_off to invoke machine specific power
off.

However, when we want to add a power off GPIO via the gpio-poweroff driver,
this card house falls apart. That driver only registers itself if pm_power_off
is NULL to ensure it doesn't override board specific logic. However, since we
always set pm_power_off to the generic power off logic (which will just not
power off the machine if no ppc_md.power_off call is implemented), we can't
implement power off via the generic GPIO power off driver.

To fix this up, let's get rid of the ppc_md.power_off logic and just always use
pm_power_off as was intended. Then individual drivers such as the GPIO power off
driver can implement power off logic via that function pointer.

With this patch set applied and a few patches on top of QEMU that implement a
power off GPIO on the virt e500 machine, I can successfully turn off my virtual
machine after halt.

Michael / Ben, you can find this patch set as a git branch at the URL below.
When applying it, please use that one to ensure that Guenter can easily merge
his work with my work.

   git://github.com/agraf/linux-2.6.git pm_power_off-v2



Best for me would be if someone (you or Ben or Michael) could create an
immutable branch which contains the patch set as to be submitted to Linus,
with all signatures, so I can merge it into my poweroff branch. If possible
that branch should have a signed tag which I can merge, to ensure that
I don't merge anything bad.

If I just merge your branch, I would not get the maintainer signature(s),
nor would it have the final SHA. Both would obviously be less than desirable.

Thanks,
Guenter

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2 00/20] powerpc: Convert power off logic to pm_power_off

2014-10-13 Thread Guenter Roeck

On 10/13/2014 07:01 AM, Alexander Graf wrote:

The generic Linux framework to power off the machine is a function pointer
called pm_power_off. The trick about this pointer is that device drivers can
potentially implement it rather than board files.

Today on PowerPC we set pm_power_off to invoke our generic full machine power
off logic which then calls ppc_md.power_off to invoke machine specific power
off.

However, when we want to add a power off GPIO via the gpio-poweroff driver,
this card house falls apart. That driver only registers itself if pm_power_off
is NULL to ensure it doesn't override board specific logic. However, since we
always set pm_power_off to the generic power off logic (which will just not
power off the machine if no ppc_md.power_off call is implemented), we can't
implement power off via the generic GPIO power off driver.

To fix this up, let's get rid of the ppc_md.power_off logic and just always use
pm_power_off as was intended. Then individual drivers such as the GPIO power off
driver can implement power off logic via that function pointer.

With this patch set applied and a few patches on top of QEMU that implement a
power off GPIO on the virt e500 machine, I can successfully turn off my virtual
machine after halt.

Michael / Ben, you can find this patch set as a git branch at the URL below.
When applying it, please use that one to ensure that Guenter can easily merge
his work with my work.

   git://github.com/agraf/linux-2.6.git pm_power_off-v2

Alex

---

v1 - v2:

   - fix typo in 47x
   - put ppc_md static replacement setters into probe function

Alexander Graf (20):
   powerpc: Support override of pm_power_off
   powerpc/xmon: Support either ppc_md.power_off or pm_power_off
   powerpc/47x: Use pm_power_off rather than ppc_md.power_off
   powerpc/52xx/efika: Use pm_power_off rather than ppc_md.power_off
   powerpc/mpc8349emitx: Use pm_power_off rather than ppc_md.power_off
   powerpc/corenet: Use pm_power_off rather than ppc_md.power_off
   powerpc/85xx/sgy_cts1000: Use pm_power_off rather than
 ppc_md.power_off
   powerpc/celleb: Use pm_power_off rather than ppc_md.power_off
   powerpc/cell/qpace: Use pm_power_off rather than ppc_md.power_off
   powerpc/cell: Use pm_power_off rather than ppc_md.power_off
   powerpc/chrp: Use pm_power_off rather than ppc_md.power_off
   powerpc/6xx/gamecube: Use pm_power_off rather than ppc_md.power_off
   powerpc/6xx/linkstation: Use pm_power_off rather than ppc_md.power_off
   powerpc/6xx/wii: Use pm_power_off rather than ppc_md.power_off
   powerpc/maple: Use pm_power_off rather than ppc_md.power_off
   powerpc/powermac: Use pm_power_off rather than ppc_md.power_off
   powerpc/powernv: Use pm_power_off rather than ppc_md.power_off
   powerpc/ps3: Use pm_power_off rather than ppc_md.power_off
   powerpc/pseries: Use pm_power_off rather than ppc_md.power_off
   powerpc: Remove ppc_md.power_off



On another note, and maybe you discussed this separately: I don't really
see the value of having 20 separate patches here, other than creating
a lot of work for the maintainer. Wouldn't it be easier
to just have one patch instead ?

Sure, it would touch 20+ files instead of just one, but then you
could drop some of the workarounds you have to put in place just
to undo it at the end, and it is not as if the patches are really
independent of each other or as if there would be any benefit
in respect to the ability to bisect or merge into earlier versions
of the kernel.

I for my part don't plan for 20 patches when I convert it to
use the poweroff handler. Hope it is ok with everyone that it
will be just one patch.

Thanks,
Guenter

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/3] qe-uart: modify qe-uart to adapt both powerpc and arm

2014-10-13 Thread Timur Tabi
On Fri, Oct 10, 2014 at 1:05 PM, Scott Wood scottw...@freescale.com wrote:
 There are many changes in here that ought to be separate patches with
 separate justification.

 Also, some of the QE changes seem to be reasonable cleanup, but not
 related to making the code work on ARM.

I agree with Scott.  This patch already makes significant code
changes, so you should have one patch that just makes the
out_be32-iowrite32be changes.  Changes to the QE library should NOT
be in the same patch as changes to ucc_uart.c.

In addition, changes like this:

-   iprop = of_get_property(np, port-number, NULL);
-   if (!iprop) {
+   ret = of_property_read_u32_index(np, port-number, 0, val);
+   if (ret) {

should be changed to remove the OF dependency.  If you're going to
replace of_get_property, replace it with device_property_read_u32(),
to remove the OF dependency.

 diff --git a/arch/arm/include/asm/delay.h b/arch/arm/include/asm/delay.h
 index dff714d..a932f99 100644
 --- a/arch/arm/include/asm/delay.h
 +++ b/arch/arm/include/asm/delay.h
 @@ -57,6 +57,22 @@ extern void __bad_udelay(void);
   __const_udelay((n) * UDELAY_MULT)) :\
 __udelay(n))

 +#define spin_event_timeout(condition, timeout, delay)   
\
 +({  
\
 + typeof(condition) __ret;   
 \
 + int i = 0; 
 \
 + while (!(__ret = (condition))  (i++  timeout)) {
 \
 + if (delay) 
 \
 + udelay(delay); 
 \
 + else   
 \
 + cpu_relax();   
 \
 + udelay(1); 
 \
 + }  
 \

 This will delay too long if delay is used.

Shouldn't ARM have a version of tb_ticks_since() by now?

 + if (!__ret)
 \
 + __ret = (condition);   
 \
 + __ret; 
 \

 Timur, do you remember why that final if (!__ret) __ret = (condition);
 is needed?

powerpc: Fix spin_event_timeout() to be robust over context switches

Current implementation of spin_event_timeout can be interrupted by an
IRQ or context switch after testing the condition, but before checking
the timeout.  This can cause the loop to report a timeout when the
condition actually became true in the middle.

This patch adds one final check of the condition upon exit of the loop
if the last test of the condition was still false.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 00/21] powerpc/8xx: Optimise MMU TLB handling and add support of 16k pages

2014-10-13 Thread leroy christophe


Le 17/09/2014 22:34, Scott Wood a écrit :

On Wed, 2014-09-17 at 22:33 +0200, christophe leroy wrote:

Le 17/09/2014 18:40, Scott Wood a écrit :

On Wed, 2014-09-17 at 18:36 +0200, Christophe Leroy wrote:

This patchset:
1) provides several MMU TLB handling optimisation on MPC8xx.
2) adds support of 16k pages on MPC8xx.
All changes have been successfully tested on a custom board equipped with MPC885

Signed-off-by: Christophe Leroy christophe.le...@c-s.fr
Tested-by: Christophe Leroy christophe.le...@c-s.fr

I've already applied patches 1, 2, 4, 5, 6, 9, and 10 from the previous
patchset -- have they changed?

-Scott


No, only 3, 7, 17 are changed, and 20,21 are new.
I didn't notice you already applied some. How should I then proceed now
for the remaining ones ? Submit a new set ?


No, I'll just skip the ones I've already applied.



I think I took into account all Joakim's and your's comments in v4.
Since I submitted v4, I think I didn't get any new comment.
What's the way forward to get the remaining ones applied ?

Christophe
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCHv9 2/5] ppc/cell: trivial: replace get_unused_fd() by get_unused_fd_flags(0)

2014-10-13 Thread Yann Droneaud
This patch replaces calls to get_unused_fd() with equivalent call to
get_unused_fd_flags(0) to preserve current behavor for existing code.

In a further patch, get_unused_fd() will be removed so that new code
start using get_unused_fd_flags(), with the hope O_CLOEXEC could be
used, either by default or choosen by userspace.

Link: http://lkml.kernel.org/r/cover.1413223900.git.ydrone...@opteya.com
Cc: Al Viro v...@zeniv.linux.org.uk
Cc: Andrew Morton a...@linux-foundation.org
Cc: triv...@kernel.org
Signed-off-by: Yann Droneaud ydrone...@opteya.com
---
 arch/powerpc/platforms/cell/spufs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/inode.c 
b/arch/powerpc/platforms/cell/spufs/inode.c
index 87ba7cf99cd7..51effcec30d8 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -301,7 +301,7 @@ static int spufs_context_open(struct path *path)
int ret;
struct file *filp;
 
-   ret = get_unused_fd();
+   ret = get_unused_fd_flags(0);
if (ret  0)
return ret;
 
@@ -518,7 +518,7 @@ static int spufs_gang_open(struct path *path)
int ret;
struct file *filp;
 
-   ret = get_unused_fd();
+   ret = get_unused_fd_flags(0);
if (ret  0)
return ret;
 
-- 
1.9.3

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCHv9 0/5] Getting rid of get_unused_fd()

2014-10-13 Thread Yann Droneaud
Hi,

Please find the 9th revision of my patchset to remove
get_unused_fd() macro.

In linux-next, tag next-20141013, they're currently:

- 33 calls to fd_install()
   with one call part of anon_inode_getfd()
- 27 calls to get_unused_fd_flags()
   with one call part of anon_inode_getfd()
   with another part of get_unused_fd() macro
- 13 calls to anon_inode_getfd()
-  8 calls to anon_inode_getfile()
   with one call part of anon_inode_getfd()
-  5 calls to get_unused_fd()

The following patchset replaces the 5 last calls to
get_unused_fd() by calls to get_unused_fd_flags(0)
and remove the macro so that it won't be used in
newer code.

For some detailed background information, please have
a look at my previous patchset's cover letter[1].

Changes from patchset v8[1]
- fanotify: enable close-on-exec on events' fd when requested in
fanotify_init()
  DROPPED: applied upstream, commit 0b37e097a648.
- reduce the amount of explanation in cover letter

[1] http://lkml.kernel.org/r/cover.1411562410.git.ydrone...@opteya.com

Yann Droneaud (5):
  ia64: trivial: replace get_unused_fd() by get_unused_fd_flags(0)
  ppc/cell: trivial: replace get_unused_fd() by get_unused_fd_flags(0)
  binfmt_misc: trivial: replace get_unused_fd() by
get_unused_fd_flags(0)
  file: trivial: replace get_unused_fd() by get_unused_fd_flags(0)
  file: remove get_unused_fd() macro

 arch/ia64/kernel/perfmon.c| 2 +-
 arch/powerpc/platforms/cell/spufs/inode.c | 4 ++--
 fs/binfmt_misc.c  | 2 +-
 fs/file.c | 2 +-
 include/linux/file.h  | 1 -
 5 files changed, 5 insertions(+), 6 deletions(-)

-- 
1.9.3

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 4/7] sound/radeon: Add quirk for broken 64-bit MSI

2014-10-13 Thread Benjamin Herrenschmidt
On Wed, 2014-10-08 at 16:28 +1100, Benjamin Herrenschmidt wrote:

  Further discussion with the hw teams have revealed that this is still
  an issue on newer asics so I think your original patch is correct
  after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.
 
 Allright, I won't resend the whole series, I can just pickup my previous
 patch. Takashi, Bjorn, Dave, this series covers your 3 areas of
 maintainership, how do you want to proceed ? I'm happy to merge the
 whole lot via powerpc ASAP (since it's all CC'ed stable) if you guys
 send me the appropriate acks, otherwise, let me know.

So I got an Ack from Takashi but so far silence from Bjorn and Dave :-)

Ping ?

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 4/7] sound/radeon: Add quirk for broken 64-bit MSI

2014-10-13 Thread Alex Deucher
On Mon, Oct 13, 2014 at 4:11 PM, Benjamin Herrenschmidt
b...@kernel.crashing.org wrote:
 On Wed, 2014-10-08 at 16:28 +1100, Benjamin Herrenschmidt wrote:

  Further discussion with the hw teams have revealed that this is still
  an issue on newer asics so I think your original patch is correct
  after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.

 Allright, I won't resend the whole series, I can just pickup my previous
 patch. Takashi, Bjorn, Dave, this series covers your 3 areas of
 maintainership, how do you want to proceed ? I'm happy to merge the
 whole lot via powerpc ASAP (since it's all CC'ed stable) if you guys
 send me the appropriate acks, otherwise, let me know.

 So I got an Ack from Takashi but so far silence from Bjorn and Dave :-)

 Ping ?

I'm fine with the radeon patches going through your tree rather than
through my tree.

Alex
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v3 4/7] sound/radeon: Add quirk for broken 64-bit MSI

2014-10-13 Thread Bjorn Helgaas
On Mon, Oct 13, 2014 at 2:11 PM, Benjamin Herrenschmidt
b...@kernel.crashing.org wrote:
 On Wed, 2014-10-08 at 16:28 +1100, Benjamin Herrenschmidt wrote:

  Further discussion with the hw teams have revealed that this is still
  an issue on newer asics so I think your original patch is correct
  after all.  Just disable 64 bit MSIs on all AMD audio PCI ids.

 Allright, I won't resend the whole series, I can just pickup my previous
 patch. Takashi, Bjorn, Dave, this series covers your 3 areas of
 maintainership, how do you want to proceed ? I'm happy to merge the
 whole lot via powerpc ASAP (since it's all CC'ed stable) if you guys
 send me the appropriate acks, otherwise, let me know.

 So I got an Ack from Takashi but so far silence from Bjorn and Dave :-)

 Ping ?

Sorry, I've been taking a breather after the v3.17 release.  I'll try
to look at these soon, but I will be on vacation Thu-Fri this week).

Bjorn
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: powerpc32: add support for csum_add()

2014-10-13 Thread Jochen Rollwagen

Am 13.10.2014 um 13:17 schrieb leroy christophe:

Le 12/10/2014 18:22, Jochen Rollwagen a écrit :

This patch

https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-September/121144.html

only compiles after putting an #ifndef ARCH_HAS_CSUM_ADD around the 
definition in include/net/checksum.h


This is missing from the patch




This is already included upstream since May 2014, see patch below

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=07064c6e022ba8dc0c86ce12f7851a1de24e04fc

 From 07064c6e022ba8dc0c86ce12f7851a1de24e04fc Mon Sep 17 00:00:00 2001
From: Tom Herberttherb...@google.com
Date: Fri, 2 May 2014 16:28:03 -0700
Subject: net: Allow csum_add to be provided in arch

csum_add is really nothing more then add-with-carry which
can be implemented efficiently in some architectures.
Allow architecture to define this protected by HAVE_ARCH_CSUM_ADD.

Signed-off-by: Tom Herberttherb...@google.com
Signed-off-by: David S. Millerda...@davemloft.net

diff --git a/include/net/checksum.h b/include/net/checksum.h
index a28f4e0..87cb190 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -57,12 +57,14 @@ static __inline__ __wsum csum_and_copy_to_user
  }
  #endif
  
+#ifndef HAVE_ARCH_CSUM_ADD

  static inline __wsum csum_add(__wsum csum, __wsum addend)
  {
u32 res = (__force u32)csum;
res += (__force u32)addend;
return (__force __wsum)(res + (res  (__force u32)addend));
  }
+#endif
  
  static inline __wsum csum_sub(__wsum csum, __wsum addend)

  {
--
cgit v0.10.1


Ah bon. Obviously this wasn't backported to 3.14, that's what i compiled 
for. So i backported the 2 Lines of code manually et tout est bon.


Salut

Jochen
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc/pci: Quieten unset I/O resource warning

2014-10-13 Thread Anton Blanchard
Newer POWER designs do not implement PCI I/O space, so we
expect to see a number of these.

Reduce the severity of the warning so it doesn't mask other
real issues.

Signed-off-by: Anton Blanchard an...@samba.org
---

Index: b/arch/powerpc/kernel/pci-common.c
===
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1460,7 +1460,7 @@ static void pcibios_setup_phb_resources(
res = hose-io_resource;
 
if (!res-flags) {
-   printk(KERN_WARNING PCI: I/O resource not set for host
+   pr_info(PCI: I/O resource not set for host
bridge %s (domain %d)\n,
   hose-dn-full_name, hose-global_number);
} else {
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: Remove ppc_md.remove_memory

2014-10-13 Thread Anton Blanchard
We have an extra level of indirection on memory hot remove which is not
matched on memory hot add. Memory hotplug is book3s only, so there is
no need for it.

This also enables means remove_memory() (ie memory hot unplug) works
on powernv.

Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/include/asm/machdep.h  |  4 
 arch/powerpc/mm/mem.c   | 12 ++--
 arch/powerpc/platforms/pseries/hotplug-memory.c | 21 -
 3 files changed, 10 insertions(+), 27 deletions(-)

diff --git a/arch/powerpc/include/asm/machdep.h 
b/arch/powerpc/include/asm/machdep.h
index 902ab20..327e8dd 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -294,10 +294,6 @@ struct machdep_calls {
 #ifdef CONFIG_ARCH_RANDOM
int (*get_random_long)(unsigned long *v);
 #endif
-
-#ifdef CONFIG_MEMORY_HOTREMOVE
-   int (*remove_memory)(u64, u64);
-#endif
 };
 
 extern void e500_idle(void);
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 8ebaac7..b9f2e7c 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -35,6 +35,7 @@
 #include linux/memblock.h
 #include linux/hugetlb.h
 #include linux/slab.h
+#include linux/vmalloc.h
 
 #include asm/pgalloc.h
 #include asm/prom.h
@@ -144,8 +145,15 @@ int arch_remove_memory(u64 start, u64 size)
 
zone = page_zone(pfn_to_page(start_pfn));
ret = __remove_pages(zone, start_pfn, nr_pages);
-   if (!ret  (ppc_md.remove_memory))
-   ret = ppc_md.remove_memory(start, size);
+
+   start = (unsigned long)__va(start);
+   if (!ret)
+   ret = remove_section_mapping(start, start + size);
+
+   /* Ensure all vmalloc mappings are flushed in case they also
+* hit that section of memory
+*/
+   vm_unmap_aliases();
 
return ret;
 }
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c 
b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 187ecfa..d5426ec 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -12,7 +12,6 @@
 #include linux/of.h
 #include linux/of_address.h
 #include linux/memblock.h
-#include linux/vmalloc.h
 #include linux/memory.h
 #include linux/memory_hotplug.h
 
@@ -66,22 +65,6 @@ unsigned long pseries_memory_block_size(void)
 }
 
 #ifdef CONFIG_MEMORY_HOTREMOVE
-static int pseries_remove_memory(u64 start, u64 size)
-{
-   int ret;
-
-   /* Remove htab bolted mappings for this section of memory */
-   start = (unsigned long)__va(start);
-   ret = remove_section_mapping(start, start + size);
-
-   /* Ensure all vmalloc mappings are flushed in case they also
-* hit that section of memory
-*/
-   vm_unmap_aliases();
-
-   return ret;
-}
-
 static int pseries_remove_memblock(unsigned long base, unsigned int 
memblock_size)
 {
unsigned long block_sz, start_pfn;
@@ -262,10 +245,6 @@ static int __init pseries_memory_hotplug_init(void)
if (firmware_has_feature(FW_FEATURE_LPAR))
of_reconfig_notifier_register(pseries_mem_nb);
 
-#ifdef CONFIG_MEMORY_HOTREMOVE
-   ppc_md.remove_memory = pseries_remove_memory;
-#endif
-
return 0;
 }
 machine_device_initcall(pseries, pseries_memory_hotplug_init);
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: Remove ppc64_boot_msg

2014-10-13 Thread Anton Blanchard
ppc64_boot_msg is meant to be a boot debug aid, but
is only used in one spot. Get rid of it, and save
ourseleves a couple of lines in the kernel log
buffer.

Signed-off-by: Anton Blanchard an...@samba.org
---
 arch/powerpc/include/asm/machdep.h | 10 --
 arch/powerpc/kernel/setup_64.c | 29 -
 2 files changed, 39 deletions(-)

diff --git a/arch/powerpc/include/asm/machdep.h 
b/arch/powerpc/include/asm/machdep.h
index 327e8dd..6ac6dfd 100644
--- a/arch/powerpc/include/asm/machdep.h
+++ b/arch/powerpc/include/asm/machdep.h
@@ -341,16 +341,6 @@ extern sys_ctrler_t sys_ctrler;
 
 #endif /* CONFIG_PPC_PMAC */
 
-
-/* Functions to produce codes on the leds.
- * The SRC code should be unique for the message category and should
- * be limited to the lower 24 bits (the upper 8 are set by these funcs),
- * and (for boot  dump) should be sorted numerically in the order
- * the events occur.
- */
-/* Print a boot progress message. */
-void ppc64_boot_msg(unsigned int src, const char *msg);
-
 static inline void log_error(char *buf, unsigned int err_type, int fatal)
 {
if (ppc_md.log_error)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 317e96a..1b56320 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -665,8 +665,6 @@ static void __init emergency_stack_init(void)
  */
 void __init setup_arch(char **cmdline_p)
 {
-   ppc64_boot_msg(0x12, Setup Arch);
-
*cmdline_p = boot_command_line;
 
/*
@@ -711,33 +709,6 @@ void __init setup_arch(char **cmdline_p)
if ((unsigned long)_stext  0x)
panic(Kernelbase not 64K-aligned (0x%lx)!\n,
  (unsigned long)_stext);
-
-   ppc64_boot_msg(0x15, Setup Done);
-}
-
-
-/* ToDo: do something useful if ppc_md is not yet setup. */
-#define PPC64_LINUX_FUNCTION 0x0f00
-#define PPC64_IPL_MESSAGE 0xc000
-#define PPC64_TERM_MESSAGE 0xb000
-
-static void ppc64_do_msg(unsigned int src, const char *msg)
-{
-   if (ppc_md.progress) {
-   char buf[128];
-
-   sprintf(buf, %08X\n, src);
-   ppc_md.progress(buf, 0);
-   snprintf(buf, 128, %s, msg);
-   ppc_md.progress(buf, 0);
-   }
-}
-
-/* Print a boot progress message. */
-void ppc64_boot_msg(unsigned int src, const char *msg)
-{
-   ppc64_do_msg(PPC64_LINUX_FUNCTION|PPC64_IPL_MESSAGE|src, msg);
-   printk([boot]%04x %s\n, src, msg);
 }
 
 #ifdef CONFIG_SMP
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCHv9 2/5] ppc/cell: trivial: replace get_unused_fd() by get_unused_fd_flags(0)

2014-10-13 Thread Michael Ellerman
On Mon, 2014-10-13 at 21:30 +0200, Yann Droneaud wrote:
 This patch replaces calls to get_unused_fd() with equivalent call to
 get_unused_fd_flags(0) to preserve current behavor for existing code.
 
 In a further patch, get_unused_fd() will be removed so that new code
 start using get_unused_fd_flags(), with the hope O_CLOEXEC could be
 used, either by default or choosen by userspace.
 
 Link: http://lkml.kernel.org/r/cover.1413223900.git.ydrone...@opteya.com
 Cc: Al Viro v...@zeniv.linux.org.uk
 Cc: Andrew Morton a...@linux-foundation.org
 Cc: triv...@kernel.org
 Signed-off-by: Yann Droneaud ydrone...@opteya.com

This is fine by me, do you want an ack, or do you want us to take it via the
powerpc tree?

If the former:

Acked-by: Michael Ellerman m...@ellerman.id.au


cheers


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC PATCH v3 1/3] powerpc: Fix warning reported by verify_cpu_node_mapping()

2014-10-13 Thread Li Zhong
On 二, 2014-10-07 at 08:33 -0700, Nishanth Aravamudan wrote:
 On 07.10.2014 [17:28:38 +1100], Michael Ellerman wrote:
  On Fri, 2014-10-03 at 16:26 -0700, Nishanth Aravamudan wrote:
   On 03.10.2014 [10:50:20 +1000], Michael Ellerman wrote:
On Thu, 2014-10-02 at 14:13 -0700, Nishanth Aravamudan wrote:
 Ben  Michael,
 
 What's the status of these patches?

Been in my next for a week :)

https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/log/?h=next
   
   Ah ok, thanks -- I wasn't following your tree, my fault. 
  
  Not really your fault, I hadn't announced my trees existence :)
  
   Do we want these to go back to 3.17-stable, as they fix some annoying 
   splats
   during boot (non-fatal afaict, though)?
  
  Up to you really, I don't know how often/bad they were. I haven't added CC
  stable tags to the commits, so if you want them in stable you should send 
  them
  explicitly.
 
 I think they occur every boot, unconditionally, on pseries. Doesn't
 prevent boot, just really noisy. I think it'd be good to get them into
 -stable.
 
 Li Zhong, can you push them once they get sent upstream?

I guess I only need to send the first two patches to stable? 

Thanks, Zhong
 
 Thanks,
 Nish


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RFC PATCH v3 1/3] powerpc: Fix warning reported by verify_cpu_node_mapping()

2014-10-13 Thread Michael Ellerman
On Tue, 2014-10-14 at 10:39 +0800, Li Zhong wrote:
 On 二, 2014-10-07 at 08:33 -0700, Nishanth Aravamudan wrote:
  On 07.10.2014 [17:28:38 +1100], Michael Ellerman wrote:
   On Fri, 2014-10-03 at 16:26 -0700, Nishanth Aravamudan wrote:
On 03.10.2014 [10:50:20 +1000], Michael Ellerman wrote:
 On Thu, 2014-10-02 at 14:13 -0700, Nishanth Aravamudan wrote:
  Ben  Michael,
  
  What's the status of these patches?
 
 Been in my next for a week :)
 
 https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/log/?h=next

Ah ok, thanks -- I wasn't following your tree, my fault. 
   
   Not really your fault, I hadn't announced my trees existence :)
   
Do we want these to go back to 3.17-stable, as they fix some annoying 
splats
during boot (non-fatal afaict, though)?
   
   Up to you really, I don't know how often/bad they were. I haven't added CC
   stable tags to the commits, so if you want them in stable you should send 
   them
   explicitly.
  
  I think they occur every boot, unconditionally, on pseries. Doesn't
  prevent boot, just really noisy. I think it'd be good to get them into
  -stable.
  
  Li Zhong, can you push them once they get sent upstream?
 
 I guess I only need to send the first two patches to stable? 

Probably. It's not clear from the changelog how serious a problem it fixes.

See Documentation/stable_kernel_rules.txt

cheers



___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 08/44] kernel: Move pm_power_off to common code

2014-10-13 Thread Hirokazu TAKATA
From: Guenter Roeck li...@roeck-us.net
  arch/m32r/kernel/process.c |  8 

Acked-by: Hirokazu Takata tak...@linux-m32r.org

Thank you.

-- takata
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev