[PATCH 4/4] ppc64 ftrace_with_regs recursion protection

2015-06-11 Thread Torsten Duwe
This is an *emergency* parachute to avoid an endless recursion and
consecutively a kernel stack overflow, should any function within some
ftrace framework cause an access fault, which calls _mcount / ftrace_caller
in return and so on. It might also call an ftrace'd function directly.

As Michael Ellerman pointed out, it is a tedious and error-prone task
to maintain a complete list of those functions that _might_ get called
from *_access_fault or any dynamic tracer function. So we'll
concentrate on the most frequent cases to enhance performance later,
while for now sticking with this fill-in. It will later serve as a backup
protection.

  * arch/powerpc/kernel/entry_64.S:
- test-and-set TRACE_FTRACE_BIT in task_struct's trace_recursion,
  do not call the actual tracer function if set, clear flag on return.

Signed-off-by: Torsten Duwe d...@suse.de
--
 arch/powerpc/kernel/asm-offsets.c |1 +
 arch/powerpc/kernel/entry_64.S|   15 +--
 2 files changed, 14 insertions(+), 2 deletions(-)
--
diff --git a/arch/powerpc/kernel/asm-offsets.c 
b/arch/powerpc/kernel/asm-offsets.c
index 4717859..ae10752 100644
--- a/arch/powerpc/kernel/asm-offsets.c
+++ b/arch/powerpc/kernel/asm-offsets.c
@@ -72,6 +72,7 @@ int main(void)
DEFINE(THREAD, offsetof(struct task_struct, thread));
DEFINE(MM, offsetof(struct task_struct, mm));
DEFINE(MMCONTEXTID, offsetof(struct mm_struct, context.id));
+   DEFINE(TASK_TRACEREC, offsetof(struct task_struct, trace_recursion));
 #ifdef CONFIG_PPC64
DEFINE(AUDITCONTEXT, offsetof(struct task_struct, audit_context));
DEFINE(SIGSEGV, SIGSEGV);
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index a4132ef..4768104 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -1202,7 +1202,13 @@ _GLOBAL(ftrace_caller)
SAVE_8GPRS(16,r1)
SAVE_8GPRS(24,r1)
 
-
+   ld  r3, PACACURRENT(r13)
+   ld  r4, TASK_TRACEREC(r3)
+   andi.   r5, r4, 0x0010 // ( 1  TRACE_FTRACE_BIT )
+   ori r4, r4, 0x0010
+   std r4, TASK_TRACEREC(r3)
+   bne-3f  // ftrace in progress - avoid recursion!
+   
LOAD_REG_IMMEDIATE(r3,function_trace_op)
ld  r5,0(r3)
 
@@ -1224,9 +1230,14 @@ ftrace_call:
bl  ftrace_stub
nop
 
+   ld  r3, PACACURRENT(r13)
+   ld  r4, TASK_TRACEREC(r3)
+   andi.   r4, r4, 0xffef // ~( 1  TRACE_FTRACE_BIT )
+   std r4, TASK_TRACEREC(r3)
+
ld  r3, _NIP(r1)
mtlrr3
-
+3:
REST_8GPRS(0,r1)
REST_8GPRS(8,r1)
REST_8GPRS(16,r1)
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 2/8]powerpc/perf: Export Power8 generic events in sysfs

2015-06-11 Thread Madhavan Srinivasan
From: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com

Export generic perf events for Power8 in sysfs.

Signed-off-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com
Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com
---
 arch/powerpc/perf/power8-events-list.h | 20 
 arch/powerpc/perf/power8-pmu.c | 43 +-
 2 files changed, 57 insertions(+), 6 deletions(-)
 create mode 100644 arch/powerpc/perf/power8-events-list.h

diff --git a/arch/powerpc/perf/power8-events-list.h 
b/arch/powerpc/perf/power8-events-list.h
new file mode 100644
index 000..1368547
--- /dev/null
+++ b/arch/powerpc/perf/power8-events-list.h
@@ -0,0 +1,20 @@
+/*
+ * Performance counter support for POWER8 processors.
+ *
+ * Copyright 2013 Sukadev Bhattiprolu, IBM Corporation.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+/*
+ * Some power8 event codes.
+ */
+EVENT(PM_CYC,  0x0001e)
+EVENT(PM_GCT_NOSLOT_CYC,   0x100f8)
+EVENT(PM_CMPLU_STALL,  0x4000a)
+EVENT(PM_INST_CMPL,0x2)
+EVENT(PM_BRU_FIN,  0x10068)
+EVENT(PM_BR_MPRED_CMPL,0x400f6)
diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c
index 396351d..a542310 100644
--- a/arch/powerpc/perf/power8-pmu.c
+++ b/arch/powerpc/perf/power8-pmu.c
@@ -21,12 +21,11 @@
 /*
  * Some power8 event codes.
  */
-#define PM_CYC 0x0001e
-#define PM_GCT_NOSLOT_CYC  0x100f8
-#define PM_CMPLU_STALL 0x4000a
-#define PM_INST_CMPL   0x2
-#define PM_BRU_FIN 0x10068
-#define PM_BR_MPRED_CMPL   0x400f6
+enum {
+#include power8-events-list.h
+};
+
+#undef EVENT
 
 /* All L1 D cache load references counted at finish, gated by reject */
 #define PM_LD_REF_L1   0x100ee
@@ -604,6 +603,37 @@ static void power8_disable_pmc(unsigned int pmc, unsigned 
long mmcr[])
mmcr[1] = ~(0xffUL  MMCR1_PMCSEL_SHIFT(pmc + 1));
 }
 
+GENERIC_EVENT_ATTR(cpu-cyles,  PM_CYC);
+GENERIC_EVENT_ATTR(stalled-cycles-frontend,PM_GCT_NOSLOT_CYC);
+GENERIC_EVENT_ATTR(stalled-cycles-backend, PM_CMPLU_STALL);
+GENERIC_EVENT_ATTR(instructions,   PM_INST_CMPL);
+GENERIC_EVENT_ATTR(branch-instructions,PM_BRU_FIN);
+GENERIC_EVENT_ATTR(branch-misses,  PM_BR_MPRED_CMPL);
+
+#define EVENT(_name, _code)POWER_EVENT_ATTR(_name, _name);
+#include power8-events-list.h
+#undef EVENT
+
+#define EVENT(_name, _code)POWER_EVENT_PTR(_name),
+
+static struct attribute *power8_events_attr[] = {
+   GENERIC_EVENT_PTR(PM_CYC),
+   GENERIC_EVENT_PTR(PM_GCT_NOSLOT_CYC),
+   GENERIC_EVENT_PTR(PM_CMPLU_STALL),
+   GENERIC_EVENT_PTR(PM_INST_CMPL),
+   GENERIC_EVENT_PTR(PM_BRU_FIN),
+   GENERIC_EVENT_PTR(PM_BR_MPRED_CMPL),
+
+   #include power8-events-list.h
+   #undef EVENT
+   NULL
+};
+
+static struct attribute_group power8_pmu_events_group = {
+   .name = events,
+   .attrs = power8_events_attr,
+};
+
 PMU_FORMAT_ATTR(event, config:0-49);
 PMU_FORMAT_ATTR(pmcxsel,   config:0-7);
 PMU_FORMAT_ATTR(mark,  config:8);
@@ -640,6 +670,7 @@ struct attribute_group power8_pmu_format_group = {
 
 static const struct attribute_group *power8_pmu_attr_groups[] = {
power8_pmu_format_group,
+   power8_pmu_events_group,
NULL,
 };
 
-- 
1.9.1

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

[PATCH 0/8]powerpc/perf: Export memory hierarchy level

2015-06-11 Thread Madhavan Srinivasan
Power8 Perforence Monitoring Unit (PMU) supports different
sampling modes (SM) Random Instruction Sampling (RIS),
Random Load/Store Facility Sampling (RLS) and Random Branch
Sampling (RBS). This patchset enabled RLS mode to mark
Load/Store instructions to save the memory hierarchy level
(eg: L2, L3) for cache reload. Event used here to sample
is marked instruction complete.

This patchset exports the hierarchy information to the user via the
perf_mem_data_src object. Patchset is based on and derived from
Sukadev Bhattiprolu work[1]. It exports the memory hierarchy
information only to Power8 processor based system, since
similiar event or modes are not supported in Power7

[1]:https://lkml.org/lkml/2013/10/15/858

perf interface sample. Workload used here is ebizzy

# perf report -n --mem-mode --sort=mem,sym,dso,symbol_daddr --stdio
# To display the perf.data header info, please use --header/--header-only 
options.
#
# Samples: 33  of event 'cpu/mem_access/'
# Total weight : 33
# Sort order   : mem,sym,dso,symbol_daddr
#
# Overhead   Samples Memory access  
Symbol  Shared ObjectData Symbol
#       
..  .  
.
#
12.12% 4  L2 hit[k] __do_softirq
[kernel.kallsyms]  [k] softirq_vec+0x8
 6.06% 2  L2 hit[k] __schedule  
[kernel.kallsyms]  [k] 0xc003bb975df0
 6.06% 2  Remote Cache (1 hop) hit  [k] scheduler_tick  
[kernel.kallsyms]  [k] 0xc003feb1e4b0
 3.03% 1  L2 hit[k] __acct_update_integrals 
[kernel.kallsyms]  [k] 0xc003b79d8a30
 3.03% 1  L2 hit[.] __memcpy_power7 
libc-2.17.so   [.] 0x010021349b00
 3.03% 1  L2 hit[.] __memcpy_power7 
libc-2.17.so   [.] 0x01002134a030
 3.03% 1  L2 hit[k] __mmdrop
[kernel.kallsyms]  [k] pgtable_cache+0x58
 3.03% 1  L2 hit[k] __update_cpu_load   
[kernel.kallsyms]  [k] 0xc003feb1dc60
 3.03% 1  L2 hit[.] _int_malloc 
libc-2.17.so   [.] 0x3fff9090
 3.03% 1  L2 hit[k] account_system_time 
[kernel.kallsyms]  [k] 0xc003feb08088
.

Madhavan Srinivasan (8):
 powerpc/perf: Remove PME_ prefix for power7 events
 powerpc/perf: Export Power8 generic events in sysfs
 powerpc/perf: EVENT macro for exporting generic events
 powerpc/perf: Add Power8 mem_access event to sysfs
 powerpc/perf: Define big-endian version of perf_mem_data_src
 powerpc/perf: Export Power8 memory hierarchy info to user space
 powerpc/perf: Set data source value
 powerpc/perf: cleanup in perf_event_print_debug()

 arch/powerpc/include/asm/perf_event_server.h |  4 +-
 arch/powerpc/perf/core-book3s.c  | 17 -
 arch/powerpc/perf/power7-pmu.c   | 18 ++---
 arch/powerpc/perf/power8-events-list.h   | 21 ++
 arch/powerpc/perf/power8-pmu.c   | 98 ++--
 include/uapi/linux/perf_event.h  | 16 +
 6 files changed, 155 insertions(+), 19 deletions(-)
 create mode 100644 arch/powerpc/perf/power8-events-list.h

-- 
1.9.1

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

Re: [V2] powerpc/mm: Limit the max memory we can support

2015-06-11 Thread Michael Ellerman
On Fri, 2015-29-05 at 08:20:18 UTC, Aneesh Kumar K.V wrote:
 We need to limit the max memory based on Linux page table format.
 Add checks to limit memory based on pte size. Also limit the memory
 based on MAX_PHSYSMEM_BITS.
 
 Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com
 ---
 Changes from V1:
 * Update commit message. 4K can handle 64TB
 * Also limit based on MAX_PHSYSMEM_BITS
 
  arch/powerpc/include/asm/mmu.h   |  8 
  arch/powerpc/include/asm/sparsemem.h |  2 --
  arch/powerpc/kernel/prom.c   | 25 ++---
  3 files changed, 30 insertions(+), 5 deletions(-)
 
 diff --git a/arch/powerpc/include/asm/mmu.h b/arch/powerpc/include/asm/mmu.h
 index 3d5abfe6ba67..d44d49093c8d 100644
 --- a/arch/powerpc/include/asm/mmu.h
 +++ b/arch/powerpc/include/asm/mmu.h
 @@ -200,6 +200,14 @@ static inline void assert_pte_locked(struct mm_struct 
 *mm, unsigned long addr)
  #  include asm/mmu-8xx.h
  #endif
  
 +#ifdef CONFIG_PHYS_64BIT
 +/*
 + * Max supported memory on 64bit system is 64TB.

Can you document in the comment where the limit comes from?

 + */
 +#define MAX_PHYSMEM_BITS46
 +#else
 +#define MAX_PHYSMEM_BITS32
 +#endif
  
  #endif /* __KERNEL__ */
  #endif /* _ASM_POWERPC_MMU_H_ */
 diff --git a/arch/powerpc/include/asm/sparsemem.h 
 b/arch/powerpc/include/asm/sparsemem.h
 index f6fc0ee813d7..fc3808378893 100644
 --- a/arch/powerpc/include/asm/sparsemem.h
 +++ b/arch/powerpc/include/asm/sparsemem.h
 @@ -11,8 +11,6 @@
  #define SECTION_SIZE_BITS   24
  
  #define MAX_PHYSADDR_BITS   46
 -#define MAX_PHYSMEM_BITS46

Is there now no link between those two?

  #ifdef CONFIG_MEMORY_HOTPLUG
 diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
 index 308c5e15676b..c09315b32ca7 100644
 --- a/arch/powerpc/kernel/prom.c
 +++ b/arch/powerpc/kernel/prom.c
 @@ -698,9 +698,28 @@ void __init early_init_devtree(void *params)
  #endif
   reserve_crashkernel();
   early_reserve_mem();
 -
 - /* Ensure that total memory size is page-aligned. */
 - limit = ALIGN(memory_limit ?: memblock_phys_mem_size(), PAGE_SIZE);
 + /*
 +  * if not specified limit the memory based on the pfn count that
 +  * we can fit in pte_t. Also ensure that total memory size is
 +  * page-aligned.

Shouldn't you do the logic below even if memory_limit is specified? Otherwise
someone can specify a really large memory_limit which will then overflow.

 +  */
 + if (!memory_limit) {
 + int bit_count;
 + phys_addr_t pte_mem_limit;
 +
 + limit = memblock_phys_mem_size();
 + if (limit = (1ULL  MAX_PHYSMEM_BITS))
 + limit = (1ULL  MAX_PHYSMEM_BITS) - 1;
 +
 + BUILD_BUG_ON(sizeof(pte_basic_t)  8);
 + bit_count = (sizeof(pte_basic_t) * 8) - PTE_RPN_SHIFT + 
 PAGE_SHIFT;
 + pte_mem_limit = ~0ULL  (64 - bit_count);

It's fairly obvious what you're doing here, but a bit of a comment wouldn't 
hurt.

 + if (limit  pte_mem_limit)
 + limit = pte_mem_limit;
 + } else
 + limit = memory_limit;
 +
 + limit = ALIGN(limit, PAGE_SIZE);

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

[PATCH 2/4] ppc64 ftrace_with_regs configuration variables

2015-06-11 Thread Torsten Duwe
  * Makefile:
- globally use -mprofile-kernel in case it's configured.
  * arch/powerpc/Kconfig / kernel/trace/Kconfig:
- declare that ppc64 HAVE_MPROFILE_KERNEL and HAVE_DYNAMIC_FTRACE_WITH_REGS,
  and use it.

Signed-off-by: Torsten Duwe d...@suse.de
--
 Makefile |5 -
 arch/powerpc/Kconfig |2 ++
 kernel/trace/Kconfig |5 +
 3 files changed, 11 insertions(+), 1 deletion(-)
--
diff --git a/Makefile b/Makefile
index 3d16bcc..bbd5e87 100644
--- a/Makefile
+++ b/Makefile
@@ -733,7 +733,10 @@ export CC_FLAGS_FTRACE
 ifdef CONFIG_HAVE_FENTRY
 CC_USING_FENTRY:= $(call cc-option, -mfentry -DCC_USING_FENTRY)
 endif
-KBUILD_CFLAGS  += $(CC_FLAGS_FTRACE) $(CC_USING_FENTRY)
+ifdef CONFIG_HAVE_MPROFILE_KERNEL
+CC_USING_MPROFILE_KERNEL   := $(call cc-option, -mprofile-kernel 
-DCC_USING_MPROFILE_KERNEL)
+endif
+KBUILD_CFLAGS  += $(CC_FLAGS_FTRACE) $(CC_USING_FENTRY) 
$(CC_USING_MPROFILE_KERNEL)
 KBUILD_AFLAGS  += $(CC_USING_FENTRY)
 ifdef CONFIG_DYNAMIC_FTRACE
ifdef CONFIG_HAVE_C_RECORDMCOUNT
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 22b0940..566f204 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -94,8 +94,10 @@ config PPC
select OF_RESERVED_MEM
select HAVE_FTRACE_MCOUNT_RECORD
select HAVE_DYNAMIC_FTRACE
+   select HAVE_DYNAMIC_FTRACE_WITH_REGS
select HAVE_FUNCTION_TRACER
select HAVE_FUNCTION_GRAPH_TRACER
+   select HAVE_MPROFILE_KERNEL
select SYSCTL_EXCEPTION_TRACE
select ARCH_WANT_OPTIONAL_GPIOLIB
select VIRT_TO_BUS if !PPC64
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index a5da09c..dd53f3d 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -52,6 +52,11 @@ config HAVE_FENTRY
help
  Arch supports the gcc options -pg with -mfentry
 
+config HAVE_MPROFILE_KERNEL
+   bool
+   help
+ Arch supports the gcc options -pg with -mprofile-kernel
+
 config HAVE_C_RECORDMCOUNT
bool
help
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v8] powerpc/powernv: Poweroff (EPOW, DPO) events support for PowerNV platform

2015-06-11 Thread Vipin K Parashar


On 06/11/2015 04:25 AM, Stewart Smith wrote:

Vipin K Parashar vi...@linux.vnet.ibm.com writes:

This patch adds support for FSP (Flexible Service Processor)
EPOW (Early Power Off Warning) and DPO (Delayed Power Off) events for

Not restricted to FSP systems, it's a generic OPAL API that any platform
could implement.


Re-phrased commit log message and re-posted patch.

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

[PATCH 7/8] powerpc/perf: Set data source value

2015-06-11 Thread Madhavan Srinivasan
perf_sample_data_init initialize the data source variable -val
with PERF_MEM_NA. New value should not be ORed since the userspace
perf tool will look at bitmap field when displaying the hierarchy levels.

Reviewed-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com
Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com
---
 arch/powerpc/perf/power8-pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c
index 40e74a0..667736f 100644
--- a/arch/powerpc/perf/power8-pmu.c
+++ b/arch/powerpc/perf/power8-pmu.c
@@ -684,7 +684,7 @@ static void power8_get_mem_data_src(union perf_mem_data_src 
*dsrc,
if (is_load_store_inst(sier)) {
idx = (sier  POWER8_SIER_LDST_MASK)  POWER8_SIER_LDST_SHIFT;
 
-   dsrc-val |= ldst_src_map[idx];
+   dsrc-val = ldst_src_map[idx];
}
 }
 
-- 
1.9.1

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

Re: [PATCH 08/12] fsl/fman: Add Frame Manager support

2015-06-11 Thread Paul Bolle
So I couldn't help having yet another look at the code, just to drive
home my point.

On Thu, 2015-06-11 at 10:55 +0200, Paul Bolle wrote:
  +void *fm_drv_init(void)
 
 static.
 
  +{
  +   memset(fm_drvs, 0, sizeof(fm_drvs));

fm_drvs is an external variable. It is guaranteed to be zero, isn't it?

  +   mutex_init(fm_drv_mutex);
  +
  +   /* Register to the DTB for basic FM API */
  +   platform_driver_register(fm_driver);
  +
  +   return fm_drvs;

You're returning a pointer to external variable. How's that useful?

And note this is the last time we'll ever see fm_drvs. So I think that
all this variable does for the code is getting initialized to zero,
twice.

  +}
  +
  +int fm_drv_free(void *p_fm_drv)
 
 static.
 
  +{
  +   platform_driver_unregister(fm_driver);
  +   mutex_destroy(fm_drv_mutex);
  +
  +   return 0;

This function has one caller, which doesn't check the return value. So
this should be a function returning void. Of course, a wrapper of two
lines called only once means you should actually not put this into a
separate function.

  +}

  +static void *p_fm_drv;
 
  +static int __init __cold fm_load(void)
  +{
  +   p_fm_drv = fm_drv_init();
  +   if (!p_fm_drv) {

fm_drv_init() returns a pointer to an external variable. So how can this
happen?

  +   pr_err(Failed to init FM wrapper!\n);
  +   return -ENODEV;
  +   }
  +
  +   pr_info(Freescale FM module\n);
  +   return 0;
  +}

This is all rather basic. It must be, otherwise I wouldn't spot it.

So I keep spotting these basic oddities, with every cup of coffee I
treat myself to while reading through this, wherever I look. By now I'm
sure there's no need for the netdev people to look at this, not yet. 


Paul Bolle

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

[PATCH SLOF] disk-label: add support for booting from GPT FAT partition

2015-06-11 Thread Nikunj A Dadhania
For a GPT+LVM combination disk, older bootloader that does not support
LVM, cannot load kernel from LVM.

The patch add support to read from BASIC_DATA UUID
partition. Installer has installed CHRP-BOOT config on a FAT file
system.

Signed-off-by: Nikunj A Dadhania nik...@linux.vnet.ibm.com
---
 slof/fs/packages/disk-label.fs | 72 --
 1 file changed, 70 insertions(+), 2 deletions(-)

diff --git a/slof/fs/packages/disk-label.fs b/slof/fs/packages/disk-label.fs
index fe1c25e..bf5fb5c 100644
--- a/slof/fs/packages/disk-label.fs
+++ b/slof/fs/packages/disk-label.fs
@@ -266,7 +266,7 @@ CONSTANT /gpt-part-entry
 
 : try-dos-partition ( -- okay? )
\ Read partition table and check magic.
-   no-mbr? IF cr . No DOS disk-label found. cr false EXIT THEN
+   no-mbr? IF false EXIT THEN
 
count-dos-logical-partitions TO dos-logical-partitions
 
@@ -408,6 +408,73 @@ AA26 CONSTANT GPT-PREP-PARTITION-4
FALSE
 ;
 
+\ Check for GPT MSFT BASIC DATA GUID - vfat based
+EBD0A0A2 CONSTANT GPT-BASIC-DATA-PARTITION-1
+B9E5 CONSTANT GPT-BASIC-DATA-PARTITION-2
+4433 CONSTANT GPT-BASIC-DATA-PARTITION-3
+87C0 CONSTANT GPT-BASIC-DATA-PARTITION-4
+68B6B72699C7 CONSTANT GPT-BASIC-DATA-PARTITION-5
+
+: gpt-basic-data-partition? ( -- true|false )
+   block gpt-part-entrypart-type-guid l@-le GPT-BASIC-DATA-PARTITION-1 = IF
+  block gpt-part-entrypart-type-guid 4 + w@-le
+  GPT-BASIC-DATA-PARTITION-2 = IF
+ block gpt-part-entrypart-type-guid 6 + w@-le
+ GPT-BASIC-DATA-PARTITION-3 = IF
+block gpt-part-entrypart-type-guid 8 + w@
+GPT-BASIC-DATA-PARTITION-4 = IF
+   block gpt-part-entrypart-type-guid a + w@
+   block gpt-part-entrypart-type-guid c + l@ swap lxjoin
+   GPT-BASIC-DATA-PARTITION-5 = IF
+   TRUE EXIT
+   THEN
+THEN
+ THEN
+  THEN
+   THEN
+   FALSE
+;
+
+: try-gpt-vfat-partition ( -- okay? )
+   \ Read partition table and check magic.
+   no-gpt? IF cr . No GPT disk-label found. cr false EXIT THEN
+   1 read-sector block gptpart-entry-lba l@-le
+   block-size * to seek-pos
+   block gptpart-entry-size l@-le to gpt-part-size
+   block gptnum-part-entry l@-le dup 0= IF FALSE EXIT THEN
+   1+ 1 ?DO
+  seek-pos 0 seek drop
+  block gpt-part-size read drop
+  gpt-basic-data-partition? IF
+ debug-disk-label? IF
+. GPT LINUX DATA partition found  cr
+ THEN
+ block gpt-part-entryfirst-lba x@ xbflip
+ dup to part-start
+ block gpt-part-entrylast-lba x@ xbflip
+ over - 1+ ( addr offset len )
+ dup block-size * to part-size
+ swap  ( addr len offset )
+ block-size * to part-offset
+ 0 0 seek
+ block block-size read
+ 3drop
+ \ block 0 byte 0-2 is a jump instruction in all FAT
+ \ filesystems.
+ \ e9 and eb are jump instructions in x86 assembler.
+ block c@ e9  IF
+block c@ eb 
+block 2+ c@ 90  or
+IF false EXIT THEN
+ THEN
+ TRUE
+ UNLOOP EXIT
+  THEN
+  seek-pos gpt-part-size i * + to seek-pos
+LOOP
+FALSE
+;
+
 \ Extract the boot loader path from a bootinfo.txt file
 \ In: address and length of buffer where the bootinfo.txt has been loaded to.
 \ Out: string address and length of the boot loader (within the input buffer)
@@ -493,7 +560,7 @@ AA26 CONSTANT GPT-PREP-PARTITION-4
 
debug-disk-label? IF . Trying CHRP boot  .s cr THEN
1 disk-chrp-boot !
-   dup load-chrp-boot-file ?dup 0  IF .s cr nip EXIT THEN
+   dup load-chrp-boot-file ?dup 0  IF nip EXIT THEN
0 disk-chrp-boot !
 
debug-disk-label? IF . Trying GPT boot  .s cr THEN
@@ -600,6 +667,7 @@ AA26 CONSTANT GPT-PREP-PARTITION-4
 
 : try-partitions ( -- found? )
try-dos-partition IF try-files EXIT THEN
+   try-gpt-vfat-partition IF try-files EXIT THEN
\ try-iso9660-partition IF try-files EXIT THEN
\ ... more partition types here...
false
-- 
1.8.3.1

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

[PATCH 5/8]powerpc/perf: Define big-endian version of perf_mem_data_src

2015-06-11 Thread Madhavan Srinivasan
From: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com

perf_mem_data_src is an union that is initialized via the -val field
and accessed via the bitmap fields. For this to work on big endian
platforms, we also need a big-endian represenation of perf_mem_data_src.

Signed-off-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com
Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com
---
 include/uapi/linux/perf_event.h | 16 
 1 file changed, 16 insertions(+)

diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index 9b79abb..b3f4099 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -747,6 +747,7 @@ enum perf_callchain_context {
 #define PERF_FLAG_PID_CGROUP   (1UL  2) /* pid=cgroup id, per-cpu 
mode only */
 #define PERF_FLAG_FD_CLOEXEC   (1UL  3) /* O_CLOEXEC */
 
+#if defined(__LITTLE_ENDIAN_BITFIELD)
 union perf_mem_data_src {
__u64 val;
struct {
@@ -758,6 +759,21 @@ union perf_mem_data_src {
mem_rsvd:31;
};
 };
+#elif defined(__BIG_ENDIAN_BITFIELD)
+union perf_mem_data_src {
+   __u64 val;
+   struct {
+   __u64   mem_rsvd:31,
+   mem_dtlb:7, /* tlb access */
+   mem_lock:2, /* lock instr */
+   mem_snoop:5,/* snoop mode */
+   mem_lvl:14, /* memory hierarchy level */
+   mem_op:5;   /* type of opcode */
+   };
+};
+#else
+#error Unknown endianness
+#endif
 
 /* type of opcode (load/store/prefetch,code) */
 #define PERF_MEM_OP_NA 0x01 /* not available */
-- 
1.9.1

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

[PATCH 3/8]powerpc/perf: EVENT macro for exporting generic events

2015-06-11 Thread Madhavan Srinivasan
Adding EVENT macro for exporting Power8 generic events

Reviewed-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com
Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com
---
 arch/powerpc/perf/power8-pmu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c
index a542310..282ab40 100644
--- a/arch/powerpc/perf/power8-pmu.c
+++ b/arch/powerpc/perf/power8-pmu.c
@@ -21,6 +21,8 @@
 /*
  * Some power8 event codes.
  */
+#define EVENT(_name, _code) \
+   _name = _code,
 enum {
 #include power8-events-list.h
 };
-- 
1.9.1

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

[PATCH 1/4] ppc64 FTRACE_WITH_REGS implementation

2015-06-11 Thread Torsten Duwe
Implement FTRACE_WITH_REGS for powerpc64, on ELF ABI v2.
Initial work started by Vojtech Pavlik, used with permission.

  * arch/powerpc/kernel/entry_64.S:
- enhance _mcount with a stub to test (ftrace_trace_function == 
ftrace_stub)
  as suggested in Documentation/trace/ftrace-design.txt
  (for reference only, patched out at runtime)
- Implement an effective ftrace_caller that works from within the kernel
  binary as well as from modules.
  * arch/powerpc/kernel/ftrace.c:
- be prepared to deal with ppc64 ELV ABI v2, especially calls to _mcount
  that result from gcc -mprofile-kernel
  * arch/powerpc/kernel/module_64.c:
- do not save the TOC pointer on the trampoline when the destination
  is ftrace_caller. This trampoline jump happens from a function prologue
  before a new stack frame is set up, so bad things may happen otherwise...
- relax is_module_trampoline() to recognise the modified trampoline.

Signed-off-by: Torsten Duwe d...@suse.de
--
 arch/powerpc/include/asm/ftrace.h |5 +
 arch/powerpc/kernel/entry_64.S|  112 +++---
 arch/powerpc/kernel/ftrace.c  |   67 --
 arch/powerpc/kernel/module_64.c   |   33 ++-
 4 files changed, 186 insertions(+), 31 deletions(-)
--
diff --git a/arch/powerpc/include/asm/ftrace.h 
b/arch/powerpc/include/asm/ftrace.h
index e366187..691 100644
--- a/arch/powerpc/include/asm/ftrace.h
+++ b/arch/powerpc/include/asm/ftrace.h
@@ -46,6 +46,8 @@
 extern void _mcount(void);
 
 #ifdef CONFIG_DYNAMIC_FTRACE
+# define FTRACE_ADDR ((unsigned long)ftrace_caller+8)
+# define FTRACE_REGS_ADDR FTRACE_ADDR
 static inline unsigned long ftrace_call_adjust(unsigned long addr)
 {
/* reloction of mcount call site is the same as the address */
@@ -58,6 +60,9 @@ struct dyn_arch_ftrace {
 #endif /*  CONFIG_DYNAMIC_FTRACE */
 #endif /* __ASSEMBLY__ */
 
+#ifdef CONFIG_DYNAMIC_FTRACE
+#define ARCH_SUPPORTS_FTRACE_OPS 1
+#endif
 #endif
 
 #if defined(CONFIG_FTRACE_SYSCALLS)  defined(CONFIG_PPC64)  
!defined(__ASSEMBLY__)
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index d180caf..a4132ef 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -1152,32 +1152,107 @@ _GLOBAL(enter_prom)
 
 #ifdef CONFIG_FUNCTION_TRACER
 #ifdef CONFIG_DYNAMIC_FTRACE
-_GLOBAL(mcount)
+
+#define TOCSAVE 24
+
 _GLOBAL(_mcount)
-   blr
+   nop // REQUIRED for ftrace, to calculate local/global entry diff
+.localentry _mcount,.-_mcount
+   mflrr0
+   mtctr   r0
+
+   LOAD_REG_ADDR_PIC(r12,ftrace_trace_function)
+   ld  r12,0(r12)
+   LOAD_REG_ADDR_PIC(r0,ftrace_stub)
+   cmpdr0,r12
+   ld  r0,LRSAVE(r1)
+   bne-2f
+
+   mtlrr0
+   bctr
+
+2: /* here we have (*ftrace_trace_function)() in r12,
+  selfpc in CTR
+  and frompc in r0 */
+
+   mtlrr0
+   bctr
+
+_GLOBAL(ftrace_caller)
+   mr  r0,r2   // global (module) call: save module TOC
+   b   1f
+.localentry ftrace_caller,.-ftrace_caller
+   mr  r0,r2   // local call: callee's TOC == our TOC
+   b   2f
+
+1: addis   r2,r12,(.TOC.-0b)@ha
+   addir2,r2,(.TOC.-0b)@l
+
+2: // Here we have our proper TOC ptr in R2,
+   // and the one we need to restore on return in r0.
+
+   ld  r12, 16(r1) // get caller's adress
+
+   stdur1,-SWITCH_FRAME_SIZE(r1)
+
+   std r12, _LINK(r1)
+   SAVE_8GPRS(0,r1)
+   std r0,TOCSAVE(r1)
+   SAVE_8GPRS(8,r1)
+   SAVE_8GPRS(16,r1)
+   SAVE_8GPRS(24,r1)
+
+
+   LOAD_REG_IMMEDIATE(r3,function_trace_op)
+   ld  r5,0(r3)
+
+   mflrr3
+   std r3, _NIP(r1)
+   std r3, 16(r1)
+   subir3, r3, MCOUNT_INSN_SIZE
+   mfmsr   r4
+   std r4, _MSR(r1)
+   mfctr   r4
+   std r4, _CTR(r1)
+   mfxer   r4
+   std r4, _XER(r1)
+   mr  r4, r12
+   addir6, r1 ,STACK_FRAME_OVERHEAD
 
-_GLOBAL_TOC(ftrace_caller)
-   /* Taken from output of objdump from lib64/glibc */
-   mflrr3
-   ld  r11, 0(r1)
-   stdur1, -112(r1)
-   std r3, 128(r1)
-   ld  r4, 16(r11)
-   subir3, r3, MCOUNT_INSN_SIZE
 .globl ftrace_call
 ftrace_call:
bl  ftrace_stub
nop
+
+   ld  r3, _NIP(r1)
+   mtlrr3
+
+   REST_8GPRS(0,r1)
+   REST_8GPRS(8,r1)
+   REST_8GPRS(16,r1)
+   REST_8GPRS(24,r1)
+
+   addi r1, r1, SWITCH_FRAME_SIZE
+
+   ld  r12, 16(r1) // get caller's adress
+   mr  r2,r0   // restore callee's TOC
+   mflrr0  // move this LR to CTR
+   mtctr   r0
+   mr  r0,r12  // restore callee's lr at _mcount site
+   mtlrr0
+   bctr// jump after _mcount site
+
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
 .globl 

[PATCH v3 2/2] cxl: use more common format specifier

2015-06-11 Thread Rasmus Villemoes
A precision of 16 (%.16llx) has the same effect as a field width of 16
along with passing the 0 flag (%016llx), but the latter is much more
common in the kernel tree. Update cxl to use that.

Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
So, maybe this on top?

 drivers/misc/cxl/irq.c| 32 
 drivers/misc/cxl/native.c | 10 +-
 drivers/misc/cxl/pci.c| 10 +-
 drivers/misc/cxl/trace.h  | 10 +-
 4 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c
index 4b73f4b9e7f1..f1bd3e6e6109 100644
--- a/drivers/misc/cxl/irq.c
+++ b/drivers/misc/cxl/irq.c
@@ -30,12 +30,12 @@ static irqreturn_t handle_psl_slice_error(struct 
cxl_context *ctx, u64 dsisr, u6
serr = cxl_p1n_read(ctx-afu, CXL_PSL_SERR_An);
afu_debug = cxl_p1n_read(ctx-afu, CXL_AFU_DEBUG_An);
 
-   dev_crit(ctx-afu-dev, PSL ERROR STATUS: 0x%.16llx\n, errstat);
-   dev_crit(ctx-afu-dev, PSL_FIR1: 0x%.16llx\n, fir1);
-   dev_crit(ctx-afu-dev, PSL_FIR2: 0x%.16llx\n, fir2);
-   dev_crit(ctx-afu-dev, PSL_SERR_An: 0x%.16llx\n, serr);
-   dev_crit(ctx-afu-dev, PSL_FIR_SLICE_An: 0x%.16llx\n, fir_slice);
-   dev_crit(ctx-afu-dev, CXL_PSL_AFU_DEBUG_An: 0x%.16llx\n, 
afu_debug);
+   dev_crit(ctx-afu-dev, PSL ERROR STATUS: 0x%016llx\n, errstat);
+   dev_crit(ctx-afu-dev, PSL_FIR1: 0x%016llx\n, fir1);
+   dev_crit(ctx-afu-dev, PSL_FIR2: 0x%016llx\n, fir2);
+   dev_crit(ctx-afu-dev, PSL_SERR_An: 0x%016llx\n, serr);
+   dev_crit(ctx-afu-dev, PSL_FIR_SLICE_An: 0x%016llx\n, fir_slice);
+   dev_crit(ctx-afu-dev, CXL_PSL_AFU_DEBUG_An: 0x%016llx\n, 
afu_debug);
 
dev_crit(ctx-afu-dev, STOPPING CXL TRACE\n);
cxl_stop_trace(ctx-afu-adapter);
@@ -54,10 +54,10 @@ irqreturn_t cxl_slice_irq_err(int irq, void *data)
fir_slice = cxl_p1n_read(afu, CXL_PSL_FIR_SLICE_An);
errstat = cxl_p2n_read(afu, CXL_PSL_ErrStat_An);
afu_debug = cxl_p1n_read(afu, CXL_AFU_DEBUG_An);
-   dev_crit(afu-dev, PSL_SERR_An: 0x%.16llx\n, serr);
-   dev_crit(afu-dev, PSL_FIR_SLICE_An: 0x%.16llx\n, fir_slice);
-   dev_crit(afu-dev, CXL_PSL_ErrStat_An: 0x%.16llx\n, errstat);
-   dev_crit(afu-dev, CXL_PSL_AFU_DEBUG_An: 0x%.16llx\n, afu_debug);
+   dev_crit(afu-dev, PSL_SERR_An: 0x%016llx\n, serr);
+   dev_crit(afu-dev, PSL_FIR_SLICE_An: 0x%016llx\n, fir_slice);
+   dev_crit(afu-dev, CXL_PSL_ErrStat_An: 0x%016llx\n, errstat);
+   dev_crit(afu-dev, CXL_PSL_AFU_DEBUG_An: 0x%016llx\n, afu_debug);
 
cxl_p1n_write(afu, CXL_PSL_SERR_An, serr);
 
@@ -72,7 +72,7 @@ static irqreturn_t cxl_irq_err(int irq, void *data)
WARN(1, CXL ERROR interrupt %i\n, irq);
 
err_ivte = cxl_p1_read(adapter, CXL_PSL_ErrIVTE);
-   dev_crit(adapter-dev, PSL_ErrIVTE: 0x%.16llx\n, err_ivte);
+   dev_crit(adapter-dev, PSL_ErrIVTE: 0x%016llx\n, err_ivte);
 
dev_crit(adapter-dev, STOPPING CXL TRACE\n);
cxl_stop_trace(adapter);
@@ -80,7 +80,7 @@ static irqreturn_t cxl_irq_err(int irq, void *data)
fir1 = cxl_p1_read(adapter, CXL_PSL_FIR1);
fir2 = cxl_p1_read(adapter, CXL_PSL_FIR2);
 
-   dev_crit(adapter-dev, PSL_FIR1: 0x%.16llx\nPSL_FIR2: 0x%.16llx\n, 
fir1, fir2);
+   dev_crit(adapter-dev, PSL_FIR1: 0x%016llx\nPSL_FIR2: 0x%016llx\n, 
fir1, fir2);
 
return IRQ_HANDLED;
 }
@@ -147,7 +147,7 @@ static irqreturn_t cxl_irq(int irq, void *data, struct 
cxl_irq_info *irq_info)
if (dsisr  CXL_PSL_DSISR_An_PE)
return handle_psl_slice_error(ctx, dsisr, irq_info-errstat);
if (dsisr  CXL_PSL_DSISR_An_AE) {
-   pr_devel(CXL interrupt: AFU Error 0x%.16llx\n, 
irq_info-afu_err);
+   pr_devel(CXL interrupt: AFU Error 0x%016llx\n, 
irq_info-afu_err);
 
if (ctx-pending_afu_err) {
/*
@@ -158,7 +158,7 @@ static irqreturn_t cxl_irq(int irq, void *data, struct 
cxl_irq_info *irq_info)
 * probably best that we log them somewhere:
 */
dev_err_ratelimited(ctx-afu-dev, CXL AFU Error 
-   undelivered to pe %i: 0x%.16llx\n,
+   undelivered to pe %i: 0x%016llx\n,
ctx-pe, irq_info-afu_err);
} else {
spin_lock(ctx-lock);
@@ -211,8 +211,8 @@ static irqreturn_t cxl_irq_multiplexed(int irq, void *data)
}
rcu_read_unlock();
 
-   WARN(1, Unable to demultiplex CXL PSL IRQ for PE %i DSISR %.16llx DAR
-%.16llx\n(Possible AFU HW issue - was a term/remove acked
+   WARN(1, Unable to demultiplex CXL PSL IRQ for PE %i DSISR %016llx DAR
+%016llx\n(Possible AFU HW issue - was a term/remove acked
 with outstanding transactions?)\n, ph, irq_info.dsisr,

[PATCH] powerpc/powernv: Bump opal_init initcall priority

2015-06-11 Thread Alistair Popple
opal_init() is called via a machine_subsys_initcall(). Due to a hack
in the eeh code the eeh driver is initialised with at the same
initcall level. This means depending on link ordering the following
error can occur because the opal irchip has not been initialised:

irq: XICS didn't like hwirq-0x9 to VIRQ17 mapping (rc=-22)
pnv_eeh_post_init: Can't request OPAL event interrupt (0)

This patch solves the issue by making sure opal_init is called prior
to the subsystems that may need it.

Signed-off-by: Alistair Popple alist...@popple.id.au
Reported-by: Daniel Axtens d...@axtens.net
---

Michael,

This fixes a problem in your next tree introduced by my opal irqchip
series. I encountered similar problems when moving some of the other
subsystems across to the new interface which was the motivation behind
the first patch in that series (powerpc/powernv: Reorder OPAL
subsystem initialisation). I missed this one due to a quirk in the
generic eeh code.

It seems that initcall dependencies are not well defined (or at least
my understanding of the dependencies isn't), so I'm not overly
comfortable with this fix. To be honest I don't have a clear
understanding of what side effects bumping this up a level might have
- it boots, everything seems to work, and a quick grep reveals
nothing obvious. However I'm open to suggestions for a better fix...

In the meantime this should fix the problem in your branch until I get
a chance to dig further.

- Alistair

 arch/powerpc/platforms/powernv/opal.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powernv/opal.c 
b/arch/powerpc/platforms/powernv/opal.c
index 9e9c483..cc3ba5f 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -718,7 +718,7 @@ static int __init opal_init(void)

return 0;
 }
-machine_subsys_initcall(powernv, opal_init);
+machine_arch_initcall(powernv, opal_init);

 void opal_shutdown(void)
 {
--
1.7.10.4

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

Re: [alsa-devel] [PATCH v2] ALSA: aoa: convert bus code to use dev_groups

2015-06-11 Thread Takashi Iwai
At Thu, 11 Jun 2015 10:03:38 +0200,
Quentin Lambert wrote:
 
 
 The dev_attrs field of struct bus_type is going away, use dev_groups instead.
 This converts the soundbus code to use the correct field.
 
 Given that all other usages of the macro define the struct attribute
 *xxx_attrs[] in the same file they assign the .dev_groups field, this patch
 merges sysfs.c into core.c.
 
 These modifications were made using Coccinelle.
 
 Signed-off-by: Quentin Lambert lambert.quen...@gmail.com
 ---
  Changes since v1:
   - Fix the commit message to actually talk about soundbus rather than MDIO
   - This version attempt to fix a problem resulting from the macro
 ATTRIBUTE_GROUPS declaring the structure as static by merging sysfs.c into
 core.c. I understand that this may not be the prefered solution since 
 Takashi suggested that adding a comment line to the previous version could
 be acceptable. 

Hmm, the patch doesn't look as mentioned here.
It's rather bigger than the previous patch.  Is this intentional?


Takashi

 
  sound/aoa/soundbus/Makefile   |2 -
  sound/aoa/soundbus/core.c |   44 
 +-
  sound/aoa/soundbus/soundbus.h |2 -
  sound/aoa/soundbus/sysfs.c|   42 
  4 files changed, 44 insertions(+), 46 deletions(-)
 
 --- a/sound/aoa/soundbus/Makefile
 +++ b/sound/aoa/soundbus/Makefile
 @@ -1,3 +1,3 @@
  obj-$(CONFIG_SND_AOA_SOUNDBUS) += snd-aoa-soundbus.o
 -snd-aoa-soundbus-objs := core.o sysfs.o
 +snd-aoa-soundbus-objs := core.o
  obj-$(CONFIG_SND_AOA_SOUNDBUS_I2S) += i2sbus/
 --- a/sound/aoa/soundbus/core.c
 +++ b/sound/aoa/soundbus/core.c
 @@ -150,6 +150,48 @@ static int soundbus_device_resume(struct
  
  #endif /* CONFIG_PM */
  
 +#define soundbus_config_of_attr(field, format_string)
 \
 +static ssize_t   
 \
 +field##_show (struct device *dev, struct device_attribute *attr, \
 +  char *buf) \
 +{\
 + struct soundbus_dev *mdev = to_soundbus_device (dev);   \
 + return sprintf (buf, format_string, mdev-ofdev.dev.of_node-field); \
 +}
 +
 +static ssize_t modalias_show(struct device *dev, struct device_attribute 
 *attr,
 +  char *buf)
 +{
 + struct soundbus_dev *sdev = to_soundbus_device(dev);
 + struct platform_device *of = sdev-ofdev;
 + int length;
 +
 + if (*sdev-modalias) {
 + strlcpy(buf, sdev-modalias, sizeof(sdev-modalias) + 1);
 + strcat(buf, \n);
 + length = strlen(buf);
 + } else {
 + length = sprintf(buf, of:N%sT%s\n,
 +  of-dev.of_node-name, of-dev.of_node-type);
 + }
 +
 + return length;
 +}
 +static DEVICE_ATTR_RO(modalias);
 +
 +soundbus_config_of_attr (name, %s\n);
 +static DEVICE_ATTR_RO(name);
 +soundbus_config_of_attr (type, %s\n);
 +static DEVICE_ATTR_RO(type);
 +
 +struct attribute *soundbus_dev_attrs[] = {
 + dev_attr_name.attr,
 + dev_attr_type.attr,
 + dev_attr_modalias.attr,
 + NULL,
 +};
 +ATTRIBUTE_GROUPS(soundbus_dev);
 +
  static struct bus_type soundbus_bus_type = {
   .name   = aoa-soundbus,
   .probe  = soundbus_probe,
 @@ -160,7 +202,7 @@ static struct bus_type soundbus_bus_type
   .suspend= soundbus_device_suspend,
   .resume = soundbus_device_resume,
  #endif
 - .dev_attrs  = soundbus_dev_attrs,
 + .dev_groups = soundbus_dev_groups,
  };
  
  int soundbus_add_one(struct soundbus_dev *dev)
 --- a/sound/aoa/soundbus/soundbus.h
 +++ b/sound/aoa/soundbus/soundbus.h
 @@ -199,6 +199,4 @@ struct soundbus_driver {
  extern int soundbus_register_driver(struct soundbus_driver *drv);
  extern void soundbus_unregister_driver(struct soundbus_driver *drv);
  
 -extern struct device_attribute soundbus_dev_attrs[];
 -
  #endif /* __SOUNDBUS_H */
 --- a/sound/aoa/soundbus/sysfs.c
 +++ /dev/null
 @@ -1,42 +0,0 @@
 -#include linux/kernel.h
 -#include linux/stat.h
 -/* FIX UP */
 -#include soundbus.h
 -
 -#define soundbus_config_of_attr(field, format_string)
 \
 -static ssize_t   
 \
 -field##_show (struct device *dev, struct device_attribute *attr, \
 -  char *buf) \
 -{\
 - struct soundbus_dev *mdev = to_soundbus_device (dev);   \
 - return sprintf (buf, format_string, mdev-ofdev.dev.of_node-field); \
 -}
 -
 -static ssize_t modalias_show(struct device *dev, struct device_attribute 
 *attr,
 -  char *buf)
 -{
 - struct soundbus_dev *sdev = to_soundbus_device(dev);
 - struct platform_device *of = 

[PATCH 8/8]powerpc/perf: cleanup in perf_event_print_debug()

2015-06-11 Thread Madhavan Srinivasan
From: Janani janan...@linux.vnet.ibm.com

Code cleanup/fix in perf_event_print_debug(). Performance
Monitoring Unit (PMU) registers in the server side
are 64bit long.

Signed-off-by: Janani janan...@linux.vnet.ibm.com
Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com
---
 arch/powerpc/perf/core-book3s.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 4b27caf..36dc23b 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -758,7 +758,7 @@ static void write_pmc(int idx, unsigned long val)
 void perf_event_print_debug(void)
 {
unsigned long sdar, sier, flags;
-   u32 pmcs[MAX_HWEVENTS];
+   unsigned long pmcs[MAX_HWEVENTS];
int i;
 
if (!ppmu-n_counter)
@@ -775,11 +775,11 @@ void perf_event_print_debug(void)
for (; i  MAX_HWEVENTS; i++)
pmcs[i] = 0xdeadbeef;
 
-   pr_info(PMC1:  %08x PMC2: %08x PMC3: %08x PMC4: %08x\n,
+   pr_info(PMC1:  %016lx PMC2: %016lx PMC3: %016lx PMC4: %016lx\n,
 pmcs[0], pmcs[1], pmcs[2], pmcs[3]);
 
if (ppmu-n_counter  4)
-   pr_info(PMC5:  %08x PMC6: %08x PMC7: %08x PMC8: %08x\n,
+   pr_info(PMC5:  %016lx PMC6: %016lx PMC7: %016lx PMC8: 
%016lx\n,
 pmcs[4], pmcs[5], pmcs[6], pmcs[7]);
 
pr_info(MMCR0: %016lx MMCR1: %016lx MMCRA: %016lx\n,
-- 
1.9.1

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

[PATCH 3/4] ppc64 ftrace_with_regs: spare early boot and low level code

2015-06-11 Thread Torsten Duwe
Using -mprofile-kernel on early boot code not only confuses the checker
but is also useless, as the infrastructure is not yet in place. Proceed
like with -pg (remove it from CFLAGS), equally with time.o and ftrace itself.

  * arch/powerpc/kernel/Makefile:
- remove -mprofile-kernel from low level and boot code objects' CFLAGS
  for FUNCTION_TRACER configurations.

Signed-off-by: Torsten Duwe d...@suse.de
--
 arch/powerpc/kernel/Makefile |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)
--
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 502cf69..fb33fc5 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -17,14 +17,14 @@ endif
 
 ifdef CONFIG_FUNCTION_TRACER
 # Do not trace early boot code
-CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog
-CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog
-CFLAGS_REMOVE_btext.o = -pg -mno-sched-epilog
-CFLAGS_REMOVE_prom.o = -pg -mno-sched-epilog
+CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog -mprofile-kernel
+CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog -mprofile-kernel
+CFLAGS_REMOVE_btext.o = -pg -mno-sched-epilog -mprofile-kernel
+CFLAGS_REMOVE_prom.o = -pg -mno-sched-epilog -mprofile-kernel
 # do not trace tracer code
-CFLAGS_REMOVE_ftrace.o = -pg -mno-sched-epilog
+CFLAGS_REMOVE_ftrace.o = -pg -mno-sched-epilog -mprofile-kernel
 # timers used by tracing
-CFLAGS_REMOVE_time.o = -pg -mno-sched-epilog
+CFLAGS_REMOVE_time.o = -pg -mno-sched-epilog -mprofile-kernel
 endif
 
 obj-y  := cputable.o ptrace.o syscalls.o \
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RESEND PATCH v8] powerpc/powernv: Add poweroff (EPOW, DPO) events support for PowerNV platform

2015-06-11 Thread Vipin K Parashar
This patch adds support for OPAL EPOW (Early Power Off Warning) and
DPO (Delayed Power Off) events for the PowerNV platform. These events
are generated on FSP (Flexible Service Processor) based systems. EPOW
events are generated due to various critical system conditions that
require system shutdown. A few examples of these conditions are high
ambient temperature or system running on UPS power with low UPS battery.
DPO event is generated in response to admin initiated system shutdown
request. Upon receipt of EPOW and DPO events the host kernel invokes
orderly_poweroff() for performing graceful system shutdown.

Reviewed-by: Joel Stanley j...@jms.id.au
Reviewed-by: Vaibhav Jain vaib...@linux.vnet.ibm.com
Reviewed-by: Michael Ellerman m...@ellerman.id.au

Changes in v8:
 - Added logic to filter events which doesn't require system shutdown
   for EPOW scenario.
 - Re-phrased patch description.

Changes in v7:
 - Fixed logic to check epow support to avoid EPOW, DPO handling path
   for BMC systems.

Changes in v6:
 - Made below changes as suggested by Michael Ellerman on previous patch.
 - Changed EPOW, DPO notifier blocks to use opal_power_control_event()
   and enhanced opal_power_control_event() to handle EPOW and DPO events.
 - Reorganized code and added/changed few variable, function names removing
   older ones.
 - Minor cleanup like removing unused headers, blank lines etc.

Changes in v5:
 - Made changes to address review comments on previous patch.

Changes in v4:
 - Made changes to address review comments on previous patch.

Changes in v3:
 - Made changes to immediately call orderly_poweroff upon receipt of
   OPAL EPOW, DPO notifications.
 - Made code changes to address review comments on previous patch.
 - Made code changes to use existing OPAL EPOW API.
 - Removed patch to extract EPOW event timeout from OPAL device-tree.

Changes in v2:
 - Made code changes to improve code as per previous review comments.
 - Added patch to obtain EPOW event timeout values from OPAL device-tree.

Vipin K Parashar (1):
  powerpc/powernv: Add poweroff (EPOW, DPO) events support for PowerNV
platform

 arch/powerpc/include/asm/opal-api.h|  40 +++
 arch/powerpc/include/asm/opal.h|   3 +-
 arch/powerpc/platforms/powernv/opal-power.c| 147 ++---
 arch/powerpc/platforms/powernv/opal-wrappers.S |   1 +
 4 files changed, 173 insertions(+), 18 deletions(-)

-- 
1.9.3

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

[PATCH 4/8]powerpc/perf: Add Power8 mem_access event to sysfs

2015-06-11 Thread Madhavan Srinivasan
Patch add mem_access event to sysfs. This as-is not a raw event
supported by Power8 pmu. Instead, it is formed based on
raw event encoding specificed in Power8-pmu.c.

Primary PMU event used here is PM_MRK_INST_CMPL.
This event tracks only the completed marked instructions.

Random sampling mode (MMCRA[SM]) with Random Load/Store
Facility Sampling (RLS) is enabled to mark type of instructions.

With Random sampling in RLS mode with PM_MRK_INST_CMPL event
on Power8, the LDST field in SIER identifies the memory
hierarchy level (eg: L1, L2 etc), from which a data-cache
miss for a marked instruction are satisfied.

Reviewed-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com
Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com
---
 arch/powerpc/perf/power8-events-list.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/perf/power8-events-list.h 
b/arch/powerpc/perf/power8-events-list.h
index 1368547..fdb8ce2 100644
--- a/arch/powerpc/perf/power8-events-list.h
+++ b/arch/powerpc/perf/power8-events-list.h
@@ -18,3 +18,4 @@ EVENT(PM_CMPLU_STALL, 0x4000a)
 EVENT(PM_INST_CMPL,0x2)
 EVENT(PM_BRU_FIN,  0x10068)
 EVENT(PM_BR_MPRED_CMPL,0x400f6)
+EVENT(mem_access,  0x100010401e0)
-- 
1.9.1

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

[PATCH v3 1/2] cxl: Add explicit precision specifiers

2015-06-11 Thread Rasmus Villemoes
C99 says that a precision given as simply '.' with no following digits
or * should be interpreted as 0. The kernel's printf implementation,
however, treats this case as if the precision was omitted. C99 also
says that if both the precision and value are 0, no digits should be
printed. Even if the kernel followed C99 to the letter, I don't think
that would be particularly useful in these cases. For consistency with
most other format strings in the file, use an explicit precision of 16
and add a 0x prefix.

Signed-off-by: Rasmus Villemoes li...@rasmusvillemoes.dk
---
v3: same as v2, just resending along with a followup patch doing what
Joe suggested.

 drivers/misc/cxl/irq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c
index c8929c526691..4b73f4b9e7f1 100644
--- a/drivers/misc/cxl/irq.c
+++ b/drivers/misc/cxl/irq.c
@@ -147,7 +147,7 @@ static irqreturn_t cxl_irq(int irq, void *data, struct 
cxl_irq_info *irq_info)
if (dsisr  CXL_PSL_DSISR_An_PE)
return handle_psl_slice_error(ctx, dsisr, irq_info-errstat);
if (dsisr  CXL_PSL_DSISR_An_AE) {
-   pr_devel(CXL interrupt: AFU Error %.llx\n, irq_info-afu_err);
+   pr_devel(CXL interrupt: AFU Error 0x%.16llx\n, 
irq_info-afu_err);
 
if (ctx-pending_afu_err) {
/*
@@ -158,7 +158,7 @@ static irqreturn_t cxl_irq(int irq, void *data, struct 
cxl_irq_info *irq_info)
 * probably best that we log them somewhere:
 */
dev_err_ratelimited(ctx-afu-dev, CXL AFU Error 
-   undelivered to pe %i: %.llx\n,
+   undelivered to pe %i: 0x%.16llx\n,
ctx-pe, irq_info-afu_err);
} else {
spin_lock(ctx-lock);
-- 
2.1.3

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

[PATCH 1/8]powerpc/perf: Remove PME_ prefix for power7 events

2015-06-11 Thread Madhavan Srinivasan
From: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com

We used the PME_ prefix earlier to avoid some macro/variable name
collisions.  We have since changed the way we define/use the event
macros so we no longer need the prefix.

By dropping the prefix, we keep the the event macros consistent with
their official names.

Reported-by: Michael Ellerman eller...@au1.ibm.com
Signed-off-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com
Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com
---
 arch/powerpc/include/asm/perf_event_server.h |  2 +-
 arch/powerpc/perf/power7-pmu.c   | 18 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/powerpc/include/asm/perf_event_server.h 
b/arch/powerpc/include/asm/perf_event_server.h
index 8146221..0691087 100644
--- a/arch/powerpc/include/asm/perf_event_server.h
+++ b/arch/powerpc/include/asm/perf_event_server.h
@@ -141,7 +141,7 @@ extern ssize_t power_events_sysfs_show(struct device *dev,
 #defineEVENT_PTR(_id, _suffix) EVENT_VAR(_id, 
_suffix).attr.attr
 
 #defineEVENT_ATTR(_name, _id, _suffix) 
\
-   PMU_EVENT_ATTR(_name, EVENT_VAR(_id, _suffix), PME_##_id,   \
+   PMU_EVENT_ATTR(_name, EVENT_VAR(_id, _suffix), _id, \
power_events_sysfs_show)
 
 #defineGENERIC_EVENT_ATTR(_name, _id)  EVENT_ATTR(_name, _id, _g)
diff --git a/arch/powerpc/perf/power7-pmu.c b/arch/powerpc/perf/power7-pmu.c
index 5b62f238..a383c23 100644
--- a/arch/powerpc/perf/power7-pmu.c
+++ b/arch/powerpc/perf/power7-pmu.c
@@ -54,7 +54,7 @@
  * Power7 event codes.
  */
 #define EVENT(_name, _code) \
-   PME_##_name = _code,
+   _name = _code,
 
 enum {
 #include power7-events-list.h
@@ -318,14 +318,14 @@ static void power7_disable_pmc(unsigned int pmc, unsigned 
long mmcr[])
 }
 
 static int power7_generic_events[] = {
-   [PERF_COUNT_HW_CPU_CYCLES] =PME_PM_CYC,
-   [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] =   PME_PM_GCT_NOSLOT_CYC,
-   [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] =PME_PM_CMPLU_STALL,
-   [PERF_COUNT_HW_INSTRUCTIONS] =  PME_PM_INST_CMPL,
-   [PERF_COUNT_HW_CACHE_REFERENCES] =  PME_PM_LD_REF_L1,
-   [PERF_COUNT_HW_CACHE_MISSES] =  PME_PM_LD_MISS_L1,
-   [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] =   PME_PM_BRU_FIN,
-   [PERF_COUNT_HW_BRANCH_MISSES] = PME_PM_BR_MPRED,
+   [PERF_COUNT_HW_CPU_CYCLES] =PM_CYC,
+   [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] =   PM_GCT_NOSLOT_CYC,
+   [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] =PM_CMPLU_STALL,
+   [PERF_COUNT_HW_INSTRUCTIONS] =  PM_INST_CMPL,
+   [PERF_COUNT_HW_CACHE_REFERENCES] =  PM_LD_REF_L1,
+   [PERF_COUNT_HW_CACHE_MISSES] =  PM_LD_MISS_L1,
+   [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] =   PM_BRU_FIN,
+   [PERF_COUNT_HW_BRANCH_MISSES] = PM_BR_MPRED,
 };
 
 #define C(x)   PERF_COUNT_HW_CACHE_##x
-- 
1.9.1

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

[PATCH 6/8]powerpc/perf: Export Power8 memory hierarchy info to user space

2015-06-11 Thread Madhavan Srinivasan
From: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com

On Power8, the LDST field in SIER identifies the memory hierarchy level
(eg: L1, L2 etc), from which a data-cache miss for a marked instruction
was satisfied.

Use the 'perf_mem_data_src' object to export this hierarchy level to user
space. Fortunately, the memory hierarchy levels in Power8 map fairly easily
into the arch-neutral levels as described by the ldst_src_map[] table.

Usage:

perf record -d -e 'cpu/mem_access/' application
perf report -n --mem-mode --sort=mem,sym,dso,symbol_daddr,dso_daddr

For samples involving load/store instructions, the memory
hierarchy level is shown as L1 hit, Remote RAM hit etc.
# or

perf record --data application
perf report -D

Sample records contain a 'data_src' field which encodes the
memory hierarchy level: Eg: data_src 0x442 indicates
MEM_OP_LOAD, MEM_LVL_HIT, MEM_LVL_L2 (i.e load hit L2).

As the precise semantics of 'perf mem -t load' or 'perf mem -t store' (which
require sampling only loads or only stores) cannot be implemented on Power,
we don't implement 'perf mem' on Power for now.

Thanks to input from Stephane Eranian, Michael Ellerman and Michael Neuling.

Signed-off-by: Sukadev Bhattiprolu suka...@linux.vnet.ibm.com
Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com
---
 Edited the commit message to fit in the new event name

 arch/powerpc/include/asm/perf_event_server.h |  2 ++
 arch/powerpc/perf/core-book3s.c  | 11 ++
 arch/powerpc/perf/power8-pmu.c   | 53 
 3 files changed, 66 insertions(+)

diff --git a/arch/powerpc/include/asm/perf_event_server.h 
b/arch/powerpc/include/asm/perf_event_server.h
index 0691087..b147cb6 100644
--- a/arch/powerpc/include/asm/perf_event_server.h
+++ b/arch/powerpc/include/asm/perf_event_server.h
@@ -42,6 +42,8 @@ struct power_pmu {
void(*config_bhrb)(u64 pmu_bhrb_filter);
void(*disable_pmc)(unsigned int pmc, unsigned long mmcr[]);
int (*limited_pmc_event)(u64 event_id);
+   void(*get_mem_data_src)(union perf_mem_data_src *dsrc,
+   struct pt_regs *regs);
u32 flags;
const struct attribute_group**attr_groups;
int n_generic;
diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
index 7c4f669..4b27caf 100644
--- a/arch/powerpc/perf/core-book3s.c
+++ b/arch/powerpc/perf/core-book3s.c
@@ -1888,6 +1888,13 @@ ssize_t power_events_sysfs_show(struct device *dev,
return sprintf(page, event=0x%02llx\n, pmu_attr-id);
 }
 
+static inline void power_get_mem_data_src(union perf_mem_data_src *dsrc,
+   struct pt_regs *regs)
+{
+   if  (ppmu-get_mem_data_src)
+   ppmu-get_mem_data_src(dsrc, regs);
+}
+
 static struct pmu power_pmu = {
.pmu_enable = power_pmu_enable,
.pmu_disable= power_pmu_disable,
@@ -1969,6 +1976,10 @@ static void record_and_restart(struct perf_event *event, 
unsigned long val,
data.br_stack = cpuhw-bhrb_stack;
}
 
+   if (event-attr.sample_type  PERF_SAMPLE_DATA_SRC 
+   ppmu-get_mem_data_src)
+   ppmu-get_mem_data_src(data.data_src, regs);
+
if (perf_event_overflow(event, data, regs))
power_pmu_stop(event, 0);
}
diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c
index 282ab40..40e74a0 100644
--- a/arch/powerpc/perf/power8-pmu.c
+++ b/arch/powerpc/perf/power8-pmu.c
@@ -636,6 +636,58 @@ static struct attribute_group power8_pmu_events_group = {
.attrs = power8_events_attr,
 };
 
+#define POWER8_SIER_TYPE_SHIFT 15
+#define POWER8_SIER_TYPE_MASK  (0x7LL  POWER8_SIER_TYPE_SHIFT)
+
+#define POWER8_SIER_LDST_SHIFT 1
+#define POWER8_SIER_LDST_MASK  (0x7LL  POWER8_SIER_LDST_SHIFT)
+
+#define P(a, b)PERF_MEM_S(a, b)
+#define PLH(a, b)  (P(OP, LOAD) | P(LVL, HIT) | P(a, b))
+#define PSM(a, b)  (P(OP, STORE) | P(LVL, MISS) | P(a, b))
+
+/*
+ * Power8 interpretations:
+ * REM_CCE1: 1-hop indicates L2/L3 cache of a different core on same chip
+ * REM_CCE2: 2-hop indicates different chip or different node.
+ */
+static u64 ldst_src_map[] = {
+   /* 000 */   P(LVL, NA),
+
+   /* 001 */   PLH(LVL, L1),
+   /* 010 */   PLH(LVL, L2),
+   /* 011 */   PLH(LVL, L3),
+   /* 100 */   PLH(LVL, LOC_RAM),
+   /* 101 */   PLH(LVL, REM_CCE1),
+   /* 110 */   PLH(LVL, REM_CCE2),
+
+   /* 111 */   PSM(LVL, L1),
+};
+
+static inline bool is_load_store_inst(u64 sier)
+{
+   u64 val;
+   val = (sier  POWER8_SIER_TYPE_MASK)  POWER8_SIER_TYPE_SHIFT;
+
+ 

[PATCH 0/4] resend: ppc64 LE ABI v2 ftrace-with-regs implementation

2015-06-11 Thread Torsten Duwe
Hi again,

with the previous submission I was too much into the details to
state a few obvious things. Now with nicer explanations and
changelog.

Torsten

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

Re: [alsa-devel][PATCH] ASoC: fsl: add imx-wm8960 machine driver

2015-06-11 Thread Zidan Wang
On Wed, Jun 10, 2015 at 11:36:21AM -0700, Nicolin Chen wrote:
 On Wed, Jun 10, 2015 at 04:26:27PM +0800, Zidan Wang wrote:
  This imx-wm8960 device-tree-only machine driver works with sai driver
  and have below feature.
  * support codec master and slave mode
  * support headphone jack detect
  * support headphone and micphone jack event
  * support asrc-sai-wm8960 mode
  
  Signed-off-by: Zidan Wang zidan.w...@freescale.com
 
 Above all, could you merge this into fsl-asoc-card?
 
 It'd be nicer to have jack detection over there. And we can
 put PLL settings to the codec driver as Mark suggested.
 
Hi Nicolin,

I want to modify imx-wm8960 and upstream it because our release is using it 
now. After
upstreaming imx-wm8960, i will try to merge it to fsl-asoc-card.

Best Regards,
Zidan Wang
 Thanks
 Nicolin
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[RESEND PATCH v8] powerpc/powernv: Add poweroff (EPOW, DPO) events support for PowerNV platform

2015-06-11 Thread Vipin K Parashar
This patch adds support for OPAL EPOW (Early Power Off Warning) and
DPO (Delayed Power Off) events for the PowerNV platform. These events
are generated on FSP (Flexible Service Processor) based systems. EPOW
events are generated due to various critical system conditions that
require system shutdown. A few examples of these conditions are high
ambient temperature or system running on UPS power with low UPS battery.
DPO event is generated in response to admin initiated system shutdown
request. Upon receipt of EPOW and DPO events the host kernel invokes
orderly_poweroff() for performing graceful system shutdown.

Reviewed-by: Joel Stanley j...@jms.id.au
Reviewed-by: Vaibhav Jain vaib...@linux.vnet.ibm.com
Reviewed-by: Michael Ellerman m...@ellerman.id.au
Signed-off-by: Vipin K Parashar vi...@linux.vnet.ibm.com
---
 arch/powerpc/include/asm/opal-api.h|  40 +++
 arch/powerpc/include/asm/opal.h|   3 +-
 arch/powerpc/platforms/powernv/opal-power.c| 147 ++---
 arch/powerpc/platforms/powernv/opal-wrappers.S |   1 +
 4 files changed, 173 insertions(+), 18 deletions(-)

diff --git a/arch/powerpc/include/asm/opal-api.h 
b/arch/powerpc/include/asm/opal-api.h
index 0321a90..f460435 100644
--- a/arch/powerpc/include/asm/opal-api.h
+++ b/arch/powerpc/include/asm/opal-api.h
@@ -730,6 +730,46 @@ struct opal_i2c_request {
__be64 buffer_ra;   /* Buffer real address */
 };
 
+/*
+ * EPOW status sharing (OPAL and the host)
+ *
+ * The host will pass on OPAL, a buffer of length OPAL_SYSEPOW_MAX
+ * with individual elements being 16 bits wide to fetch the system
+ * wide EPOW status. Each element in the buffer will contain the
+ * EPOW status in it's bit representation for a particular EPOW sub
+ * class as defiend here. So multiple detailed EPOW status bits
+ * specific for any sub class can be represented in a single buffer
+ * element as it's bit representation.
+ */
+
+/* System EPOW type */
+enum OpalSysEpow {
+   OPAL_SYSEPOW_POWER  = 0,/* Power EPOW */
+   OPAL_SYSEPOW_TEMP   = 1,/* Temperature EPOW */
+   OPAL_SYSEPOW_COOLING= 2,/* Cooling EPOW */
+   OPAL_SYSEPOW_MAX= 3,/* Max EPOW categories */
+};
+
+/* Power EPOW */
+enum OpalSysPower {
+   OPAL_SYSPOWER_UPS   = 0x0001, /* System on UPS power */
+   OPAL_SYSPOWER_CHNG  = 0x0002, /* System power config change */
+   OPAL_SYSPOWER_FAIL  = 0x0004, /* System impending power failure */
+   OPAL_SYSPOWER_INCL  = 0x0008, /* System incomplete power */
+};
+
+/* Temperature EPOW */
+enum OpalSysTemp {
+   OPAL_SYSTEMP_AMB= 0x0001, /* System over ambient temperature */
+   OPAL_SYSTEMP_INT= 0x0002, /* System over internal temperature */
+   OPAL_SYSTEMP_HMD= 0x0004, /* System over ambient humidity */
+};
+
+/* Cooling EPOW */
+enum OpalSysCooling {
+   OPAL_SYSCOOL_INSF   = 0x0001, /* System insufficient cooling */
+};
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* __OPAL_API_H */
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 042af1a..8b174f3 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -141,7 +141,8 @@ int64_t opal_pci_fence_phb(uint64_t phb_id);
 int64_t opal_pci_reinit(uint64_t phb_id, uint64_t reinit_scope, uint64_t data);
 int64_t opal_pci_mask_pe_error(uint64_t phb_id, uint16_t pe_number, uint8_t 
error_type, uint8_t mask_action);
 int64_t opal_set_slot_led_status(uint64_t phb_id, uint64_t slot_id, uint8_t 
led_type, uint8_t led_action);
-int64_t opal_get_epow_status(__be64 *status);
+int64_t opal_get_epow_status(__be16 *epow_status, __be16 *num_epow_classes);
+int64_t opal_get_dpo_status(__be64 *dpo_timeout);
 int64_t opal_set_system_attention_led(uint8_t led_action);
 int64_t opal_pci_next_error(uint64_t phb_id, __be64 *first_frozen_pe,
__be16 *pci_error_type, __be16 *severity);
diff --git a/arch/powerpc/platforms/powernv/opal-power.c 
b/arch/powerpc/platforms/powernv/opal-power.c
index ac46c2c..58dc330 100644
--- a/arch/powerpc/platforms/powernv/opal-power.c
+++ b/arch/powerpc/platforms/powernv/opal-power.c
@@ -9,9 +9,12 @@
  * 2 of the License, or (at your option) any later version.
  */
 
+#define pr_fmt(fmt)opal-power:   fmt
+
 #include linux/kernel.h
 #include linux/reboot.h
 #include linux/notifier.h
+#include linux/of.h
 
 #include asm/opal.h
 #include asm/machdep.h
@@ -19,30 +22,116 @@
 #define SOFT_OFF 0x00
 #define SOFT_REBOOT 0x01
 
+/* Detect EPOW event */
+static bool detect_epow(void)
+{
+   u16 epow;
+   int i, rc;
+   __be16 epow_classes;
+   __be16 opal_epow_status[OPAL_SYSEPOW_MAX] = {0};
+
+   /*
+   * Check for EPOW event. Kernel sends supported EPOW classes info
+   * to OPAL. OPAL returns EPOW info along with classes present.
+   */
+   epow_classes = cpu_to_be16(OPAL_SYSEPOW_MAX);
+   rc = 

Re: [PATCH v2] powerpc: support sizes greater than an unsigned long

2015-06-11 Thread Cristian Stoica
Hi Greg,

Can you have a look at this patch?

https://patchwork.kernel.org/patch/6413191/

Thanks,
Cristian S.


On 05/15/2015 12:44 PM, Cristian Stoica wrote:
 Use resource_size_t to accommodate sizes greater than the size of an
 unsigned long int on platforms that have more than 32 bit
 physical addresses
 
 Signed-off-by: Cristian Stoica cristian.sto...@freescale.com
 
 Changes in v2:
 - update definitions is pgtable_64.c as well - or else we get broken builds 
 on 64
 - minor reformatting in pgtable_64.c to satisfy checkpatch
 
 ---
  arch/powerpc/include/asm/io.h | 14 +++---
  arch/powerpc/mm/pgtable_32.c  | 10 +-
  arch/powerpc/mm/pgtable_64.c  | 22 +++---
  3 files changed, 23 insertions(+), 23 deletions(-)
 
 diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h
 index a8d2ef3..749c66e 100644
 --- a/arch/powerpc/include/asm/io.h
 +++ b/arch/powerpc/include/asm/io.h
 @@ -716,24 +716,24 @@ static inline void iosync(void)
   *   be hooked (but can be used by a hook on iounmap)
   *
   */
 -extern void __iomem *ioremap(phys_addr_t address, unsigned long size);
 -extern void __iomem *ioremap_prot(phys_addr_t address, unsigned long size,
 +extern void __iomem *ioremap(phys_addr_t address, resource_size_t size);
 +extern void __iomem *ioremap_prot(phys_addr_t address, resource_size_t size,
 unsigned long flags);
 -extern void __iomem *ioremap_wc(phys_addr_t address, unsigned long size);
 +extern void __iomem *ioremap_wc(phys_addr_t address, resource_size_t size);
  #define ioremap_nocache(addr, size)  ioremap((addr), (size))
  
  extern void iounmap(volatile void __iomem *addr);
  
 -extern void __iomem *__ioremap(phys_addr_t, unsigned long size,
 +extern void __iomem *__ioremap(phys_addr_t, resource_size_t size,
  unsigned long flags);
 -extern void __iomem *__ioremap_caller(phys_addr_t, unsigned long size,
 +extern void __iomem *__ioremap_caller(phys_addr_t, resource_size_t size,
 unsigned long flags, void *caller);
  
  extern void __iounmap(volatile void __iomem *addr);
  
  extern void __iomem * __ioremap_at(phys_addr_t pa, void *ea,
 -unsigned long size, unsigned long flags);
 -extern void __iounmap_at(void *ea, unsigned long size);
 +resource_size_t size, unsigned long flags);
 +extern void __iounmap_at(void *ea, resource_size_t size);
  
  /*
   * When CONFIG_PPC_INDIRECT_PIO is set, we use the generic iomap 
 implementation
 diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
 index 7692d1b..a7d5137 100644
 --- a/arch/powerpc/mm/pgtable_32.c
 +++ b/arch/powerpc/mm/pgtable_32.c
 @@ -135,7 +135,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned 
 long address)
  }
  
  void __iomem *
 -ioremap(phys_addr_t addr, unsigned long size)
 +ioremap(phys_addr_t addr, resource_size_t size)
  {
   return __ioremap_caller(addr, size, _PAGE_NO_CACHE | _PAGE_GUARDED,
   __builtin_return_address(0));
 @@ -143,7 +143,7 @@ ioremap(phys_addr_t addr, unsigned long size)
  EXPORT_SYMBOL(ioremap);
  
  void __iomem *
 -ioremap_wc(phys_addr_t addr, unsigned long size)
 +ioremap_wc(phys_addr_t addr, resource_size_t size)
  {
   return __ioremap_caller(addr, size, _PAGE_NO_CACHE,
   __builtin_return_address(0));
 @@ -151,7 +151,7 @@ ioremap_wc(phys_addr_t addr, unsigned long size)
  EXPORT_SYMBOL(ioremap_wc);
  
  void __iomem *
 -ioremap_prot(phys_addr_t addr, unsigned long size, unsigned long flags)
 +ioremap_prot(phys_addr_t addr, resource_size_t size, unsigned long flags)
  {
   /* writeable implies dirty for kernel addresses */
   if ((flags  (_PAGE_RW | _PAGE_RO)) != _PAGE_RO)
 @@ -173,13 +173,13 @@ ioremap_prot(phys_addr_t addr, unsigned long size, 
 unsigned long flags)
  EXPORT_SYMBOL(ioremap_prot);
  
  void __iomem *
 -__ioremap(phys_addr_t addr, unsigned long size, unsigned long flags)
 +__ioremap(phys_addr_t addr, resource_size_t size, unsigned long flags)
  {
   return __ioremap_caller(addr, size, flags, __builtin_return_address(0));
  }
  
  void __iomem *
 -__ioremap_caller(phys_addr_t addr, unsigned long size, unsigned long flags,
 +__ioremap_caller(phys_addr_t addr, resource_size_t size, unsigned long flags,
void *caller)
  {
   unsigned long v, i;
 diff --git a/arch/powerpc/mm/pgtable_64.c b/arch/powerpc/mm/pgtable_64.c
 index 59daa5e..64dd7a9 100644
 --- a/arch/powerpc/mm/pgtable_64.c
 +++ b/arch/powerpc/mm/pgtable_64.c
 @@ -168,8 +168,8 @@ int map_kernel_page(unsigned long ea, unsigned long pa, 
 int flags)
   * __ioremap_at - Low level function to establish the page tables
   *for an IO mapping
   */
 -void __iomem * __ioremap_at(phys_addr_t pa, void *ea, unsigned long size,
 - unsigned long flags)
 +void __iomem 

Re: [PATCH 2/3] block/ps3vram: Remove obsolete reference to MTD

2015-06-11 Thread Jens Axboe

On 06/11/2015 07:04 AM, Geert Uytterhoeven wrote:

On Wed, Jun 10, 2015 at 8:00 PM, Geert Uytterhoeven
ge...@linux-m68k.org did not write:

The ps3vram driver is a plain block device driver since commit
f507cd22035fdadd5dbb476dd05e9e7ee21c3b84 (ps3/block: Replace mtd/ps3vram
by block/ps3vram).

Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org
Signed-off-by: Geoff Levand ge...@infradead.org


For the record: while I did send out this patch back in 2013, I didn't resend it
yesterday.

Geoff:
   1. Please fix your scripts (start using git-send-email?), to avoid sending
  fake email. Thanks!


Indeed, 2/3 of these patches ended up in my spam.


   2. I am grateful you didn't forget about this patch, and that it got applied.


I'll add:

3. Your git base should be the base of where you want this to be pulled 
in, or prior. Yours was 4.1-rc7, and I'm not pulling in tons of 
unrelated changes for 3 patches. If you are targeting the next release 
and don't depend on existing block changes, then your base should be 
4.0. If you are dependent on changes in the block tree, the block tree 
should be your base.


--
Jens Axboe

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

Re: [alsa-devel][PATCH] ASoC: fsl: add imx-wm8960 machine driver

2015-06-11 Thread Nicolin Chen
On Thu, Jun 11, 2015 at 07:10:00PM +0800, Zidan Wang wrote:

   This imx-wm8960 device-tree-only machine driver works with sai driver
   and have below feature.
   * support codec master and slave mode
   * support headphone jack detect
   * support headphone and micphone jack event
   * support asrc-sai-wm8960 mode
   
   Signed-off-by: Zidan Wang zidan.w...@freescale.com
  
  Above all, could you merge this into fsl-asoc-card?
  
  It'd be nicer to have jack detection over there. And we can
  put PLL settings to the codec driver as Mark suggested.

 I want to modify imx-wm8960 and upstream it because our release is using it 
 now. After
 upstreaming imx-wm8960, i will try to merge it to fsl-asoc-card.

I knew your intention. That's why I suggested you to merge it directly
to fsl-asoc-card instead of making a duplicated copy of that. Remember
that getting code upstream should be a chance for us to improve thing.

If you find painstaking to handle it in parallel, you can focus on the
improvements of the WM8960 driver while I would help you on the dai-
link part. How about this?

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

Re: [PATCH v2] powerpc: support sizes greater than an unsigned long

2015-06-11 Thread Cristian Stoica
On 06/11/2015 06:38 PM, Greg KH wrote:
 On Thu, Jun 11, 2015 at 05:42:00PM +0300, Cristian Stoica wrote:
 
 Why?
 

This patch matches the input argument size of ioremap() with the output of 
request_mem_region() (which is
resource_size_t).
Since the latter is used as input to the former, the types should match (even 
though mapping more than 4G is not usually
expected). There are a lot of such differences in the code and this is an 
attempt to reduce that.

Cristian S.


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

Re: [PATCH v2] powerpc: support sizes greater than an unsigned long

2015-06-11 Thread Greg KH
On Thu, Jun 11, 2015 at 07:10:36PM +0300, Cristian Stoica wrote:
 On 06/11/2015 06:38 PM, Greg KH wrote:
  On Thu, Jun 11, 2015 at 05:42:00PM +0300, Cristian Stoica wrote:
  
  Why?
  
 
 This patch matches the input argument size of ioremap() with the output of 
 request_mem_region() (which is
 resource_size_t).
 Since the latter is used as input to the former, the types should match (even 
 though mapping more than 4G is not usually
 expected). There are a lot of such differences in the code and this is an 
 attempt to reduce that.

No, why do I care about a ppc-only patch?  There's nothing that I can do
about this, please work with the proper maintainers and don't randomly
poke people who have no responsibility about the code in question as it
doesn't do any good.

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

Re: [RESEND PATCH V2 0/3] Allow user to request memory to be locked on page fault

2015-06-11 Thread Eric B Munson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 06/10/2015 05:59 PM, Andrew Morton wrote:
 On Wed, 10 Jun 2015 09:26:47 -0400 Eric B Munson
 emun...@akamai.com wrote:
 
 mlock() allows a user to control page out of program memory, but
 this comes at the cost of faulting in the entire mapping when it
 is
 
 s/mapping/locked area/

Done.

 
 allocated.  For large mappings where the entire area is not
 necessary this is not ideal.
 
 This series introduces new flags for mmap() and mlockall() that
 allow a user to specify that the covered are should not be paged
 out, but only after the memory has been used the first time.
 
 The comparison with MCL_FUTURE is hiding over in the 2/3 changelog.
  It's important so let's copy it here.
 
 : MCL_ONFAULT is preferrable to MCL_FUTURE for the use cases
 enumerated : in the previous patch becuase MCL_FUTURE will behave
 as if each mapping : was made with MAP_LOCKED, causing the entire
 mapping to be faulted in : when new space is allocated or mapped.
 MCL_ONFAULT allows the user to : delay the fault in cost of any
 given page until it is actually needed, : but then guarantees that
 that page will always be resident.

Done

 
 I *think* it all looks OK.  I'd like someone else to go over it
 also if poss.
 
 
 I guess the 2/3 changelog should have something like
 
 : munlockall() will clear MCL_ONFAULT on all vma's in the process's
 VM.

Done

 
 It's pretty obvious, but the manpage delta should make this clear
 also.

Done

 
 
 Also the changelog(s) and manpage delta should explain that
 munlock() clears MCL_ONFAULT.

Done

 
 And now I'm wondering what happens if userspace does 
 mmap(MAP_LOCKONFAULT) and later does munlock() on just part of
 that region.  Does the vma get split?  Is this tested?  Should also
 be in the changelogs and manpage.
 
 Ditto mlockall(MCL_ONFAULT) followed by munlock().  I'm not sure
 that even makes sense but the behaviour should be understood and
 tested.

I have extended the kselftest for lock-on-fault to try both of these
scenarios and they work as expected.  The VMA is split and the VM
flags are set appropriately for the resulting VMAs.

 
 
 What's missing here is a syscall to set VM_LOCKONFAULT on an
 arbitrary range of memory - mlock() for lock-on-fault.  It's a
 shame that mlock() didn't take a `mode' argument.  Perhaps we
 should add such a syscall - that would make the mmap flag unneeded
 but I suppose it should be kept for symmetry.

Do you want such a system call as part of this set?  I would need some
time to make sure I had thought through all the possible corners one
could get into with such a call, so it would delay a V3 quite a bit.
Otherwise I can send a V3 out immediately.

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBAgAGBQJVed+3AAoJELbVsDOpoOa9eHwP+gO8QmNdUKN55wiTLxXdFTRo
TTm62MJ3Yk45+JJ+8xI1POMSUVEBAX7pxnL8TpNPmwp+UF6IQT/hAnnEFNud8/aQ
5bAxU9a5fRO6Q5533woaVpYfXZXwXAla+37MGQziL7O0VEi2aQ9abX7AKnkjmXwq
e1Fc3vutAycNCzSxg42GwZxqHw83TYztyv3C4Cc7lShbCezABYvaDvXcUZkGwhjG
KJxSPYS2E0nv0MEy995P0L0H1A/KHq6mCOFFKQw6aVbPDs8J/0RhvQIlp/BBCPMV
TqDVxMBpTpdWs6reJnUZpouKBTA11KTvUA2HBVn5B14u2V7Np+NBpLKH2DUqAP2v
Gyg4Nj0MknqB1rutaBjHjI0ZefrWK5o+zWAVKZs+wtq9WkmCvTYWp505XnlJO+qo
1CEnab2kX8P74UYcsJUrJxAtxc94t6oLh305KnJheQUdcx/ZNKboB2vl1+np10jj
oZLmP2RfajZoPojPZ/bI6mj9Ffqf/Ptau+kLQ56G1IuVmQRi4ZgQ9D1+BILXyKHi
uycKovcHVffiQ+z1Ama2b4wP1t5yjNdxBH0oV1KMeScCxfyYHPFuDBe36Krjo8FO
dDMyibNIRJMX6SeYNIRni40Eafon5h21I95/yWxUaq0FGBZ1NuuSTofxAA53wJJz
f0FUI7f53Oxk9EKk8nfg
=gfVJ
-END PGP SIGNATURE-
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RESEND PATCH V2 0/3] Allow user to request memory to be locked on page fault

2015-06-11 Thread Andrew Morton
On Thu, 11 Jun 2015 15:21:30 -0400 Eric B Munson emun...@akamai.com wrote:

  Ditto mlockall(MCL_ONFAULT) followed by munlock().  I'm not sure
  that even makes sense but the behaviour should be understood and
  tested.

 I have extended the kselftest for lock-on-fault to try both of these
 scenarios and they work as expected.  The VMA is split and the VM
 flags are set appropriately for the resulting VMAs.

munlock() should do vma merging as well.  I *think* we implemented
that.  More tests for you to add ;)

How are you testing the vma merging and splitting, btw?  Parsing
the profcs files?

  What's missing here is a syscall to set VM_LOCKONFAULT on an
  arbitrary range of memory - mlock() for lock-on-fault.  It's a
  shame that mlock() didn't take a `mode' argument.  Perhaps we
  should add such a syscall - that would make the mmap flag unneeded
  but I suppose it should be kept for symmetry.
 
 Do you want such a system call as part of this set?  I would need some
 time to make sure I had thought through all the possible corners one
 could get into with such a call, so it would delay a V3 quite a bit.
 Otherwise I can send a V3 out immediately.

I think the way to look at this is to pretend that mm/mlock.c doesn't
exist and ask how should we design these features.

And that would be:

- mmap() takes a `flags' argument: MAP_LOCKED|MAP_LOCKONFAULT.

- mlock() takes a `flags' argument.  Presently that's
  MLOCK_LOCKED|MLOCK_LOCKONFAULT.

- munlock() takes a `flags' arument.  MLOCK_LOCKED|MLOCK_LOCKONFAULT
  to specify which flags are being cleared.

- mlockall() and munlockall() ditto.


IOW, LOCKED and LOCKEDONFAULT are treated identically and independently.

Now, that's how we would have designed all this on day one.  And I
think we can do this now, by adding new mlock2() and munlock2()
syscalls.  And we may as well deprecate the old mlock() and munlock(),
not that this matters much.

*should* we do this?  I'm thinking yes - it's all pretty simple
boilerplate and wrappers and such, and it gets the interface correct,
and extensible.

What do others think?
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [RESEND PATCH V2 0/3] Allow user to request memory to be locked on page fault

2015-06-11 Thread Eric B Munson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 06/11/2015 03:34 PM, Andrew Morton wrote:
 On Thu, 11 Jun 2015 15:21:30 -0400 Eric B Munson
 emun...@akamai.com wrote:
 
 Ditto mlockall(MCL_ONFAULT) followed by munlock().  I'm not
 sure that even makes sense but the behaviour should be
 understood and tested.
 
 I have extended the kselftest for lock-on-fault to try both of
 these scenarios and they work as expected.  The VMA is split and
 the VM flags are set appropriately for the resulting VMAs.
 
 munlock() should do vma merging as well.  I *think* we implemented 
 that.  More tests for you to add ;)

I will add a test for this as well.  But the code is in place to merge
VMAs IIRC.

 
 How are you testing the vma merging and splitting, btw?  Parsing 
 the profcs files?

To show the VMA split happened, I dropped a printk in mlock_fixup()
and the user space test simply checks that unlocked pages are not
marked as unevictable.  The test does not parse maps or smaps for
actual VMA layout.  Given that we want to check the merging of VMAs as
well I will add this.

 
 What's missing here is a syscall to set VM_LOCKONFAULT on an 
 arbitrary range of memory - mlock() for lock-on-fault.  It's a 
 shame that mlock() didn't take a `mode' argument.  Perhaps we 
 should add such a syscall - that would make the mmap flag
 unneeded but I suppose it should be kept for symmetry.
 
 Do you want such a system call as part of this set?  I would need
 some time to make sure I had thought through all the possible
 corners one could get into with such a call, so it would delay a
 V3 quite a bit. Otherwise I can send a V3 out immediately.
 
 I think the way to look at this is to pretend that mm/mlock.c
 doesn't exist and ask how should we design these features.
 
 And that would be:
 
 - mmap() takes a `flags' argument: MAP_LOCKED|MAP_LOCKONFAULT.
 
 - mlock() takes a `flags' argument.  Presently that's 
 MLOCK_LOCKED|MLOCK_LOCKONFAULT.
 
 - munlock() takes a `flags' arument.
 MLOCK_LOCKED|MLOCK_LOCKONFAULT to specify which flags are being
 cleared.
 
 - mlockall() and munlockall() ditto.
 
 
 IOW, LOCKED and LOCKEDONFAULT are treated identically and
 independently.
 
 Now, that's how we would have designed all this on day one.  And I 
 think we can do this now, by adding new mlock2() and munlock2() 
 syscalls.  And we may as well deprecate the old mlock() and
 munlock(), not that this matters much.
 
 *should* we do this?  I'm thinking yes - it's all pretty simple 
 boilerplate and wrappers and such, and it gets the interface
 correct, and extensible.
 
 What do others think?
 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1

iQIcBAEBAgAGBQJVeefAAAoJELbVsDOpoOa9930P/j32OhsgPdxt8pmlYddpHBJg
PJ4EOYZLoNJ0bWAoePRAQvb9Rd0UumXukkQKVdFCFW72QfMPkjqyMWWOA5BZ6dYl
q3h3FTzcnAtVHG7bqFheV+Ie9ZX0dplTmuGlqTZzEIVePry9VXzqp9BADbWn3bVR
ucq1CFikyEB2yu8pMtykJmEaz4CO7fzCHz6oB7RNX5oHElWmi9AieuUr5eAw6enQ
6ofuNy/N3rTCwcjeRfdL7Xhs6vn62u4nw1Jey6l9hBQUx/ujMktKcn4VwkDXIYCi
+h7lfXWruqOuC+lspBRJO7OL2e6nRdedpDWJypeUGcKXokxB2FEB25Yu31K9sk/8
jDfaKNqmcfgOseLHb+DjJqG6nq9lsUhozg8C17SJpT8qFwQ8q7iJe+1GhUF1EBsL
+DpqLU56geBY6fyIfurOfp/4Hsx2u1KzezkEnMYT/8LkbGwqbq7Zj4rquLMSHCUt
uG5j0MuhmP8/Fuf8OMsIHHUMjBHRjH4rTyaCKxNj3T8uSuLfcnIqEZiJu2qaSA8l
PxpQ6yy2szw9lDxPvxLnh8Rkx+SGEc1ciamyppDTI4LQRiCjMQ7bHAKo0RwAaPJL
ZSHrdlDnUHrYTnd0EZwg0peh8AgkROgxna/pLpfQTeW1g3erqPfbI0Ab8N0cu5j0
8+qA5C+DeSjaMAoMskTG
=82B8
-END PGP SIGNATURE-
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [alsa-devel] [PATCH v2] ALSA: aoa: convert bus code to use dev_groups

2015-06-11 Thread Quentin Lambert



On 11/06/2015 12:02, Takashi Iwai wrote:

At Thu, 11 Jun 2015 10:03:38 +0200,
Quentin Lambert wrote:


The dev_attrs field of struct bus_type is going away, use dev_groups instead.
This converts the soundbus code to use the correct field.

Given that all other usages of the macro define the struct attribute
*xxx_attrs[] in the same file they assign the .dev_groups field, this patch
merges sysfs.c into core.c.

These modifications were made using Coccinelle.

Signed-off-by: Quentin Lambert lambert.quen...@gmail.com
---
  Changes since v1:
   - Fix the commit message to actually talk about soundbus rather than MDIO
   - This version attempt to fix a problem resulting from the macro
 ATTRIBUTE_GROUPS declaring the structure as static by merging sysfs.c into
 core.c. I understand that this may not be the prefered solution since
 Takashi suggested that adding a comment line to the previous version could
 be acceptable.

Hmm, the patch doesn't look as mentioned here.
It's rather bigger than the previous patch.  Is this intentional?

Well as mentionned in the change log it is bigger because it moves the 
code from sysfs.c to
core.c. I realise as I am writing this that this patch should have 
really been two patches.
The first one removing sysfs.c and the second one removing the use of 
the dev_attrs.



Takashi


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

Re: [PATCH 2/3] block/ps3vram: Remove obsolete reference to MTD

2015-06-11 Thread Geert Uytterhoeven
On Wed, Jun 10, 2015 at 8:00 PM, Geert Uytterhoeven
ge...@linux-m68k.org did not write:
 The ps3vram driver is a plain block device driver since commit
 f507cd22035fdadd5dbb476dd05e9e7ee21c3b84 (ps3/block: Replace mtd/ps3vram
 by block/ps3vram).

 Signed-off-by: Geert Uytterhoeven ge...@linux-m68k.org
 Signed-off-by: Geoff Levand ge...@infradead.org

For the record: while I did send out this patch back in 2013, I didn't resend it
yesterday.

Geoff:
  1. Please fix your scripts (start using git-send-email?), to avoid sending
 fake email. Thanks!
  2. I am grateful you didn't forget about this patch, and that it got applied.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say programmer or something like that.
-- Linus Torvalds
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH v2] ALSA: aoa: convert bus code to use dev_groups

2015-06-11 Thread Quentin Lambert



On 11/06/2015 13:55, walter harms wrote:


Am 11.06.2015 10:03, schrieb Quentin Lambert:

The dev_attrs field of struct bus_type is going away, use dev_groups instead.
This converts the soundbus code to use the correct field.

Given that all other usages of the macro define the struct attribute
*xxx_attrs[] in the same file they assign the .dev_groups field, this patch
merges sysfs.c into core.c.

These modifications were made using Coccinelle.

Signed-off-by: Quentin Lambert lambert.quen...@gmail.com
---
  Changes since v1:
   - Fix the commit message to actually talk about soundbus rather than MDIO
   - This version attempt to fix a problem resulting from the macro
 ATTRIBUTE_GROUPS declaring the structure as static by merging sysfs.c into
 core.c. I understand that this may not be the prefered solution since
 Takashi suggested that adding a comment line to the previous version could
 be acceptable.

  sound/aoa/soundbus/Makefile   |2 -
  sound/aoa/soundbus/core.c |   44 
+-
  sound/aoa/soundbus/soundbus.h |2 -
  sound/aoa/soundbus/sysfs.c|   42 
  4 files changed, 44 insertions(+), 46 deletions(-)

--- a/sound/aoa/soundbus/Makefile
+++ b/sound/aoa/soundbus/Makefile
@@ -1,3 +1,3 @@
  obj-$(CONFIG_SND_AOA_SOUNDBUS) += snd-aoa-soundbus.o
-snd-aoa-soundbus-objs := core.o sysfs.o
+snd-aoa-soundbus-objs := core.o
  obj-$(CONFIG_SND_AOA_SOUNDBUS_I2S) += i2sbus/
--- a/sound/aoa/soundbus/core.c
+++ b/sound/aoa/soundbus/core.c
@@ -150,6 +150,48 @@ static int soundbus_device_resume(struct
  
  #endif /* CONFIG_PM */
  
+#define soundbus_config_of_attr(field, format_string)			\

+static ssize_t \
+field##_show (struct device *dev, struct device_attribute *attr,   \
+  char *buf)   \
+{  \
+   struct soundbus_dev *mdev = to_soundbus_device (dev);   \
+   return sprintf (buf, format_string, mdev-ofdev.dev.of_node-field); \
+}
+
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+char *buf)
+{
+   struct soundbus_dev *sdev = to_soundbus_device(dev);
+   struct platform_device *of = sdev-ofdev;
+   int length;
+
+   if (*sdev-modalias) {
+   strlcpy(buf, sdev-modalias, sizeof(sdev-modalias) + 1);
+   strcat(buf, \n);
+   length = strlen(buf);


for my curiosity:
why not sprintf() ? almost any other code seems to use sprintf().
I wouldn't be able to justify that as this is part is simply a copy 
paste from sysfs.c to core.c


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

Re: [alsa-devel] [PATCH v2] ALSA: aoa: convert bus code to use dev_groups

2015-06-11 Thread Takashi Iwai
At Thu, 11 Jun 2015 14:04:45 +0200,
Quentin Lambert wrote:
 
 
 
 On 11/06/2015 12:02, Takashi Iwai wrote:
  At Thu, 11 Jun 2015 10:03:38 +0200,
  Quentin Lambert wrote:
 
  The dev_attrs field of struct bus_type is going away, use dev_groups 
  instead.
  This converts the soundbus code to use the correct field.
 
  Given that all other usages of the macro define the struct attribute
  *xxx_attrs[] in the same file they assign the .dev_groups field, this patch
  merges sysfs.c into core.c.
 
  These modifications were made using Coccinelle.
 
  Signed-off-by: Quentin Lambert lambert.quen...@gmail.com
  ---
Changes since v1:
 - Fix the commit message to actually talk about soundbus rather than 
  MDIO
 - This version attempt to fix a problem resulting from the macro
   ATTRIBUTE_GROUPS declaring the structure as static by merging sysfs.c 
  into
   core.c. I understand that this may not be the prefered solution since
   Takashi suggested that adding a comment line to the previous version 
  could
   be acceptable.
  Hmm, the patch doesn't look as mentioned here.
  It's rather bigger than the previous patch.  Is this intentional?
 
 Well as mentionned in the change log it is bigger because it moves the 
 code from sysfs.c to
 core.c. I realise as I am writing this that this patch should have 
 really been two patches.
 The first one removing sysfs.c and the second one removing the use of 
 the dev_attrs.

Yes, that'd be better.  OTOH, do we really need to copy many codes at
all?  I really prefer shorter changes, if possible.


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

Re: [PATCH v2] ALSA: aoa: convert bus code to use dev_groups

2015-06-11 Thread walter harms


Am 11.06.2015 10:03, schrieb Quentin Lambert:
 The dev_attrs field of struct bus_type is going away, use dev_groups instead.
 This converts the soundbus code to use the correct field.
 
 Given that all other usages of the macro define the struct attribute
 *xxx_attrs[] in the same file they assign the .dev_groups field, this patch
 merges sysfs.c into core.c.
 
 These modifications were made using Coccinelle.
 
 Signed-off-by: Quentin Lambert lambert.quen...@gmail.com
 ---
  Changes since v1:
   - Fix the commit message to actually talk about soundbus rather than MDIO
   - This version attempt to fix a problem resulting from the macro
 ATTRIBUTE_GROUPS declaring the structure as static by merging sysfs.c into
 core.c. I understand that this may not be the prefered solution since 
 Takashi suggested that adding a comment line to the previous version could
 be acceptable. 
 
  sound/aoa/soundbus/Makefile   |2 -
  sound/aoa/soundbus/core.c |   44 
 +-
  sound/aoa/soundbus/soundbus.h |2 -
  sound/aoa/soundbus/sysfs.c|   42 
  4 files changed, 44 insertions(+), 46 deletions(-)
 
 --- a/sound/aoa/soundbus/Makefile
 +++ b/sound/aoa/soundbus/Makefile
 @@ -1,3 +1,3 @@
  obj-$(CONFIG_SND_AOA_SOUNDBUS) += snd-aoa-soundbus.o
 -snd-aoa-soundbus-objs := core.o sysfs.o
 +snd-aoa-soundbus-objs := core.o
  obj-$(CONFIG_SND_AOA_SOUNDBUS_I2S) += i2sbus/
 --- a/sound/aoa/soundbus/core.c
 +++ b/sound/aoa/soundbus/core.c
 @@ -150,6 +150,48 @@ static int soundbus_device_resume(struct
  
  #endif /* CONFIG_PM */
  
 +#define soundbus_config_of_attr(field, format_string)
 \
 +static ssize_t   
 \
 +field##_show (struct device *dev, struct device_attribute *attr, \
 +  char *buf) \
 +{\
 + struct soundbus_dev *mdev = to_soundbus_device (dev);   \
 + return sprintf (buf, format_string, mdev-ofdev.dev.of_node-field); \
 +}
 +
 +static ssize_t modalias_show(struct device *dev, struct device_attribute 
 *attr,
 +  char *buf)
 +{
 + struct soundbus_dev *sdev = to_soundbus_device(dev);
 + struct platform_device *of = sdev-ofdev;
 + int length;
 +
 + if (*sdev-modalias) {
 + strlcpy(buf, sdev-modalias, sizeof(sdev-modalias) + 1);
 + strcat(buf, \n);
 + length = strlen(buf);


for my curiosity:
why not sprintf() ? almost any other code seems to use sprintf().

re,
 wh


 + } else {
 + length = sprintf(buf, of:N%sT%s\n,
 +  of-dev.of_node-name, of-dev.of_node-type);
 + }
 +
 + return length;
 +}
 +static DEVICE_ATTR_RO(modalias);
 +
 +soundbus_config_of_attr (name, %s\n);
 +static DEVICE_ATTR_RO(name);
 +soundbus_config_of_attr (type, %s\n);
 +static DEVICE_ATTR_RO(type);
 +
 +struct attribute *soundbus_dev_attrs[] = {
 + dev_attr_name.attr,
 + dev_attr_type.attr,
 + dev_attr_modalias.attr,
 + NULL,
 +};
 +ATTRIBUTE_GROUPS(soundbus_dev);
 +
  static struct bus_type soundbus_bus_type = {
   .name   = aoa-soundbus,
   .probe  = soundbus_probe,
 @@ -160,7 +202,7 @@ static struct bus_type soundbus_bus_type
   .suspend= soundbus_device_suspend,
   .resume = soundbus_device_resume,
  #endif
 - .dev_attrs  = soundbus_dev_attrs,
 + .dev_groups = soundbus_dev_groups,
  };
  
  int soundbus_add_one(struct soundbus_dev *dev)
 --- a/sound/aoa/soundbus/soundbus.h
 +++ b/sound/aoa/soundbus/soundbus.h
 @@ -199,6 +199,4 @@ struct soundbus_driver {
  extern int soundbus_register_driver(struct soundbus_driver *drv);
  extern void soundbus_unregister_driver(struct soundbus_driver *drv);
  
 -extern struct device_attribute soundbus_dev_attrs[];
 -
  #endif /* __SOUNDBUS_H */
 --- a/sound/aoa/soundbus/sysfs.c
 +++ /dev/null
 @@ -1,42 +0,0 @@
 -#include linux/kernel.h
 -#include linux/stat.h
 -/* FIX UP */
 -#include soundbus.h
 -
 -#define soundbus_config_of_attr(field, format_string)
 \
 -static ssize_t   
 \
 -field##_show (struct device *dev, struct device_attribute *attr, \
 -  char *buf) \
 -{\
 - struct soundbus_dev *mdev = to_soundbus_device (dev);   \
 - return sprintf (buf, format_string, mdev-ofdev.dev.of_node-field); \
 -}
 -
 -static ssize_t modalias_show(struct device *dev, struct device_attribute 
 *attr,
 -  char *buf)
 -{
 - struct soundbus_dev *sdev = to_soundbus_device(dev);
 - struct platform_device *of = sdev-ofdev;
 - int length;
 -
 - 

Re: [PATCH v2] powerpc: support sizes greater than an unsigned long

2015-06-11 Thread Scott Wood
On Thu, 2015-06-11 at 19:10 +0300, Cristian Stoica wrote:
 On 06/11/2015 06:38 PM, Greg KH wrote:
  On Thu, Jun 11, 2015 at 05:42:00PM +0300, Cristian Stoica wrote:
  
  Why?
  
 
 This patch matches the input argument size of ioremap() with the 
 output of request_mem_region() (which is
 resource_size_t).
 Since the latter is used as input to the former, the types should 
 match (even though mapping more than 4G is not usually
 expected). There are a lot of such differences in the code and this 
 is an attempt to reduce that.

Dropping the upper bits of the size harms the ability to detect error 
scenarios where unmappably large -- but not power-of-two -- regions 
are requested to be mapped.

However, this patch doesn't fix that.  It just postpones the loss of 
the upper 32 bits until __ioremap_caller() calls get_vm_area_caller().

There's also no error checking at all for the size of ioremap() done 
during early boot (!slab_is_available()).

Don't just blindly turn static analyzer reports into patches -- and 
why didn't the analyzer complain about the call to 
get_vm_area_caller() after this patch?

-Scott

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

Re: [PATCH 1/1 linux-next] net: fs_enet: use swap() in fs_enet_rx_napi()

2015-06-11 Thread David Miller
From: Fabian Frederick f...@skynet.be
Date: Wed, 10 Jun 2015 18:33:19 +0200

 Use kernel.h macro definition.
 
 Thanks to Julia Lawall for Coccinelle scripting support.
 
 Signed-off-by: Fabian Frederick f...@skynet.be

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

Re: question on FSL_EMB perf

2015-06-11 Thread Michael Ellerman
On Wed, 2015-06-10 at 13:41 +0200, Peter Zijlstra wrote:
 Hi Mike, Ben,
 
 I just noticed:
 
 arch/powerpc/Kconfig:   select HAVE_PERF_EVENTS_NMI if PPC64

We actually only added that recently, in c54b2bf1b5e9 powerpc: Add ppc64 hard
lockup detector support.

AFAICS it doesn't actually have anything to do with the NMI behaviour of the
perf interrupt. It controls whether the hardlockup detector is enabled and/or
the oprofile NMI timer.

cheers


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

Re: [PATCH] net/ps3_gelic: Fix build error with DEBUG

2015-06-11 Thread David Miller
From: Geoff Levand ge...@infradead.org
Date: Wed, 10 Jun 2015 10:19:48 -0700

 When the DEBUG preprocessor macro is defined the ps3_gelic_net driver build
 fails due to an undeclared routine gelic_descr_get_status().  This problem
 was introduced during the code cleanup of commit
 6b0c21cede22be1f68f0a632c0ca38008ce1abe7 (net: Fix p3_gelic_net sparse 
 warnings),
 which re-arranged the ordering of some of the gelic routines.
 
 This change just moves the gelic_descr_get_status() routine up in the
 ps3_gelic_net.c source file. There is no functional change.
 
 Fixes build errors like these:
 
   drivers/net/ethernet/toshiba/ps3_gelic_net.c: error: implicit declaration 
 of function gelic_descr_get_status
 
 Signed-off-by: Geoff Levand ge...@infradead.org

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

[PATCH V3] QorIQ/TMU: add TMU node to device tree for QorIQ T1040

2015-06-11 Thread Jia Hongtao
This is Thermal Monitoring Unit for QorIQ platform.

Signed-off-by: Jia Hongtao hongtao@freescale.com
---
Changes of V3:
* Put TMU node directly into t1040si-post.dtsi file.
* Add fsl,tmu-range property.
* Change calibration property to fsl,tmu-calibration.
* Update the calibration data.

Changes of V2:
* Provide more details on compatible and calibration properties.

 .../devicetree/bindings/thermal/qoriq-thermal.txt  | 63 ++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi| 42 +++
 2 files changed, 105 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/qoriq-thermal.txt

diff --git a/Documentation/devicetree/bindings/thermal/qoriq-thermal.txt 
b/Documentation/devicetree/bindings/thermal/qoriq-thermal.txt
new file mode 100644
index 000..2bc9cb3
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/qoriq-thermal.txt
@@ -0,0 +1,63 @@
+* Thermal Monitoring Unit (TMU) on Freescale QorIQ SoCs
+
+Required properties:
+- compatible : Must include fsl,qoriq-tmu. The version of the device is
+   determined by the TMU IP Block Revision Register (IPBRR0) at
+   offset 0x0BF8.
+   Table of correspondences between IPBRR0 values and example  chips:
+   Value   Device
+   --  -
+   0x01900102  T1040
+- reg : Address range of TMU registers.
+- interrupts : Contains the interrupt for TMU.
+- fsl,tmu-range : Temperature range for TMU. Including the starting
+   temperature and number of calibration points for each range.
+- fsl,tmu-calibration : Calibration table for TMU. This is required to
+   determine what a specific sensor reading translates to in degrees
+   Celsius. There are four calibration ranges, for each range we need
+   a couple of calibration data formatted like TTCFGR, TSCFGR.
+   Freescale provides the data required.
+
+Example:
+
+tmu@f {
+   compatible = fsl,qoriq-tmu;
+   reg = 0xf 0x1000;
+   interrupts = 18 2 0 0;
+   fsl,tmu-range = 0x000a 0x00090026 0x0008004a 0x0001006a;
+   fsl,tmu-calibration = 0x 0x0025
+  0x0001 0x0028
+  0x0002 0x002d
+  0x0003 0x0031
+  0x0004 0x0036
+  0x0005 0x003a
+  0x0006 0x0040
+  0x0007 0x0044
+  0x0008 0x004a
+  0x0009 0x004f
+  0x000a 0x0054
+
+  0x0001 0x000d
+  0x00010001 0x0013
+  0x00010002 0x0019
+  0x00010003 0x001f
+  0x00010004 0x0025
+  0x00010005 0x002d
+  0x00010006 0x0033
+  0x00010007 0x0043
+  0x00010008 0x004b
+  0x00010009 0x0053
+
+  0x0002 0x0010
+  0x00020001 0x0017
+  0x00020002 0x001f
+  0x00020003 0x0029
+  0x00020004 0x0031
+  0x00020005 0x003c
+  0x00020006 0x0042
+  0x00020007 0x004d
+  0x00020008 0x0056
+
+  0x0003 0x0012
+  0x00030001 0x001d;
+};
diff --git a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
index 5cc01be..6d9ca4d 100644
--- a/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t1040si-post.dtsi
@@ -407,6 +407,48 @@
reg= 0xea000 0x4000;
};
 
+   tmu@f {
+   compatible = fsl,qoriq-tmu;
+   reg = 0xf 0x1000;
+   interrupts = 18 2 0 0;
+   fsl,tmu-range = 0x000a 0x00090026 0x0008004a 0x0001006a;
+   fsl,tmu-calibration = 0x 0x0025
+  0x0001 0x0028
+  0x0002 0x002d
+  0x0003 0x0031
+  0x0004 0x0036
+  0x0005 0x003a
+  0x0006 0x0040
+  0x0007 0x0044
+  0x0008 0x004a
+  0x0009 0x004f
+  

Re: [PATCH v4 0/3] LED interface for PowerNV platform

2015-06-11 Thread Vasant Hegde
On 04/28/2015 03:39 PM, Vasant Hegde wrote:
 The following series implements LED driver for PowerNV platform.

Ben, Michael,

Can you please review/ACK this patchset?

-Vasant

 
 PowerNV platform has below type of LEDs:
   - System attention
   Indicates there is a problem with the system that needs attention.
   - Identify
   Helps the user locate/identify a particular FRU or resource in the
   system.
   - Fault
   Indicates there is a problem with the FRU or resource at the
   location with which the indicator is associated.
 
 On PowerNV (Non Virtualized) platform OPAL firmware provides LED information
 to host via device tree (location code and LED type). During init we check
 for 'ibm,opal/led' node in device tree to enable LED driver. And we use
 OPAL API's to get/set LEDs.
 
 Note that on PowerNV platform firmware can activate fault LED, if it can 
 isolate
 the problem. Also one can modify the LEDs using service processor interface. 
 None
 of these involes kernel. Hence we retain LED state in unload path.
 
 Sample LED device tree output:
 --
 led {
   compatible = ibm,opal-v3-led;
   phandle = 0x106b;
   linux,phandle = 0x106b;
   led-mode = lightpath;
 
   U78C9.001.RST0027-P1-C1 {
   led-types = identify, fault;
   led-loc = descendent;
   phandle = 0x106f;
   linux,phandle = 0x106f;
   };
   ...
   ...
 }
 
 Sample sysfs output:
 
 .
 ├── U78CB.001.WZS008R-A1:fault
 │   ├── brightness
 │   ├── device - ../../../opal_led
 │   ├── max_brightness
 │   ├── power
 │   │   ├── async
 │   │   ├── autosuspend_delay_ms
 │   │   ├── control
 │   │   ├── runtime_active_kids
 │   │   ├── runtime_active_time
 │   │   ├── runtime_enabled
 │   │   ├── runtime_status
 │   │   ├── runtime_suspended_time
 │   │   └── runtime_usage
 │   ├── subsystem - ../../../../../class/leds
 │   ├── trigger
 │   └── uevent
 ├── U78CB.001.WZS008R-A1:identify
 │   ├── brightness
 │   ├── device - ../../../opal_led
 │   ├── max_brightness
 │   ├── power
 │   │   ├── async
 │   │   ├── autosuspend_delay_ms
 │   │   ├── control
 │   │   ├── runtime_active_kids
 │   │   ├── runtime_active_time
 │   │   ├── runtime_enabled
 │   │   ├── runtime_status
 │   │   ├── runtime_suspended_time
 │   │   └── runtime_usage
 │   ├── subsystem - ../../../../../class/leds
 │   ├── trigger
 │   └── uevent
 
 
 
 
 patch 1/2: PowerNV architecture specific code. This adds necessary
OPAL APIs.
 patch 2/2: Create LED platform device and export OPAL symbols
 patch 3/3: Actual LED driver implemenation for PowerNV platform.
 
 This patchset is based on top of mpe's next branch:
   https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/log/?h=next
 
 Previous patchset:
   v3: https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-April/127702.html
   v2: https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-March/126301.html
   v1: https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-March/125705.html
 
 Changes in v4:
   - Updated macros to reflect platform.
   - s/u64/__be64/g for big endian data we get from firmware
   - Addressed review comments from Jacek. Major once are:
 Removed list in powernv_led_data structure
 s/kzalloc/devm_kzalloc/
 Removed compatible property from documentation
 s/powernv_led_set_queue/powernv_brightness_set/
   - Removed LED specific brightness_set/get function. Instead this version
 uses single function to queue all LED set/get requests. Later we use
 LED name to detect LED type and value.
   - Removed hardcoded LED type used in previous version. Instead we use
 led-types property to form LED classdev.
 
 Changes in v3:
   - Addressed review comments from Jacek. Major once are:
 Replaced spin lock and mutex and removed redundant structures
 Replaced pr_* with dev_*
 Moved OPAL platform sepcific part to separate patch
 Moved repteated code to common function
 Added device tree documentation for LEDs
 
 Changes in v2:
   - Rebased patches on top of mpe's next branch
 https://git.kernel.org/cgit/linux/kernel/git/mpe/linux.git/log/?h=next
   - Added System Attention Indicator support
   - Removed redundant code in leds-powernv.c file
 
 
 ---
 
 Anshuman Khandual (1):
   powerpc/powernv: Add OPAL interfaces for accessing and modifying system 
 LED states
 
 Vasant Hegde (2):
   powerpc/powernv: Create LED platform device
   leds/powernv: Add driver for PowerNV platform
 
 
  .../devicetree/bindings/leds/leds-powernv.txt  |   29 +
  arch/powerpc/include/asm/opal-api.h|   29 +
  arch/powerpc/include/asm/opal.h|5 
  arch/powerpc/platforms/powernv/opal-wrappers.S |2 
  arch/powerpc/platforms/powernv/opal.c  |   12 -
  drivers/leds/Kconfig   |   11 
  drivers/leds/Makefile  

Re: [PATCH V3] drivers/mtd: add powernv flash MTD abstraction driver

2015-06-11 Thread Richard Weinberger
Am 11.06.2015 um 07:43 schrieb Michael Ellerman:
 On Fri, 2015-06-05 at 10:16 +0200, Richard Weinberger wrote:
 On Fri, Jun 5, 2015 at 6:40 AM, Cyril Bur cyril...@gmail.com wrote:
 On Tue, 2015-06-02 at 14:26 +1000, Cyril Bur wrote:
 Powerpc powernv platforms allow access to certain system flash devices
 through a firmwarwe interface. This change adds an mtd driver for these
 flash devices.

 Minor updates from Jeremy Kerr and Joel Stanley.

 Signed-off-by: Cyril Bur cyril...@gmail.com
 Signed-off-by: Joel Stanley j...@jms.id.au
 Signed-off-by: Jeremy Kerr j...@ozlabs.org
 ---
 Hello Brian and MTD folk,
 Could I please get an ACK for Michael to take this through the powerpc

 As we have some deadlines approaching, I am getting pressure to ensure
 this gets merged upstream as quickly as possible, please let me know if
 there is anything more which can be done.

 FYI, Brian is not available for the next 1.5 weeks.
 So I fear this driver has to wait for the next merge window.
 
 OK. We'll merge it via the powerpc tree and if there are any problems with it
 we can fix them later.

..or be respectful, have patience and wait for Brian.

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

[PATCH v2] powerpc/rcpm: add RCPM driver

2015-06-11 Thread Yuantian.Tang
From: Tang Yuantian yuantian.t...@freescale.com

There is a RCPM (Run Control/Power Management) in Freescale QorIQ
series processors. The device performs tasks associated with device
run control and power management.

The driver implements some features: mask/unmask irq, enter/exit low
power states, freeze time base, etc.

Signed-off-by: Chenhui Zhao chenhui.z...@freescale.com
Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
---
v2:
- fix code style issues
- refine compatible string match part

 Documentation/devicetree/bindings/soc/fsl/rcpm.txt |  22 ++
 arch/powerpc/include/asm/fsl_guts.h| 105 +++
 arch/powerpc/include/asm/fsl_pm.h  |  48 +++
 arch/powerpc/platforms/85xx/Kconfig|   1 +
 arch/powerpc/sysdev/Kconfig|   5 +
 arch/powerpc/sysdev/Makefile   |   1 +
 arch/powerpc/sysdev/fsl_rcpm.c | 338 +
 7 files changed, 520 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/fsl/rcpm.txt
 create mode 100644 arch/powerpc/include/asm/fsl_pm.h
 create mode 100644 arch/powerpc/sysdev/fsl_rcpm.c

diff --git a/Documentation/devicetree/bindings/soc/fsl/rcpm.txt 
b/Documentation/devicetree/bindings/soc/fsl/rcpm.txt
new file mode 100644
index 000..5318999
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/fsl/rcpm.txt
@@ -0,0 +1,22 @@
+* Run Control and Power Management
+
+The RCPM performs all device-level tasks associated with device run control
+and power management.
+
+Required properites:
+  - reg : Offset and length of the register set of RCPM block.
+  - compatible : Specifies the compatibility list for the RCPM. The type
+should be string, such as fsl,qoriq-rcpm-1.0, fsl,qoriq-rcpm-2.0.
+
+Example:
+The RCPM node for T4240:
+   rcpm: global-utilities@e2000 {
+   compatible = fsl,t4240-rcpm, fsl,qoriq-rcpm-2.0;
+   reg = 0xe2000 0x1000;
+   };
+
+The RCPM node for P4080:
+   rcpm: global-utilities@e2000 {
+   compatible = fsl,qoriq-rcpm-1.0;
+   reg = 0xe2000 0x1000;
+   };
diff --git a/arch/powerpc/include/asm/fsl_guts.h 
b/arch/powerpc/include/asm/fsl_guts.h
index 43b6bb1..a67413c 100644
--- a/arch/powerpc/include/asm/fsl_guts.h
+++ b/arch/powerpc/include/asm/fsl_guts.h
@@ -188,5 +188,110 @@ static inline void guts_set_pmuxcr_dma(struct ccsr_guts 
__iomem *guts,
 
 #endif
 
+struct ccsr_rcpm_v1 {
+   u8  res[4];
+   __be32  cdozsr; /* 0x0004 Core Doze Status Register */
+   u8  res0008[4];
+   __be32  cdozcr; /* 0x000c Core Doze Control Register */
+   u8  res0010[4];
+   __be32  cnapsr; /* 0x0014 Core Nap Status Register */
+   u8  res0018[4];
+   __be32  cnapcr; /* 0x001c Core Nap Control Register */
+   u8  res0020[4];
+   __be32  cdozpsr;/* 0x0024 Core Doze Previous Status Register */
+   u8  res0028[4];
+   __be32  cnappsr;/* 0x002c Core Nap Previous Status Register */
+   u8  res0030[4];
+   __be32  cwaitsr;/* 0x0034 Core Wait Status Register */
+   u8  res0038[4];
+   __be32  cwdtdsr;/* 0x003c Core Watchdog Detect Status Register */
+   __be32  powmgtcsr;  /* 0x0040 PM ControlStatus Register */
+#define RCPM_POWMGTCSR_SLP 0x0002
+   u8  res0044[12];
+   __be32  ippdexpcr;  /* 0x0050 IP Powerdown Exception Control Register */
+   u8  res0054[16];
+   __be32  cpmimr; /* 0x0064 Core PM IRQ Mask Register */
+   u8  res0068[4];
+   __be32  cpmcimr;/* 0x006c Core PM Critical IRQ Mask Register */
+   u8  res0070[4];
+   __be32  cpmmcmr;/* 0x0074 Core PM Machine Check Mask Register */
+   u8  res0078[4];
+   __be32  cpmnmimr;   /* 0x007c Core PM NMI Mask Register */
+   u8  res0080[4];
+   __be32  ctbenr; /* 0x0084 Core Time Base Enable Register */
+   u8  res0088[4];
+   __be32  ctbckselr;  /* 0x008c Core Time Base Clock Select Register */
+   u8  res0090[4];
+   __be32  ctbhltcr;   /* 0x0094 Core Time Base Halt Control Register */
+   u8  res0098[4];
+   __be32  cmcpmaskcr; /* 0x00a4 Core Machine Check Mask Register */
+};
+
+struct ccsr_rcpm_v2 {
+   u8  res_00[12];
+   __be32  tph10sr0;   /* Thread PH10 Status Register */
+   u8  res_10[12];
+   __be32  tph10setr0; /* Thread PH10 Set Control Register */
+   u8  res_20[12];
+   __be32  tph10clrr0; /* Thread PH10 Clear Control Register */
+   u8  res_30[12];
+   __be32  tph10psr0;  /* Thread PH10 Previous Status Register */
+   u8  res_40[12];
+   __be32  twaitsr0;   /* Thread Wait Status Register */
+   u8  res_50[96];
+   __be32  pcph15sr;   /* Physical Core PH15 Status Register */
+   __be32  pcph15setr; /* Physical Core PH15 Set 

[PATCH 1/1] powerpc/tm: Abort syscalls in active transactions (v2)

2015-06-11 Thread Sam Bobroff
This patch changes the syscall handler to doom (tabort) active
transactions when a syscall is made and return very early without
performing the syscall and keeping side effects to a minimum (no CPU
accounting or system call tracing is performed). Also included is a
new HWCAP2 bit, PPC_FEATURE2_HTM_NOSC, to indicate this
behaviour to userspace.

Currently, the system call instruction automatically suspends an
active transaction which causes side effects to persist when an active
transaction fails.

This does change the kernel's behaviour, but in a way that was
documented as unsupported.  It doesn't reduce functionality as
syscalls will still be performed after tsuspend; it just requires that
the transaction be explicitly suspended.  It also provides a
consistent interface and makes the behaviour of user code
substantially the same across powerpc and platforms that do not
support suspended transactions (e.g. x86 and s390).

Performance measurements using
http://ozlabs.org/~anton/junkcode/null_syscall.c indicate the cost of
a normal (non-aborted) system call increases by about 0.25%.

Signed-off-by: Sam Bobroff sam.bobr...@au1.ibm.com
---

 Documentation/powerpc/transactional_memory.txt  | 32 -
 arch/powerpc/include/asm/cputable.h | 10 
 arch/powerpc/include/uapi/asm/cputable.h|  1 +
 arch/powerpc/include/uapi/asm/tm.h  |  2 +-
 arch/powerpc/kernel/cputable.c  |  4 +++-
 arch/powerpc/kernel/entry_64.S  | 28 ++
 tools/testing/selftests/powerpc/tm/tm-syscall.c |  3 ++-
 7 files changed, 57 insertions(+), 23 deletions(-)

diff --git a/Documentation/powerpc/transactional_memory.txt 
b/Documentation/powerpc/transactional_memory.txt
index ded6979..ba0a2a4 100644
--- a/Documentation/powerpc/transactional_memory.txt
+++ b/Documentation/powerpc/transactional_memory.txt
@@ -74,22 +74,23 @@ Causes of transaction aborts
 Syscalls
 
 
-Performing syscalls from within transaction is not recommended, and can lead
-to unpredictable results.
+Syscalls made from within an active transaction will not be performed and the
+transaction will be doomed by the kernel with the failure code TM_CAUSE_SYSCALL
+| TM_CAUSE_PERSISTENT.
 
-Syscalls do not by design abort transactions, but beware: The kernel code will
-not be running in transactional state.  The effect of syscalls will always
-remain visible, but depending on the call they may abort your transaction as a
-side-effect, read soon-to-be-aborted transactional data that should not remain
-invisible, etc.  If you constantly retry a transaction that constantly aborts
-itself by calling a syscall, you'll have a livelock  make no progress.
+Syscalls made from within a suspended transaction are performed as normal and
+the transaction is not explicitly doomed by the kernel.  However, what the
+kernel does to perform the syscall may result in the transaction being doomed
+by the hardware.  The syscall is performed in suspended mode so any side
+effects will be persistent, independent of transaction success or failure.  No
+guarantees are provided by the kernel about which syscalls will affect
+transaction success.
 
-Simple syscalls (e.g. sigprocmask()) could be OK.  Even things like write()
-from, say, printf() should be OK as long as the kernel does not access any
-memory that was accessed transactionally.
-
-Consider any syscalls that happen to work as debug-only -- not recommended for
-production use.  Best to queue them up till after the transaction is over.
+Care must be taken when relying on syscalls to abort during active transactions
+if the calls are made via a library.  Libraries may cache values (which may
+give the appearance of success) or perform operations that cause transaction
+failure before entering the kernel (which may produce different failure codes).
+Examples are glibc's getpid() and lazy symbol resolution.
 
 
 Signals
@@ -176,8 +177,7 @@ kernel aborted a transaction:
  TM_CAUSE_RESCHED   Thread was rescheduled.
  TM_CAUSE_TLBI  Software TLB invalid.
  TM_CAUSE_FAC_UNAV  FP/VEC/VSX unavailable trap.
- TM_CAUSE_SYSCALL   Currently unused; future syscalls that must abort
-transactions for consistency will use this.
+ TM_CAUSE_SYSCALL   Syscall from active transaction.
  TM_CAUSE_SIGNALSignal delivered.
  TM_CAUSE_MISC  Currently unused.
  TM_CAUSE_ALIGNMENT Alignment fault.
diff --git a/arch/powerpc/include/asm/cputable.h 
b/arch/powerpc/include/asm/cputable.h
index 6367b83..4994648 100644
--- a/arch/powerpc/include/asm/cputable.h
+++ b/arch/powerpc/include/asm/cputable.h
@@ -242,11 +242,13 @@ enum {
 
 /* We only set the TM feature if the kernel was compiled with TM supprt */
 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
-#define CPU_FTR_TM_COMPCPU_FTR_TM
-#define PPC_FEATURE2_HTM_COMP  PPC_FEATURE2_HTM
+#define CPU_FTR_TM_COMPCPU_FTR_TM

[PATCH] powerpc: pci: use %pR for printing struct resource

2015-06-11 Thread Kevin Hao
Use %pR to simplify the debug code. This also make the debug info more
readable.

Signed-off-by: Kevin Hao haoke...@gmail.com
---
 arch/powerpc/kernel/pci-common.c | 72 +++-
 1 file changed, 19 insertions(+), 53 deletions(-)

diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index b9de34d44fcb..d44f37854eb1 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -823,23 +823,16 @@ static void pcibios_fixup_resources(struct pci_dev *dev)
(reg.start == 0  !pci_has_flag(PCI_PROBE_ONLY))) {
/* Only print message if not re-assigning */
if (!pci_has_flag(PCI_REASSIGN_ALL_RSRC))
-   pr_debug(PCI:%s Resource %d %016llx-%016llx 
[%x] 
+   pr_debug(PCI:%s Resource %d %pR 
 is unassigned\n,
-pci_name(dev), i,
-(unsigned long long)res-start,
-(unsigned long long)res-end,
-(unsigned int)res-flags);
+pci_name(dev), i, res);
res-end -= res-start;
res-start = 0;
res-flags |= IORESOURCE_UNSET;
continue;
}
 
-   pr_debug(PCI:%s Resource %d %016llx-%016llx [%x]\n,
-pci_name(dev), i,
-(unsigned long long)res-start,\
-(unsigned long long)res-end,
-(unsigned int)res-flags);
+   pr_debug(PCI:%s Resource %d %pR\n, pci_name(dev), i, res);
}
 
/* Call machine specific resource fixup */
@@ -943,11 +936,7 @@ static void pcibios_fixup_bridge(struct pci_bus *bus)
continue;
}
 
-   pr_debug(PCI:%s Bus rsrc %d %016llx-%016llx [%x]\n,
-pci_name(dev), i,
-(unsigned long long)res-start,\
-(unsigned long long)res-end,
-(unsigned int)res-flags);
+   pr_debug(PCI:%s Bus rsrc %d %pR\n, pci_name(dev), i, res);
 
/* Try to detect uninitialized P2P bridge resources,
 * and clear them out so they get re-assigned later
@@ -1132,10 +1121,8 @@ static int reparent_resources(struct resource *parent,
*pp = NULL;
for (p = res-child; p != NULL; p = p-sibling) {
p-parent = res;
-   pr_debug(PCI: Reparented %s [%llx..%llx] under %s\n,
-p-name,
-(unsigned long long)p-start,
-(unsigned long long)p-end, res-name);
+   pr_debug(PCI: Reparented %s %pR under %s\n,
+p-name, p, res-name);
}
return 0;
 }
@@ -1204,14 +1191,10 @@ static void pcibios_allocate_bus_resources(struct 
pci_bus *bus)
}
}
 
-   pr_debug(PCI: %s (bus %d) bridge rsrc %d: %016llx-%016llx 
-[0x%x], parent %p (%s)\n,
-bus-self ? pci_name(bus-self) : PHB,
-bus-number, i,
-(unsigned long long)res-start,
-(unsigned long long)res-end,
-(unsigned int)res-flags,
-pr, (pr  pr-name) ? pr-name : nil);
+   pr_debug(PCI: %s (bus %d) bridge rsrc %d: %pR, parent %p 
+(%s)\n, bus-self ? pci_name(bus-self) : PHB,
+bus-number, i, res, pr,
+(pr  pr-name) ? pr-name : nil);
 
if (pr  !(pr-flags  IORESOURCE_UNSET)) {
struct pci_dev *dev = bus-self;
@@ -1253,11 +1236,8 @@ static inline void alloc_resource(struct pci_dev *dev, 
int idx)
 {
struct resource *pr, *r = dev-resource[idx];
 
-   pr_debug(PCI: Allocating %s: Resource %d: %016llx..%016llx [%x]\n,
-pci_name(dev), idx,
-(unsigned long long)r-start,
-(unsigned long long)r-end,
-(unsigned int)r-flags);
+   pr_debug(PCI: Allocating %s: Resource %d: %pR\n,
+pci_name(dev), idx, r);
 
pr = pci_find_parent_resource(dev, r);
if (!pr || (pr-flags  IORESOURCE_UNSET) ||
@@ -1265,11 +1245,7 @@ static inline void alloc_resource(struct pci_dev *dev, 
int idx)
printk(KERN_WARNING PCI: Cannot allocate resource region %d
of device %s, will remap\n, idx, pci_name(dev));
if (pr)
-   pr_debug(PCI:  parent is %p: %016llx-%016llx [%x]\n,
-pr,
-

mainline vs. QorIQ SDK for production with FSL SoCs...

2015-06-11 Thread Bob Cochran

Hi,

Please correct me if I'm mistaken and / or provide your own insight on 
the following:


I'm under the impression that it's better to develop with the mainline 
(eventually freezing for production on a stable release / branch ) than 
use the QorIQ SDK if the needed code (e.g., DPAA drivers) has been 
upstreamed and is included in the mainline.


It's my perception that it is preferable to develop with the mainline 
because there are more active open-source developers working with this 
code and actively reviewing / testing it than with the SDK and 
backported or stale drivers (e.g., WiFi)


I'm sure that there are at least dozens of FSL developers working with 
the SDK on a daily basis, but this is behind the FSL firewall, and open 
source developers, such as myself, don't have access to FSL patches 
except for every six months when a new SDK is released.


It seems to me that there will be a much better chance of hearing about 
new bugs from others and getting help debugging problems if we're using 
the mainline.  But again, the caveat is that the necessary kernel 
technology for the product is included in the mainline ( SDK contains 
some source for drivers and libraries only available under an FSL EULA ).


FYI - at this point, we're testing  developing with both the SDK 3.12 
kernel and the mainline kernel, but it would be nice to drop the former.


Lastly, for something like the p1010, we have found it to stable with 
the mainline for quite some time.


Thank you,

Bob



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

Re: [PATCH v3 2/2] cxl: use more common format specifier

2015-06-11 Thread Ian Munsie
Acked-by: Ian Munsie imun...@au1.ibm.com

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

[PATCH v2] ALSA: aoa: convert bus code to use dev_groups

2015-06-11 Thread Quentin Lambert

The dev_attrs field of struct bus_type is going away, use dev_groups instead.
This converts the soundbus code to use the correct field.

Given that all other usages of the macro define the struct attribute
*xxx_attrs[] in the same file they assign the .dev_groups field, this patch
merges sysfs.c into core.c.

These modifications were made using Coccinelle.

Signed-off-by: Quentin Lambert lambert.quen...@gmail.com
---
 Changes since v1:
  - Fix the commit message to actually talk about soundbus rather than MDIO
  - This version attempt to fix a problem resulting from the macro
ATTRIBUTE_GROUPS declaring the structure as static by merging sysfs.c into
core.c. I understand that this may not be the prefered solution since 
Takashi suggested that adding a comment line to the previous version could
be acceptable. 

 sound/aoa/soundbus/Makefile   |2 -
 sound/aoa/soundbus/core.c |   44 +-
 sound/aoa/soundbus/soundbus.h |2 -
 sound/aoa/soundbus/sysfs.c|   42 
 4 files changed, 44 insertions(+), 46 deletions(-)

--- a/sound/aoa/soundbus/Makefile
+++ b/sound/aoa/soundbus/Makefile
@@ -1,3 +1,3 @@
 obj-$(CONFIG_SND_AOA_SOUNDBUS) += snd-aoa-soundbus.o
-snd-aoa-soundbus-objs := core.o sysfs.o
+snd-aoa-soundbus-objs := core.o
 obj-$(CONFIG_SND_AOA_SOUNDBUS_I2S) += i2sbus/
--- a/sound/aoa/soundbus/core.c
+++ b/sound/aoa/soundbus/core.c
@@ -150,6 +150,48 @@ static int soundbus_device_resume(struct
 
 #endif /* CONFIG_PM */
 
+#define soundbus_config_of_attr(field, format_string)  \
+static ssize_t \
+field##_show (struct device *dev, struct device_attribute *attr,   \
+  char *buf)   \
+{  \
+   struct soundbus_dev *mdev = to_soundbus_device (dev);   \
+   return sprintf (buf, format_string, mdev-ofdev.dev.of_node-field); \
+}
+
+static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
+char *buf)
+{
+   struct soundbus_dev *sdev = to_soundbus_device(dev);
+   struct platform_device *of = sdev-ofdev;
+   int length;
+
+   if (*sdev-modalias) {
+   strlcpy(buf, sdev-modalias, sizeof(sdev-modalias) + 1);
+   strcat(buf, \n);
+   length = strlen(buf);
+   } else {
+   length = sprintf(buf, of:N%sT%s\n,
+of-dev.of_node-name, of-dev.of_node-type);
+   }
+
+   return length;
+}
+static DEVICE_ATTR_RO(modalias);
+
+soundbus_config_of_attr (name, %s\n);
+static DEVICE_ATTR_RO(name);
+soundbus_config_of_attr (type, %s\n);
+static DEVICE_ATTR_RO(type);
+
+struct attribute *soundbus_dev_attrs[] = {
+   dev_attr_name.attr,
+   dev_attr_type.attr,
+   dev_attr_modalias.attr,
+   NULL,
+};
+ATTRIBUTE_GROUPS(soundbus_dev);
+
 static struct bus_type soundbus_bus_type = {
.name   = aoa-soundbus,
.probe  = soundbus_probe,
@@ -160,7 +202,7 @@ static struct bus_type soundbus_bus_type
.suspend= soundbus_device_suspend,
.resume = soundbus_device_resume,
 #endif
-   .dev_attrs  = soundbus_dev_attrs,
+   .dev_groups = soundbus_dev_groups,
 };
 
 int soundbus_add_one(struct soundbus_dev *dev)
--- a/sound/aoa/soundbus/soundbus.h
+++ b/sound/aoa/soundbus/soundbus.h
@@ -199,6 +199,4 @@ struct soundbus_driver {
 extern int soundbus_register_driver(struct soundbus_driver *drv);
 extern void soundbus_unregister_driver(struct soundbus_driver *drv);
 
-extern struct device_attribute soundbus_dev_attrs[];
-
 #endif /* __SOUNDBUS_H */
--- a/sound/aoa/soundbus/sysfs.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include linux/kernel.h
-#include linux/stat.h
-/* FIX UP */
-#include soundbus.h
-
-#define soundbus_config_of_attr(field, format_string)  \
-static ssize_t \
-field##_show (struct device *dev, struct device_attribute *attr,   \
-  char *buf)   \
-{  \
-   struct soundbus_dev *mdev = to_soundbus_device (dev);   \
-   return sprintf (buf, format_string, mdev-ofdev.dev.of_node-field); \
-}
-
-static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
-char *buf)
-{
-   struct soundbus_dev *sdev = to_soundbus_device(dev);
-   struct platform_device *of = sdev-ofdev;
-   int length;
-
-   if (*sdev-modalias) {
-   strlcpy(buf, sdev-modalias, sizeof(sdev-modalias) + 1);
-   strcat(buf, \n);
-   length = strlen(buf);
-   } else {
-   length = sprintf(buf, of:N%sT%s\n,

Re: [PATCH v2] powerpc: support sizes greater than an unsigned long

2015-06-11 Thread Greg KH
On Thu, Jun 11, 2015 at 05:42:00PM +0300, Cristian Stoica wrote:
 Hi Greg,
 
 Can you have a look at this patch?
 
 https://patchwork.kernel.org/patch/6413191/

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