Re: [PATCH v3 02/11] perf: add PMU_FORMAT_RANGE() helper for use by sw-like pmus

2014-03-04 Thread Cody P Schafer

On 03/03/2014 09:19 PM, Michael Ellerman wrote:

On Thu, 2014-27-02 at 21:04:55 UTC, Cody P Schafer wrote:

Add PMU_FORMAT_RANGE() and PMU_FORMAT_RANGE_RESERVED() (for reserved
areas) which generate functions to extract the relevent bits from
event-attr.config{,1,2} for use by sw-like pmus where the
'config{,1,2}' values don't map directly to hardware registers.

Signed-off-by: Cody P Schafer c...@linux.vnet.ibm.com
---
  include/linux/perf_event.h | 17 +
  1 file changed, 17 insertions(+)

diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index e56b07f..3da5081 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -871,4 +871,21 @@ _name##_show(struct device *dev,   
\
\
  static struct device_attribute format_attr_##_name = __ATTR_RO(_name)

+#define PMU_FORMAT_RANGE(name, attr_var, bit_start, bit_end)   \
+PMU_FORMAT_ATTR(name, #attr_var : #bit_start - #bit_end);  \
+PMU_FORMAT_RANGE_RESERVED(name, attr_var, bit_start, bit_end)


I really think these should have event in the name.

Someone looking at the code is going to see event_get_foo() and wonder where
that is defined. Grep won't find a definition, tags won't find a definition,
the least you can do is have the macro name give some hint.



That is a good point (grep-ability). Let me think about this. There is 
also the possibility that I could adjust the event_get_*() naming to 
something else. format_get_*()? event_get_format_*()? (these names keep 
growing...)



+#define PMU_FORMAT_RANGE_RESERVED(name, attr_var, bit_start, bit_end)  \


It doesn't generate a format attribute.


This was done with the idea that the term format didn't just refer to 
the attribute exposed in sysfs, it referred to some subset of bits 
extractable from attr.config{,1,2}. Which is also the reasoning for the 
above naming.



+static u64 event_get_##name##_max(void)
\
+{  \
+   int bits = (bit_end) - (bit_start) + 1; \
+   return ((0x1ULL  (bits - 1ULL)) - 1ULL) |   \
+   (0xFULL  (bits - 4ULL));\


What's wrong with:

(0x1ULL  ((bit_end) - (bit_start) + 1)) - 1ULL;


Overflowing the  when bit_end = 63 and bit_start = 0 results in max(0, 
63) = 0.
That said, the current implementation is wrong when (bits  4). Here's 
one that actually works (without overflowing):


return (((1ull  (bit_end - bit_start)) - 1)  1) + 1;

And an examination of the problematic case:

#if 0
typedef unsigned long long ull;
ull a = bits - 1; /* 63 */
ull b = 1  a;   /* 0x8000 */
ull c = b - 1;/* 0x7fff */
ull d = b  1;   /* 0xfffe */
ull e = d + 1;/* 0x */
return e;
#endif

Small number of valid inputs, so I also tested it for all of them using

unsigned bits = (bit_end) - (bit_start) + 1;
return (bits  (sizeof(0ULL) * CHAR_BIT))
? ((1ULL  bits) - 1ULL)
: ~0ULL;

As the baseline correct one.

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

UART Fifo mode

2014-03-04 Thread poonam.aggr...@freescale.com
Hello All

I am debugging a UART issue on a Freescale PowerPC SOC.

My observations are:

When FiFo mode is enabled FCR[FEN]=1, and the Fifo size is 16byte. I see 
console prints not coming properly, lot of missing characters.

But here when I change the tx_loadsz to 8, the UART works fine.

[PORT_16550A] = {
.name   = 16550A,
.fifo_size  = 16,
-   .tx_loadsz  = 16,
+   .tx_loadsz  = 8,
.fcr= UART_FCR_ENABLE_FIFO | UART_FCR_R_TRIG_10,
.flags  = UART_CAP_FIFO,
},

Can anybody help to understand what is the significance of tx_loadsz. From the 
code (drivers/serial/tty/8250/8250.c), looks like this parameter controls the 
bytes we write to the UART Tx register at one  time.
So ideally this should be equal to the Fifo size.

I also see certain UARTs where tx_loadsz is not equal to fifo_size, less than 
fifo_size.

Please help me to understand how should tx_loadsz be determined?

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

RE: [PATCH] Corenet: Add QE platform support for Corenet

2014-03-04 Thread qiang.z...@freescale.com
On Mar 3, 2014, at 11:51 PM, Kumar Gala [ga...@kernel.crashing.org] wrote:



 -Original Message-
 From: Kumar Gala [mailto:ga...@kernel.crashing.org]
 Sent: Monday, March 03, 2014 11:51 PM
 To: Zhao Qiang-B45475
 Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Xie Xiaobo-R63061
 Subject: Re: [PATCH] Corenet: Add QE platform support for Corenet
 
 
 On Feb 28, 2014, at 2:48 AM, Zhao Qiang b45...@freescale.com wrote:
 
  There is QE on platform T104x, add support.
  Call funcs qe_ic_init and qe_init if CONFIG_QUICC_ENGINE is defined.
 
  Signed-off-by: Zhao Qiang b45...@freescale.com
  ---
  arch/powerpc/platforms/85xx/corenet_generic.c | 32
  +++
  1 file changed, 32 insertions(+)
 
 Can you use mpc85xx_qe_init() instead?


mpc85xx_qe_init() is for old QE which is different from new QE.
New QE has no par_io, and it is not correct to init 
par_io(par_io_init() called in mpc85xx_qe_init()) for new QE. 

 
 
  diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c
  b/arch/powerpc/platforms/85xx/corenet_generic.c
  index fbd871e..f8c8e0c 100644
  --- a/arch/powerpc/platforms/85xx/corenet_generic.c
  +++ b/arch/powerpc/platforms/85xx/corenet_generic.c
 
  /*
  @@ -52,11 +68,24 @@ void __init corenet_gen_pic_init(void)  */ void
  __init corenet_gen_setup_arch(void) {
  +#ifdef CONFIG_QUICC_ENGINE
  +   struct device_node *np;
  +#endif
  mpc85xx_smp_init();
 
  swiotlb_detect_4g();
 
  pr_info(%s board from Freescale Semiconductor\n, ppc_md.name);
  +
  +#ifdef CONFIG_QUICC_ENGINE
  +   np = of_find_compatible_node(NULL, NULL, fsl,qe);
  +   if (!np) {
  +   pr_err(%s: Could not find Quicc Engine node\n, __func__);
  +   return;
 
 This doesn't seem like an reasonable error message for common corenet
 platform.  It seems reasonable to build QE support but boot on a chip w/o
 QE.
 
  +   }
  +   qe_reset();
  +   of_node_put(np);
  +#endif
  }
  ___
  Linuxppc-dev mailing list
  Linuxppc-dev@lists.ozlabs.org
  https://lists.ozlabs.org/listinfo/linuxppc-dev
 
 


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

Re: [PATCH v3] powerpc/powernv Platform dump interface

2014-03-04 Thread Vasant Hegde

On 03/03/2014 04:55 AM, Stewart Smith wrote:

This enables support for userspace to fetch and initiate FSP and
Platform dumps from the service processor (via firmware) through sysfs.

Based on original patch from Vasant Hegde hegdevas...@linux.vnet.ibm.com

Flow:
   - We register for OPAL notification events.
   - OPAL sends new dump available notification.
   - We make information on dump available via sysfs
   - Userspace requests dump contents
   - We retrieve the dump via OPAL interface
   - User copies the dump data
   - userspace sends ack for dump
   - We send ACK to OPAL.

sysfs files:
   - We add the /sys/firmware/opal/dump directory
   - echoing 1 (well, anything, but in future we may support
 different dump types) to /sys/firmware/opal/dump/initiate_dump
 will initiate a dump.


Stewart,

s/initiate/initiate FSP/


   - Each dump that we've been notified of gets a directory
 in /sys/firmware/opal/dump/ with a name of the dump type and ID (in hex,
 as this is what's used elsewhere to identify the dump).
   - Each dump has files: id, type, dump and acknowledge
 dump is binary and is the dump itself.
 echoing 'ack' to acknowledge (currently any string will do) will
 acknowledge the dump and it will soon after disappear from sysfs.

OPAL APIs:
   - opal_dump_init()
   - opal_dump_info()


opal_dump_info2()


   - opal_dump_read()
   - opal_dump_ack()
   - opal_dump_resend_notification()

Currently we are only ever notified for one dump at a time (until
the user explicitly acks the current dump, then we get a notification
of the next dump), but this kernel code should just work when OPAL
starts notifying us of all the dumps present.

Changes since v2:
  - fix bug where we would free the dump buffer after userspace read it,
refetching if needed. Refetching doesn't currently work, so we must
keep the dump around for subsequent reads.

Changes since v1:
  - Add support for getting dump type from OPAL through new OPAL call
(falling back to old OPAL_DUMP_INFO call if OPAL_DUMP_INFO2 isn't
 supported)
  - use dump type in directory name for dump

Signed-off-by: Stewart Smith stew...@linux.vnet.ibm.com
---
  Documentation/ABI/stable/sysfs-firmware-opal-dump |   41 ++
  arch/powerpc/include/asm/opal.h   |   14 +
  arch/powerpc/platforms/powernv/Makefile   |2 +-
  arch/powerpc/platforms/powernv/opal-dump.c|  525 +
  arch/powerpc/platforms/powernv/opal-wrappers.S|6 +
  arch/powerpc/platforms/powernv/opal.c |2 +
  6 files changed, 589 insertions(+), 1 deletion(-)
  create mode 100644 Documentation/ABI/stable/sysfs-firmware-opal-dump
  create mode 100644 arch/powerpc/platforms/powernv/opal-dump.c

diff --git a/Documentation/ABI/stable/sysfs-firmware-opal-dump 
b/Documentation/ABI/stable/sysfs-firmware-opal-dump
new file mode 100644
index 000..32fe7f5
--- /dev/null
+++ b/Documentation/ABI/stable/sysfs-firmware-opal-dump
@@ -0,0 +1,41 @@
+What:  /sys/firmware/opal/dump
+Date:  Feb 2014
+Contact:   Stewart Smith stew...@linux.vnet.ibm.com
+Description:
+   This directory exposes interfaces for interacting with
+   the FSP and platform dumps through OPAL firmware interface.
+
+   This is only for the powerpc/powernv platform.
+
+   initiate_dump:  When '1' is written to it,
+   we will initiate a dump.


initiate FSP dump


+   Read this file for supported commands.
+
+   0xXX-0x:A directory for dump of type 0xXX and
+   id 0x (in hex). The name of this
+   directory should not be relied upon to
+   be in this format, only that it's unique
+   among all dumps. For determining the type
+   and ID of the dump, use the id and type files.
+   Do not rely on any particular size of dump
+   type or dump id.
+
+   Each dump has the following files:
+   id: An ASCII representation of the dump ID
+   in hex (e.g. '0x01')
+   type:   An ASCII representation of the type of
+   dump in the format 0x%x %s with the ID


Better 0x%x - %s ?


+   in hex and a description of the dump type
+   (or 'unknown').
+   Type '0x unknown' is used when
+   we could not get the type from firmware.
+   e.g. '0x02 System/Platform Dump'
+   dump:   A binary file containing the dump.
+   The size of the dump is the size of this file.
+   acknowledge:When 'ack' is 

Re: [PATCH] powerpc/powernv: Read OPAL error log and export it through sysfs

2014-03-04 Thread Vasant Hegde

On 02/28/2014 06:28 AM, Stewart Smith wrote:

Based on a patch by: Mahesh Salgaonkar mah...@linux.vnet.ibm.com

This patch adds support to read error logs from OPAL and export
them to userspace through a sysfs interface.

We export each log entry as a directory in /sys/firmware/opal/elog/

Currently, OPAL will buffer up to 128 error log records, we don't
need to have any knowledge of this limit on the Linux side as that
is actually largely transparent to us.

Each error log entry has the following files: id, type, acknowledge, raw.
Currently we just export the raw binary error log in the 'raw' attribute.
In a future patch, we may parse more of the error log to make it a bit
easier for userspace (e.g. to be able to display a brief summary in
petitboot without having to have a full parser).

If we have 128 logs from OPAL, we'll only be notified of 128 until
userspace starts acknowledging them. This limitation may be lifted in
the future and with this patch, that should just work from the linux side.

A userspace daemon should:
- wait for error log entries using normal mechanisms (we announce creation)
- read error log entry
- save error log entry safely to disk
- acknowledge the error log entry
- rinse, repeat.

On the Linux side, we read the error log when we're notified of it. This
possibly isn't ideal as it would be better to only read them on-demand.
However, this doesn't really work with current OPAL interface, so we
read the error log immediately when notified at the moment.

I've tested this pretty extensively and am rather confident that the
linux side of things works rather well. There is currently an issue with
the service processor side of things for 128 error logs though.

Signed-off-by: Stewart Smith stew...@linux.vnet.ibm.com
---
  Documentation/ABI/stable/sysfs-firmware-opal-elog |   60 
  arch/powerpc/include/asm/opal.h   |   13 +
  arch/powerpc/platforms/powernv/Makefile   |2 +-
  arch/powerpc/platforms/powernv/opal-elog.c|  312 +
  arch/powerpc/platforms/powernv/opal-wrappers.S|5 +
  arch/powerpc/platforms/powernv/opal.c |2 +
  6 files changed, 393 insertions(+), 1 deletion(-)
  create mode 100644 Documentation/ABI/stable/sysfs-firmware-opal-elog
  create mode 100644 arch/powerpc/platforms/powernv/opal-elog.c

diff --git a/Documentation/ABI/stable/sysfs-firmware-opal-elog 
b/Documentation/ABI/stable/sysfs-firmware-opal-elog
new file mode 100644
index 000..e1f3058
--- /dev/null
+++ b/Documentation/ABI/stable/sysfs-firmware-opal-elog
@@ -0,0 +1,60 @@
+What:  /sys/firmware/opal/elog
+Date:  Feb 2014
+Contact:   Stewart Smith stew...@linux.vnet.ibm.com
+Description:
+   This directory exposes error log entries retrieved
+   through the OPAL firmware interface.
+
+   Each error log is identified by a unique ID and will
+   exist until explicitly acknowledged to firmware.
+
+   Each log entry has a directory in /sys/firmware/opal/elog.
+
+   Log entries may be purged by the service processor
+   before retrieved by firmware or retrieved/acknowledged by
+   Linux if there is no room for more log entries.
+
+   In the event that Linux has retrieved the log entries
+   but not explicitly acknowledged them to firmware and
+   the service processor needs more room for log entries,
+   the only remaining copy of a log message may be in
+   Linux.
+
+   Typically, a user space daemon will monitor for new
+   entries, read them out and acknowledge them.
+
+   The service processor may be able to store more log
+   entries than firmware can, so after you acknowledge
+   an event from Linux you may instantly get another one
+   from the queue that was generated some time in the past.
+
+   The raw log format is a binary format. We currently
+   do not parse this at all in kernel, leaving it up to
+   user space to solve the problem. In future, we may
+   do more parsing in kernel and add more files to make
+   it easier for simple user space processes to extract
+   more information.
+
+   For each log entry (directory), there are the following
+   files:
+
+   id: An ASCII representation of the ID of the
+   error log, in hex - e.g. 0x01.
+
+   type:   An ASCII representation of the type id and
+   description of the type of error log.
+   Currently just 0x00 PEL - platform error log.
+   In the future there may be additional types.
+
+   raw:A read-only binary file that can be read
+

Re: [PATCH] powerpc: Align p_dyn, p_rela and p_st symbols

2014-03-04 Thread Laurent Dufour
On 03/03/2014 22:31, Anton Blanchard wrote:
 
 The 64bit relocation code places a few symbols in the text segment.
 These symbols are only 4 byte aligned where they need to be 8 byte
 aligned. Add an explicit alignment.
 
 Signed-off-by: Anton Blanchard an...@samba.org
 Cc: sta...@vger.kernel.org

Fix the issue I was seeing when booting a LE kernel in a KVM guest on my
P7 box.

Tested-by: Laurent Dufour lduf...@linux.vnet.ibm.com

 ---
 
 diff --git a/arch/powerpc/kernel/reloc_64.S b/arch/powerpc/kernel/reloc_64.S
 index 1482327..d88736f 100644
 --- a/arch/powerpc/kernel/reloc_64.S
 +++ b/arch/powerpc/kernel/reloc_64.S
 @@ -81,6 +81,7 @@ _GLOBAL(relocate)
  
  6:   blr
  
 +.balign 8
  p_dyn:   .llong  __dynamic_start - 0b
  p_rela:  .llong  __rela_dyn_start - 0b
  p_st:.llong  _stext - 0b
 ___
 Linuxppc-dev mailing list
 Linuxppc-dev@lists.ozlabs.org
 https://lists.ozlabs.org/listinfo/linuxppc-dev
 

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

[tip:irq/core] powerpc: Irq: Use generic_handle_irq

2014-03-04 Thread tip-bot for Thomas Gleixner
Commit-ID:  a4e04c9f219d2c00764ffa7ba45500411815879d
Gitweb: http://git.kernel.org/tip/a4e04c9f219d2c00764ffa7ba45500411815879d
Author: Thomas Gleixner t...@linutronix.de
AuthorDate: Sun, 23 Feb 2014 21:40:08 +
Committer:  Thomas Gleixner t...@linutronix.de
CommitDate: Tue, 4 Mar 2014 17:37:52 +0100

powerpc: Irq: Use generic_handle_irq

No functional change

Signed-off-by: Thomas Gleixner t...@linutronix.de
Cc: Peter Zijlstra pet...@infradead.org
Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
Cc: ppc linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/20140223212736.333718...@linutronix.de
Signed-off-by: Thomas Gleixner t...@linutronix.de
---
 arch/powerpc/kernel/irq.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 1d0848b..ca1cd74 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -465,7 +465,6 @@ static inline void check_stack_overflow(void)
 
 void __do_irq(struct pt_regs *regs)
 {
-   struct irq_desc *desc;
unsigned int irq;
 
irq_enter();
@@ -487,11 +486,8 @@ void __do_irq(struct pt_regs *regs)
/* And finally process it */
if (unlikely(irq == NO_IRQ))
__get_cpu_var(irq_stat).spurious_irqs++;
-   else {
-   desc = irq_to_desc(irq);
-   if (likely(desc))
-   desc-handle_irq(irq, desc);
-   }
+   else
+   generic_handle_irq(irq);
 
trace_irq_exit(regs);
 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[tip:irq/core] powerpc:eVh_pic: Kill irq_desc abuse

2014-03-04 Thread tip-bot for Thomas Gleixner
Commit-ID:  c866cda47f2c6c8abb929933b7794e9a92d7c924
Gitweb: http://git.kernel.org/tip/c866cda47f2c6c8abb929933b7794e9a92d7c924
Author: Thomas Gleixner t...@linutronix.de
AuthorDate: Sun, 23 Feb 2014 21:40:08 +
Committer:  Thomas Gleixner t...@linutronix.de
CommitDate: Tue, 4 Mar 2014 17:37:51 +0100

powerpc:eVh_pic: Kill irq_desc abuse

I'm really grumpy about this one. The line:

#include ../../../kernel/irq/settings.h

should have been an alarm sign for all people who added their SOB to
this trainwreck.

When I cleaned up the mess people made with interrupt descriptors a
few years ago, I warned that I'm going to hunt down new offenders and
treat them with stinking trouts. In this case I'll use frozen shark
for a better educational value.

The whole idiocy which was done there could have been avoided with two
lines of perfectly fine code. And do not complain about the lack of
correct examples in tree.

The solution is simple:

  Remove the brainfart and use the proper functions, which should
  have been used in the first place

Signed-off-by: Thomas Gleixner t...@linutronix.de
Cc: Peter Zijlstra pet...@infradead.org
Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
Cc: Ashish Kalra ashish.ka...@freescale.com
Cc: Timur Tabi ti...@freescale.com
Cc: Kumar Gala ga...@kernel.crashing.org
Cc: ppc linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/20140223212736.451970...@linutronix.de
Signed-off-by: Thomas Gleixner t...@linutronix.de
---
 arch/powerpc/sysdev/ehv_pic.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/sysdev/ehv_pic.c b/arch/powerpc/sysdev/ehv_pic.c
index b74085c..2d20f10 100644
--- a/arch/powerpc/sysdev/ehv_pic.c
+++ b/arch/powerpc/sysdev/ehv_pic.c
@@ -28,8 +28,6 @@
 #include asm/ehv_pic.h
 #include asm/fsl_hcalls.h
 
-#include ../../../kernel/irq/settings.h
-
 static struct ehv_pic *global_ehv_pic;
 static DEFINE_SPINLOCK(ehv_pic_lock);
 
@@ -113,17 +111,13 @@ static unsigned int ehv_pic_type_to_vecpri(unsigned int 
type)
 int ehv_pic_set_irq_type(struct irq_data *d, unsigned int flow_type)
 {
unsigned int src = virq_to_hw(d-irq);
-   struct irq_desc *desc = irq_to_desc(d-irq);
unsigned int vecpri, vold, vnew, prio, cpu_dest;
unsigned long flags;
 
if (flow_type == IRQ_TYPE_NONE)
flow_type = IRQ_TYPE_LEVEL_LOW;
 
-   irq_settings_clr_level(desc);
-   irq_settings_set_trigger_mask(desc, flow_type);
-   if (flow_type  (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_LEVEL_LOW))
-   irq_settings_set_level(desc);
+   irqd_set_trigger_type(d, flow_type);
 
vecpri = ehv_pic_type_to_vecpri(flow_type);
 
@@ -144,7 +138,7 @@ int ehv_pic_set_irq_type(struct irq_data *d, unsigned int 
flow_type)
ev_int_set_config(src, vecpri, prio, cpu_dest);
 
spin_unlock_irqrestore(ehv_pic_lock, flags);
-   return 0;
+   return IRQ_SET_MASK_OK_NOCOPY;
 }
 
 static struct irq_chip ehv_pic_irq_chip = {
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[tip:irq/core] powerpc: Eeh: Kill another abuse of irq_desc

2014-03-04 Thread tip-bot for Thomas Gleixner
Commit-ID:  b8a9a11b976810ba12a43c4fe699a14892c97e52
Gitweb: http://git.kernel.org/tip/b8a9a11b976810ba12a43c4fe699a14892c97e52
Author: Thomas Gleixner t...@linutronix.de
AuthorDate: Sun, 23 Feb 2014 21:40:09 +
Committer:  Thomas Gleixner t...@linutronix.de
CommitDate: Tue, 4 Mar 2014 17:37:52 +0100

powerpc: Eeh: Kill another abuse of irq_desc

commit 91150af3a (powerpc/eeh: Fix unbalanced enable for IRQ) is
another brilliant example of trainwreck engineering.

The patch fixes the issue of an unbalanced call to irq_enable()
which causes a prominent warning by checking the disabled state of the
interrupt line and call conditionally into the core code.

This is wrong in two aspects:

1) The warning is there to tell users, that they need to fix their
   asymetric enable/disable patterns by finding the root cause and
   solving it there.

   It's definitely not meant to work around it by conditionally
   calling into the core code depending on the random state of the irq
   line.

   Asymetric irq_disable/enable calls are a clear sign of wrong usage
   of the interfaces which have to be cured at the root and not by
   somehow hacking around it.

2) The abuse of core internal data structure instead of using the
   proper interfaces for retrieving the information for the 'hack
   around'

   irq_desc is core internal and it's clear enough stated.

Replace at least the irq_desc abuse with the proper functions and add
a big fat comment why this is absurd and completely wrong.

Signed-off-by: Thomas Gleixner t...@linutronix.de
Cc: Peter Zijlstra pet...@infradead.org
Cc: Gavin Shan sha...@linux.vnet.ibm.com
Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
Cc: ppc linuxppc-dev@lists.ozlabs.org
Link: http://lkml.kernel.org/r/20140223212736.562906...@linutronix.de
Signed-off-by: Thomas Gleixner t...@linutronix.de
---
 arch/powerpc/kernel/eeh_driver.c | 26 +-
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index fdc679d..3e1d7de 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -143,15 +143,31 @@ static void eeh_disable_irq(struct pci_dev *dev)
 static void eeh_enable_irq(struct pci_dev *dev)
 {
struct eeh_dev *edev = pci_dev_to_eeh_dev(dev);
-   struct irq_desc *desc;
 
if ((edev-mode)  EEH_DEV_IRQ_DISABLED) {
edev-mode = ~EEH_DEV_IRQ_DISABLED;
-
-   desc = irq_to_desc(dev-irq);
-   if (desc  desc-depth  0)
+   /*
+* FIXME !
+*
+* This is just ass backwards. This maze has
+* unbalanced irq_enable/disable calls. So instead of
+* finding the root cause it works around the warning
+* in the irq_enable code by conditionally calling
+* into it.
+*
+* That's just wrong.The warning in the core code is
+* there to tell people to fix their assymetries in
+* their own code, not by abusing the core information
+* to avoid it.
+*
+* I so wish that the assymetry would be the other way
+* round and a few more irq_disable calls render that
+* shit unusable forever.
+*
+*  tglx
+*/
+   if (irqd_irq_disabled(irq_get_irq_data(dev-irq))
enable_irq(dev-irq);
-   }
 }
 
 /**
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] Corenet: Add QE platform support for Corenet

2014-03-04 Thread Scott Wood
On Tue, 2014-03-04 at 03:09 -0600, Zhao Qiang-B45475 wrote:
 On Mar 3, 2014, at 11:51 PM, Kumar Gala [ga...@kernel.crashing.org] wrote:
 
 
 
  -Original Message-
  From: Kumar Gala [mailto:ga...@kernel.crashing.org]
  Sent: Monday, March 03, 2014 11:51 PM
  To: Zhao Qiang-B45475
  Cc: linuxppc-dev@lists.ozlabs.org; Wood Scott-B07421; Xie Xiaobo-R63061
  Subject: Re: [PATCH] Corenet: Add QE platform support for Corenet
  
  
  On Feb 28, 2014, at 2:48 AM, Zhao Qiang b45...@freescale.com wrote:
  
   There is QE on platform T104x, add support.
   Call funcs qe_ic_init and qe_init if CONFIG_QUICC_ENGINE is defined.
  
   Signed-off-by: Zhao Qiang b45...@freescale.com
   ---
   arch/powerpc/platforms/85xx/corenet_generic.c | 32
   +++
   1 file changed, 32 insertions(+)
  
  Can you use mpc85xx_qe_init() instead?
 
 
 mpc85xx_qe_init() is for old QE which is different from new QE.
 New QE has no par_io, and it is not correct to init 
 par_io(par_io_init() called in mpc85xx_qe_init()) for new QE. 

So split that function into mpc85xx_qe_init() and
mpc85xx_qe_par_io_init().

  
   diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c
   b/arch/powerpc/platforms/85xx/corenet_generic.c
   index fbd871e..f8c8e0c 100644
   --- a/arch/powerpc/platforms/85xx/corenet_generic.c
   +++ b/arch/powerpc/platforms/85xx/corenet_generic.c
  
   /*
   @@ -52,11 +68,24 @@ void __init corenet_gen_pic_init(void)  */ void
   __init corenet_gen_setup_arch(void) {
   +#ifdef CONFIG_QUICC_ENGINE
   + struct device_node *np;
   +#endif
 mpc85xx_smp_init();
  
 swiotlb_detect_4g();
  
 pr_info(%s board from Freescale Semiconductor\n, ppc_md.name);
   +
   +#ifdef CONFIG_QUICC_ENGINE
   + np = of_find_compatible_node(NULL, NULL, fsl,qe);
   + if (!np) {
   + pr_err(%s: Could not find Quicc Engine node\n, __func__);
   + return;
  
  This doesn't seem like an reasonable error message for common corenet
  platform.  It seems reasonable to build QE support but boot on a chip w/o
  QE.

mpc85xx_qe_init() has a similar problem regarding the error message, but
the above is worse because it does an early return from
corenet_gen_setup_arch() rather than just from mpc85xx_qe_init() -- what
if someone added non-QE things after this point?

-Scott


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

[RFC PATCH] Remove CONFIG_DCACHE_WORD_ACCESS

2014-03-04 Thread Joe Perches
It seems to duplicate CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
so use that instead.

This changes the !CPU_LITTLE_ENDIAN powerpc arch to use unaligned
accesses in fs/dcache.c and fs/namei.c as
CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is enabled for that arch.

Remove the now unused DCACHE_WORD_ACCESS defines  uses.

Signed-off-by: Joe Perches j...@perches.com
---
 arch/arm/Kconfig  | 1 -
 arch/arm/include/asm/word-at-a-time.h | 4 ++--
 arch/arm64/Kconfig| 1 -
 arch/x86/Kconfig  | 1 -
 fs/Kconfig| 4 
 fs/dcache.c   | 2 +-
 fs/namei.c| 2 +-
 7 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 623a272..d5a2e60 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -12,7 +12,6 @@ config ARM
select BUILDTIME_EXTABLE_SORT if MMU
select CLONE_BACKWARDS
select CPU_PM if (SUSPEND || CPU_IDLE)
-   select DCACHE_WORD_ACCESS if HAVE_EFFICIENT_UNALIGNED_ACCESS
select GENERIC_ATOMIC64 if (CPU_V7M || CPU_V6 || !CPU_32v6K || !AEABI)
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
select GENERIC_IDLE_POLL_SETUP
diff --git a/arch/arm/include/asm/word-at-a-time.h 
b/arch/arm/include/asm/word-at-a-time.h
index a6d0a29..778b2ad 100644
--- a/arch/arm/include/asm/word-at-a-time.h
+++ b/arch/arm/include/asm/word-at-a-time.h
@@ -54,7 +54,7 @@ static inline unsigned long find_zero(unsigned long mask)
 #include asm-generic/word-at-a-time.h
 #endif
 
-#ifdef CONFIG_DCACHE_WORD_ACCESS
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
 
 /*
  * Load an unaligned word from kernel space.
@@ -94,5 +94,5 @@ static inline unsigned long load_unaligned_zeropad(const void 
*addr)
return ret;
 }
 
-#endif /* DCACHE_WORD_ACCESS */
+#endif /* HAVE_EFFICIENT_UNALIGNED_ACCESS */
 #endif /* __ASM_ARM_WORD_AT_A_TIME_H */
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 764d682..2d6978c 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -13,7 +13,6 @@ config ARM64
select CLONE_BACKWARDS
select COMMON_CLK
select CPU_PM if (SUSPEND || CPU_IDLE)
-   select DCACHE_WORD_ACCESS
select GENERIC_CLOCKEVENTS
select GENERIC_CLOCKEVENTS_BROADCAST if SMP
select GENERIC_IOMAP
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index abb261e..60cfa073 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -98,7 +98,6 @@ config X86
select CLKEVT_I8253
select ARCH_HAVE_NMI_SAFE_CMPXCHG
select GENERIC_IOMAP
-   select DCACHE_WORD_ACCESS
select GENERIC_SMP_IDLE_THREAD
select ARCH_WANT_IPC_PARSE_VERSION if X86_32
select HAVE_ARCH_SECCOMP_FILTER
diff --git a/fs/Kconfig b/fs/Kconfig
index 312393f..7511271 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -4,10 +4,6 @@
 
 menu File systems
 
-# Use unaligned word dcache accesses
-config DCACHE_WORD_ACCESS
-   bool
-
 if BLOCK
 
 source fs/ext2/Kconfig
diff --git a/fs/dcache.c b/fs/dcache.c
index 265e0ce..4e3c195 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -163,7 +163,7 @@ int proc_nr_dentry(ctl_table *table, int write, void __user 
*buffer,
  * Compare 2 name strings, return 0 if they match, otherwise non-zero.
  * The strings are both count bytes long, and count is non-zero.
  */
-#ifdef CONFIG_DCACHE_WORD_ACCESS
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
 
 #include asm/word-at-a-time.h
 /*
diff --git a/fs/namei.c b/fs/namei.c
index 385f781..1ee33ca 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1618,7 +1618,7 @@ static inline int nested_symlink(struct path *path, 
struct nameidata *nd)
  *   the final mask. Again, that could be replaced with a
  *   efficient population count instruction or similar.
  */
-#ifdef CONFIG_DCACHE_WORD_ACCESS
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
 
 #include asm/word-at-a-time.h
 


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

[PATCH 0/2] sched: Removed unused mc_capable() and smt_capable()

2014-03-04 Thread Bjorn Helgaas
This is just cleanup of a couple unused interfaces and (for sparc64) a
supporting variable.

---

Bjorn Helgaas (2):
  sched: Remove unused mc_capable() and smt_capable()
  sparc64: Remove unused sparc64_multi_core


 arch/arm/include/asm/topology.h  |3 ---
 arch/ia64/include/asm/topology.h |1 -
 arch/mips/include/asm/topology.h |4 
 arch/powerpc/include/asm/topology.h  |1 -
 arch/sparc/include/asm/smp_64.h  |1 -
 arch/sparc/include/asm/topology_64.h |2 --
 arch/sparc/kernel/mdesc.c|4 
 arch/sparc/kernel/prom_64.c  |3 ---
 arch/sparc/kernel/smp_64.c   |2 --
 arch/x86/include/asm/topology.h  |6 --
 10 files changed, 27 deletions(-)
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 1/2] sched: Remove unused mc_capable() and smt_capable()

2014-03-04 Thread Bjorn Helgaas
Remove mc_capable() and smt_capable().  Neither is used.

Both were added by 5c45bf279d37 (sched: mc/smt power savings sched
policy).  Uses of both were removed by 8e7fbcbc22c1 (sched: Remove stale
power aware scheduling remnants and dysfunctional knobs).

Signed-off-by: Bjorn Helgaas bhelg...@google.com
---
 arch/arm/include/asm/topology.h  |3 ---
 arch/ia64/include/asm/topology.h |1 -
 arch/mips/include/asm/topology.h |4 
 arch/powerpc/include/asm/topology.h  |1 -
 arch/sparc/include/asm/topology_64.h |2 --
 arch/x86/include/asm/topology.h  |6 --
 6 files changed, 17 deletions(-)

diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h
index 58b8b84adcd2..2fe85fff5cca 100644
--- a/arch/arm/include/asm/topology.h
+++ b/arch/arm/include/asm/topology.h
@@ -20,9 +20,6 @@ extern struct cputopo_arm cpu_topology[NR_CPUS];
 #define topology_core_cpumask(cpu) (cpu_topology[cpu].core_sibling)
 #define topology_thread_cpumask(cpu)   (cpu_topology[cpu].thread_sibling)
 
-#define mc_capable()   (cpu_topology[0].socket_id != -1)
-#define smt_capable()  (cpu_topology[0].thread_id != -1)
-
 void init_cpu_topology(void);
 void store_cpu_topology(unsigned int cpuid);
 const struct cpumask *cpu_coregroup_mask(int cpu);
diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h
index a2496e449b75..5cb55a1e606b 100644
--- a/arch/ia64/include/asm/topology.h
+++ b/arch/ia64/include/asm/topology.h
@@ -77,7 +77,6 @@ void build_cpu_to_node_map(void);
 #define topology_core_id(cpu)  (cpu_data(cpu)-core_id)
 #define topology_core_cpumask(cpu) (cpu_core_map[cpu])
 #define topology_thread_cpumask(cpu)   (per_cpu(cpu_sibling_map, cpu))
-#define smt_capable()  (smp_num_siblings  1)
 #endif
 
 extern void arch_fix_phys_package_id(int num, u32 slot);
diff --git a/arch/mips/include/asm/topology.h b/arch/mips/include/asm/topology.h
index 12609a17dc8b..20ea4859c822 100644
--- a/arch/mips/include/asm/topology.h
+++ b/arch/mips/include/asm/topology.h
@@ -10,8 +10,4 @@
 
 #include topology.h
 
-#ifdef CONFIG_SMP
-#define smt_capable()  (smp_num_siblings  1)
-#endif
-
 #endif /* __ASM_TOPOLOGY_H */
diff --git a/arch/powerpc/include/asm/topology.h 
b/arch/powerpc/include/asm/topology.h
index d0b5fca6b077..c9202151079f 100644
--- a/arch/powerpc/include/asm/topology.h
+++ b/arch/powerpc/include/asm/topology.h
@@ -99,7 +99,6 @@ static inline int prrn_is_enabled(void)
 
 #ifdef CONFIG_SMP
 #include asm/cputable.h
-#define smt_capable()  (cpu_has_feature(CPU_FTR_SMT))
 
 #ifdef CONFIG_PPC64
 #include asm/smp.h
diff --git a/arch/sparc/include/asm/topology_64.h 
b/arch/sparc/include/asm/topology_64.h
index 1754390a426f..a2d10fc64faf 100644
--- a/arch/sparc/include/asm/topology_64.h
+++ b/arch/sparc/include/asm/topology_64.h
@@ -42,8 +42,6 @@ static inline int pcibus_to_node(struct pci_bus *pbus)
 #define topology_core_id(cpu)  (cpu_data(cpu).core_id)
 #define topology_core_cpumask(cpu) (cpu_core_map[cpu])
 #define topology_thread_cpumask(cpu)   (per_cpu(cpu_sibling_map, cpu))
-#define mc_capable()   (sparc64_multi_core)
-#define smt_capable()  (sparc64_multi_core)
 #endif /* CONFIG_SMP */
 
 extern cpumask_t cpu_core_map[NR_CPUS];
diff --git a/arch/x86/include/asm/topology.h b/arch/x86/include/asm/topology.h
index d35f24e231cd..9bcc724cafdd 100644
--- a/arch/x86/include/asm/topology.h
+++ b/arch/x86/include/asm/topology.h
@@ -133,12 +133,6 @@ static inline void arch_fix_phys_package_id(int num, u32 
slot)
 struct pci_bus;
 void x86_pci_root_bus_resources(int bus, struct list_head *resources);
 
-#ifdef CONFIG_SMP
-#define mc_capable()   ((boot_cpu_data.x86_max_cores  1)  \
-   (cpumask_weight(cpu_core_mask(0)) != nr_cpu_ids))
-#define smt_capable()  (smp_num_siblings  1)
-#endif
-
 #ifdef CONFIG_NUMA
 extern int get_mp_bus_to_node(int busnum);
 extern void set_mp_bus_to_node(int busnum, int node);

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

[PATCH 2/2] sparc64: Remove unused sparc64_multi_core

2014-03-04 Thread Bjorn Helgaas
Remove sparc64_multi_core because it's not used any more.

It was added by a2f9f6bbb30e (Fix {mc,smt}_capable()), and the last uses
were removed by e637d96bf462 (sched: Remove unused mc_capable() and
smt_capable()).

Signed-off-by: Bjorn Helgaas bhelg...@google.com
---
 arch/sparc/include/asm/smp_64.h |1 -
 arch/sparc/kernel/mdesc.c   |4 
 arch/sparc/kernel/prom_64.c |3 ---
 arch/sparc/kernel/smp_64.c  |2 --
 4 files changed, 10 deletions(-)

diff --git a/arch/sparc/include/asm/smp_64.h b/arch/sparc/include/asm/smp_64.h
index dd3bef4b9896..05710393959f 100644
--- a/arch/sparc/include/asm/smp_64.h
+++ b/arch/sparc/include/asm/smp_64.h
@@ -32,7 +32,6 @@
 
 DECLARE_PER_CPU(cpumask_t, cpu_sibling_map);
 extern cpumask_t cpu_core_map[NR_CPUS];
-extern int sparc64_multi_core;
 
 extern void arch_send_call_function_single_ipi(int cpu);
 extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c
index b90bf23e3aab..a1a4400d4025 100644
--- a/arch/sparc/kernel/mdesc.c
+++ b/arch/sparc/kernel/mdesc.c
@@ -896,10 +896,6 @@ void mdesc_fill_in_cpu_data(cpumask_t *mask)
 
mdesc_iterate_over_cpus(fill_in_one_cpu, NULL, mask);
 
-#ifdef CONFIG_SMP
-   sparc64_multi_core = 1;
-#endif
-
hp = mdesc_grab();
 
set_core_ids(hp);
diff --git a/arch/sparc/kernel/prom_64.c b/arch/sparc/kernel/prom_64.c
index 6b39125eb927..9a690d39c01b 100644
--- a/arch/sparc/kernel/prom_64.c
+++ b/arch/sparc/kernel/prom_64.c
@@ -555,9 +555,6 @@ static void *fill_in_one_cpu(struct device_node *dp, int 
cpuid, int arg)
 
cpu_data(cpuid).core_id = portid + 1;
cpu_data(cpuid).proc_id = portid;
-#ifdef CONFIG_SMP
-   sparc64_multi_core = 1;
-#endif
} else {
cpu_data(cpuid).dcache_size =
of_getintprop_default(dp, dcache-size, 16 * 1024);
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index b085311dcd0e..9781048161ab 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -53,8 +53,6 @@
 
 #include cpumap.h
 
-int sparc64_multi_core __read_mostly;
-
 DEFINE_PER_CPU(cpumask_t, cpu_sibling_map) = CPU_MASK_NONE;
 cpumask_t cpu_core_map[NR_CPUS] __read_mostly =
{ [0 ... NR_CPUS-1] = CPU_MASK_NONE };

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

Re: [PATCH 1/2] sched: Remove unused mc_capable() and smt_capable()

2014-03-04 Thread David Miller
From: Bjorn Helgaas bhelg...@google.com
Date: Tue, 04 Mar 2014 14:07:37 -0700

 Remove mc_capable() and smt_capable().  Neither is used.
 
 Both were added by 5c45bf279d37 (sched: mc/smt power savings sched
 policy).  Uses of both were removed by 8e7fbcbc22c1 (sched: Remove stale
 power aware scheduling remnants and dysfunctional knobs).
 
 Signed-off-by: Bjorn Helgaas bhelg...@google.com

Acked-by: David S. Miller da...@davemloft.net
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 2/2] sparc64: Remove unused sparc64_multi_core

2014-03-04 Thread David Miller
From: Bjorn Helgaas bhelg...@google.com
Date: Tue, 04 Mar 2014 14:07:44 -0700

 Remove sparc64_multi_core because it's not used any more.
 
 It was added by a2f9f6bbb30e (Fix {mc,smt}_capable()), and the last uses
 were removed by e637d96bf462 (sched: Remove unused mc_capable() and
 smt_capable()).
 
 Signed-off-by: Bjorn Helgaas bhelg...@google.com

Acked-by: David S. Miller da...@davemloft.net
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 1/2] sched: Remove unused mc_capable() and smt_capable()

2014-03-04 Thread Thomas Gleixner


On Tue, 4 Mar 2014, Bjorn Helgaas wrote:

 Remove mc_capable() and smt_capable().  Neither is used.
 
 Both were added by 5c45bf279d37 (sched: mc/smt power savings sched
 policy).  Uses of both were removed by 8e7fbcbc22c1 (sched: Remove stale
 power aware scheduling remnants and dysfunctional knobs).
 
 Signed-off-by: Bjorn Helgaas bhelg...@google.com
 ---
  arch/arm/include/asm/topology.h  |3 ---
  arch/ia64/include/asm/topology.h |1 -
  arch/mips/include/asm/topology.h |4 
  arch/powerpc/include/asm/topology.h  |1 -
  arch/sparc/include/asm/topology_64.h |2 --
  arch/x86/include/asm/topology.h  |6 --
  6 files changed, 17 deletions(-)

Acked-by: Thomas Gleixner t...@linutronix.de
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[tip:irq/core] powerpc: eeh: Fixup the brown paperbag fallout of the cleanup

2014-03-04 Thread tip-bot for Thomas Gleixner
Commit-ID:  57310c3c99eb6fab2ecbd63aa3f7c323341ca77e
Gitweb: http://git.kernel.org/tip/57310c3c99eb6fab2ecbd63aa3f7c323341ca77e
Author: Thomas Gleixner t...@linutronix.de
AuthorDate: Wed, 5 Mar 2014 00:06:11 +0100
Committer:  Thomas Gleixner t...@linutronix.de
CommitDate: Wed, 5 Mar 2014 00:13:33 +0100

powerpc: eeh: Fixup the brown paperbag fallout of the cleanup

Commit b8a9a11b9 (powerpc: eeh: Kill another abuse of irq_desc) is
missing some brackets .

It's not a good idea to write patches in grumpy mode and then forget
to at least compile test them or rely on the few eyeballs discussing
that patch to spot it.

Reported-by: fengguang...@intel.com
Signed-off-by: Thomas Gleixner t...@linutronix.de
Cc: Peter Zijlstra pet...@infradead.org
Cc: Gavin Shan sha...@linux.vnet.ibm.com
Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
Cc: ppc linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/kernel/eeh_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
index 3e1d7de..bb61ca5 100644
--- a/arch/powerpc/kernel/eeh_driver.c
+++ b/arch/powerpc/kernel/eeh_driver.c
@@ -166,8 +166,9 @@ static void eeh_enable_irq(struct pci_dev *dev)
 *
 *  tglx
 */
-   if (irqd_irq_disabled(irq_get_irq_data(dev-irq))
+   if (irqd_irq_disabled(irq_get_irq_data(dev-irq)))
enable_irq(dev-irq);
+   }
 }
 
 /**
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [tip:irq/core] powerpc: eeh: Fixup the brown paperbag fallout of the cleanup

2014-03-04 Thread Benjamin Herrenschmidt
On Tue, 2014-03-04 at 15:15 -0800, tip-bot for Thomas Gleixner wrote:
 Commit-ID:  57310c3c99eb6fab2ecbd63aa3f7c323341ca77e
 Gitweb: http://git.kernel.org/tip/57310c3c99eb6fab2ecbd63aa3f7c323341ca77e
 Author: Thomas Gleixner t...@linutronix.de
 AuthorDate: Wed, 5 Mar 2014 00:06:11 +0100
 Committer:  Thomas Gleixner t...@linutronix.de
 CommitDate: Wed, 5 Mar 2014 00:13:33 +0100
 
 powerpc: eeh: Fixup the brown paperbag fallout of the cleanup
 
 Commit b8a9a11b9 (powerpc: eeh: Kill another abuse of irq_desc) is
 missing some brackets .
 
 It's not a good idea to write patches in grumpy mode and then forget
 to at least compile test them or rely on the few eyeballs discussing
 that patch to spot it.

Ouch :-)

Next time you have a series like that, if you want I'll throw it at my
build tester.

Cheers,
Ben.

 Reported-by: fengguang...@intel.com
 Signed-off-by: Thomas Gleixner t...@linutronix.de
 Cc: Peter Zijlstra pet...@infradead.org
 Cc: Gavin Shan sha...@linux.vnet.ibm.com
 Cc: Benjamin Herrenschmidt b...@kernel.crashing.org
 Cc: ppc linuxppc-dev@lists.ozlabs.org
 ---
  arch/powerpc/kernel/eeh_driver.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/arch/powerpc/kernel/eeh_driver.c 
 b/arch/powerpc/kernel/eeh_driver.c
 index 3e1d7de..bb61ca5 100644
 --- a/arch/powerpc/kernel/eeh_driver.c
 +++ b/arch/powerpc/kernel/eeh_driver.c
 @@ -166,8 +166,9 @@ static void eeh_enable_irq(struct pci_dev *dev)
*
*  tglx
*/
 - if (irqd_irq_disabled(irq_get_irq_data(dev-irq))
 + if (irqd_irq_disabled(irq_get_irq_data(dev-irq)))
   enable_irq(dev-irq);
 + }
  }
  
  /**


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

Re: [tip:irq/core] powerpc: eeh: Fixup the brown paperbag fallout of the cleanup

2014-03-04 Thread Thomas Gleixner
On Wed, 5 Mar 2014, Benjamin Herrenschmidt wrote:

 On Tue, 2014-03-04 at 15:15 -0800, tip-bot for Thomas Gleixner wrote:
  Commit-ID:  57310c3c99eb6fab2ecbd63aa3f7c323341ca77e
  Gitweb: 
  http://git.kernel.org/tip/57310c3c99eb6fab2ecbd63aa3f7c323341ca77e
  Author: Thomas Gleixner t...@linutronix.de
  AuthorDate: Wed, 5 Mar 2014 00:06:11 +0100
  Committer:  Thomas Gleixner t...@linutronix.de
  CommitDate: Wed, 5 Mar 2014 00:13:33 +0100
  
  powerpc: eeh: Fixup the brown paperbag fallout of the cleanup
  
  Commit b8a9a11b9 (powerpc: eeh: Kill another abuse of irq_desc) is
  missing some brackets .
  
  It's not a good idea to write patches in grumpy mode and then forget
  to at least compile test them or rely on the few eyeballs discussing
  that patch to spot it.
 
 Ouch :-)
 
 Next time you have a series like that, if you want I'll throw it at my
 build tester.

You simply could have been less lazy and picked up the whole ppc
related stuff instead of ignoring it

Thanks,

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

Re: [PATCH v3 03/11] perf: provide a common perf_event_nop_0() for use with .event_idx

2014-03-04 Thread Michael Ellerman
On Mon, 2014-03-03 at 23:01 -0800, Cody P Schafer wrote:
 On 03/03/2014 09:19 PM, Michael Ellerman wrote:
  On Thu, 2014-27-02 at 21:04:56 UTC, Cody P Schafer wrote:
  Rather an having every pmu that needs a function that just returns 0 for
  .event_idx define their own copy, reuse the one in kernel/events/core.c.
 
  Rename from perf_swevent_event_idx() because we're no longer using it
  for just software events. Naming is based on the perf_pmu_nop_*()
  functions.
 
  You could just use perf_pmu_nop_int() directly.
 
 No, .event_idx needs something that takes a (struct perf_event *), 
 perf_pmu_nop_int() takes a (struct pmu *).

Yeah, duh.

cheers


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

Re: [PATCH 2/3] dts: mpc512x: adjust clock specs for FEC nodes

2014-03-04 Thread Shawn Guo
On Mon, Mar 03, 2014 at 10:22:31AM +0100, Gerhard Sittig wrote:
 On Mon, Feb 24, 2014 at 11:25 +0100, Gerhard Sittig wrote:
  
  a recent FEC binding document update that was motivated by i.MX
  development revealed that ARM and PowerPC implementations in Linux
  did not agree on the clock names to use for the FEC nodes
  
  change clock names from per to ipg in the FEC nodes of the
  mpc5121.dtsi include file such that the .dts specs comply with
  the common FEC binding
  
  this incompatible change does not break operation, because
  - COMMON_CLK support for MPC5121/23/25 and adjusted .dts files
were only introduced in Linux v3.14-rc1, no mainline release
provided these specs before
  - if this change won't make it for v3.14, the MPC512x CCF support
provides full backwards compability, and keeps operating with
device trees which lack clock specs or don't match in the names
  
  Signed-off-by: Gerhard Sittig g...@denx.de
 
 ping
 
 Are there opinions about making PowerPC users of FEC use the same
 clock names as ARM users do, to re-use (actually: keep sharing)
 the FEC binding?  The alternative would be to fragment the FEC
 binding into several bindings for ARM and PowerPC, which I feel
 would be undesirable, and is not necessary.

As I already said, Documentation/devicetree/bindings/net/fsl-fec.txt
was created specifically for i.MX FEC controller from day one.  And even
as of today, it doesn't serve PowerPC, because for example the property
'phy-mode' documented as required one is not required by PowerPC FEC.
My opinion would be to patch fsl-fec.txt a little bit to make it clear
that it's a binding doc for i.MX FEC, and create the other one for
PowerPC FEC.  This is the way less confusing to people and easier for
binding maintenance.

Shawn

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

Re: [PATCH v3] powerpc/powernv Platform dump interface

2014-03-04 Thread Stewart Smith
Vasant Hegde hegdevas...@linux.vnet.ibm.com writes:
 +Each dump has the following files:
 +id: An ASCII representation of the dump ID
 +in hex (e.g. '0x01')
 +type:   An ASCII representation of the type of
 +dump in the format 0x%x %s with the ID

 Better 0x%x - %s ?

I thought of that, but figured that a simple space is probably slightly
easier to parse programatically.

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

Re: [PATCH v3] powerpc/powernv Platform dump interface

2014-03-04 Thread Stewart Smith
Vasant Hegde hegdevas...@linux.vnet.ibm.com writes:
 index 000..32fe7f5
 --- /dev/null
 +++ b/Documentation/ABI/stable/sysfs-firmware-opal-dump
 @@ -0,0 +1,41 @@
 +What:   /sys/firmware/opal/dump
 +Date:   Feb 2014
 +Contact:Stewart Smith stew...@linux.vnet.ibm.com
 +Description:
 +This directory exposes interfaces for interacting with
 +the FSP and platform dumps through OPAL firmware interface.
 +
 +This is only for the powerpc/powernv platform.
 +
 +initiate_dump:  When '1' is written to it,
 +we will initiate a dump.

 initiate FSP dump

ack. I can send subsequent patch that fixes up these bits.

 --- /dev/null
 +++ b/arch/powerpc/platforms/powernv/opal-dump.c
 @@ -0,0 +1,525 @@
 +/*
 + * PowerNV OPAL Dump Interface
 + *
 + * Copyright 2013,2014 IBM Corp.
 + *
 + * 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.
 + */
 +
 +#include linux/kobject.h
 +#include linux/mm.h
 +#include linux/slab.h
 +#include linux/vmalloc.h
 +#include linux/pagemap.h
 +#include linux/delay.h
 +
 +#include asm/opal.h
 +
 +#define DUMP_TYPE_FSP   0x01

 Better define other dump type (sysdump etc) here and use it below ?

Likely yes, Is there a definitive list somewhere?

 +static ssize_t init_dump_store(struct dump_obj *dump_obj,
 +   struct dump_attribute *attr,
 +   const char *buf,
 +   size_t count)
 +{
 +dump_fips_init(DUMP_TYPE_FSP);
 +pr_info(%s: Initiated FSP dump\n, __func__);

 This might mislead if OPAL fails to initiate FSP dump.. Better move this to 
 dump_fips_init () ?

good point. I don't think we actually process the response of FSP dump
init, which IIRC may actually be able to tell us if it failed to
initiate a dump.

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

Re: [PATCH] powerpc/powernv: Read OPAL error log and export it through sysfs

2014-03-04 Thread Stewart Smith
Vasant Hegde hegdevas...@linux.vnet.ibm.com writes:
 +int64_t opal_send_ack_elog(uint64_t log_id);

 Stewart,

 Why are you creating 64bit log ID  when actual ID is 32bit ?

IIRC it's what OPAL gives us, even though FSP MBOX spec says 32bit.

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

Re: [PATCH v3] powerpc/powernv Platform dump interface

2014-03-04 Thread Vasant Hegde

On 03/05/2014 07:25 AM, Stewart Smith wrote:

Vasant Hegde hegdevas...@linux.vnet.ibm.com writes:

index 000..32fe7f5
--- /dev/null
+++ b/Documentation/ABI/stable/sysfs-firmware-opal-dump
@@ -0,0 +1,41 @@
+What:  /sys/firmware/opal/dump
+Date:  Feb 2014
+Contact:   Stewart Smith stew...@linux.vnet.ibm.com
+Description:
+   This directory exposes interfaces for interacting with
+   the FSP and platform dumps through OPAL firmware interface.
+
+   This is only for the powerpc/powernv platform.
+
+   initiate_dump:  When '1' is written to it,
+   we will initiate a dump.


initiate FSP dump


ack. I can send subsequent patch that fixes up these bits.


--- /dev/null
+++ b/arch/powerpc/platforms/powernv/opal-dump.c
@@ -0,0 +1,525 @@
+/*
+ * PowerNV OPAL Dump Interface
+ *
+ * Copyright 2013,2014 IBM Corp.
+ *
+ * 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.
+ */
+
+#include linux/kobject.h
+#include linux/mm.h
+#include linux/slab.h
+#include linux/vmalloc.h
+#include linux/pagemap.h
+#include linux/delay.h
+
+#include asm/opal.h
+
+#define DUMP_TYPE_FSP  0x01


Better define other dump type (sysdump etc) here and use it below ?


Likely yes, Is there a definitive list somewhere?


List is depending on what OPAL gives to Linux...For now

#define DUMP_TYPE_FSP   0x01
#define DUMP_TYPE_SYS   0x02
#define DUMP_TYPE_SMA   0x03





+static ssize_t init_dump_store(struct dump_obj *dump_obj,
+  struct dump_attribute *attr,
+  const char *buf,
+  size_t count)
+{
+   dump_fips_init(DUMP_TYPE_FSP);
+   pr_info(%s: Initiated FSP dump\n, __func__);


This might mislead if OPAL fails to initiate FSP dump.. Better move this to
dump_fips_init () ?


good point. I don't think we actually process the response of FSP dump
init, which IIRC may actually be able to tell us if it failed to
initiate a dump.



Yes..

-Vasant

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

Re: [PATCH] powerpc/powernv: Read OPAL error log and export it through sysfs

2014-03-04 Thread Vasant Hegde

On 03/05/2014 07:26 AM, Stewart Smith wrote:

Vasant Hegde hegdevas...@linux.vnet.ibm.com writes:

+int64_t opal_send_ack_elog(uint64_t log_id);


Stewart,

Why are you creating 64bit log ID  when actual ID is 32bit ?


IIRC it's what OPAL gives us, even though FSP MBOX spec says 32bit.



Stewart,

Better ask OPAL folks to fix in firmware ?

-Vasant

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

Re: [PATCH] powerpc/powernv: Read OPAL error log and export it through sysfs

2014-03-04 Thread Vasant Hegde

On 03/05/2014 07:26 AM, Stewart Smith wrote:

Vasant Hegde hegdevas...@linux.vnet.ibm.com writes:

+int64_t opal_send_ack_elog(uint64_t log_id);


Stewart,

Why are you creating 64bit log ID  when actual ID is 32bit ?


IIRC it's what OPAL gives us, even though FSP MBOX spec says 32bit.



Stewart,

Better ask OPAL folks to fix in firmware ?

-Vasant

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

ibmveth: Fix endian issues with MAC addresses

2014-03-04 Thread Anton Blanchard

The code to load a MAC address into a u64 for passing to the
hypervisor via a register is broken on little endian.

Create a helper function called ibmveth_encode_mac_addr
which does the right thing in both big and little endian.

We were storing the MAC address in a long in struct ibmveth_adapter.
It's never used so remove it - we don't need another place in the
driver where we create endian issues with MAC addresses.

Signed-off-by: Anton Blanchard an...@samba.org
Cc: sta...@vger.kernel.org
---

Index: b/drivers/net/ethernet/ibm/ibmveth.c
===
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -522,10 +522,21 @@ retry:
return rc;
 }
 
+static u64 ibmveth_encode_mac_addr(u8 *mac)
+{
+   int i;
+   u64 encoded = 0;
+
+   for (i = 0; i  ETH_ALEN; i++)
+   encoded = (encoded  8) | mac[i];
+
+   return encoded;
+}
+
 static int ibmveth_open(struct net_device *netdev)
 {
struct ibmveth_adapter *adapter = netdev_priv(netdev);
-   u64 mac_address = 0;
+   u64 mac_address;
int rxq_entries = 1;
unsigned long lpar_rc;
int rc;
@@ -579,8 +590,7 @@ static int ibmveth_open(struct net_devic
adapter-rx_queue.num_slots = rxq_entries;
adapter-rx_queue.toggle = 1;
 
-   memcpy(mac_address, netdev-dev_addr, netdev-addr_len);
-   mac_address = mac_address  16;
+   mac_address = ibmveth_encode_mac_addr(netdev-dev_addr);
 
rxq_desc.fields.flags_len = IBMVETH_BUF_VALID |
adapter-rx_queue.queue_len;
@@ -1183,8 +1193,8 @@ static void ibmveth_set_multicast_list(s
/* add the addresses to the filter table */
netdev_for_each_mc_addr(ha, netdev) {
/* add the multicast address to the filter table */
-   unsigned long mcast_addr = 0;
-   memcpy(((char *)mcast_addr)+2, ha-addr, ETH_ALEN);
+   u64 mcast_addr;
+   mcast_addr = ibmveth_encode_mac_addr(ha-addr);
lpar_rc = h_multicast_ctrl(adapter-vdev-unit_address,
   IbmVethMcastAddFilter,
   mcast_addr);
@@ -1372,9 +1382,6 @@ static int ibmveth_probe(struct vio_dev
 
netif_napi_add(netdev, adapter-napi, ibmveth_poll, 16);
 
-   adapter-mac_addr = 0;
-   memcpy(adapter-mac_addr, mac_addr_p, ETH_ALEN);
-
netdev-irq = dev-irq;
netdev-netdev_ops = ibmveth_netdev_ops;
netdev-ethtool_ops = netdev_ethtool_ops;
@@ -1383,7 +1390,7 @@ static int ibmveth_probe(struct vio_dev
NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
netdev-features |= netdev-hw_features;
 
-   memcpy(netdev-dev_addr, adapter-mac_addr, netdev-addr_len);
+   memcpy(netdev-dev_addr, mac_addr_p, ETH_ALEN);
 
for (i = 0; i  IBMVETH_NUM_BUFF_POOLS; i++) {
struct kobject *kobj = adapter-rx_buff_pool[i].kobj;
Index: b/drivers/net/ethernet/ibm/ibmveth.h
===
--- a/drivers/net/ethernet/ibm/ibmveth.h
+++ b/drivers/net/ethernet/ibm/ibmveth.h
@@ -138,7 +138,6 @@ struct ibmveth_adapter {
 struct napi_struct napi;
 struct net_device_stats stats;
 unsigned int mcastFilterSize;
-unsigned long mac_addr;
 void * buffer_list_addr;
 void * filter_list_addr;
 dma_addr_t buffer_list_dma;
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] powerpc/powernv: Read OPAL error log and export it through sysfs

2014-03-04 Thread Benjamin Herrenschmidt
On Wed, 2014-03-05 at 08:56 +0530, Vasant Hegde wrote:
 On 03/05/2014 07:26 AM, Stewart Smith wrote:
  Vasant Hegde hegdevas...@linux.vnet.ibm.com writes:
  +int64_t opal_send_ack_elog(uint64_t log_id);
 
  Stewart,
 
  Why are you creating 64bit log ID  when actual ID is 32bit ?
 
  IIRC it's what OPAL gives us, even though FSP MBOX spec says 32bit.
 
 
 Stewart,
 
 Better ask OPAL folks to fix in firmware ?

Why bother ? That way if future versions of OPAL want to use 64-bit IDs,
they can.

Cheers,
Ben.


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

Re: [PATCH] powerpc/powernv: Read OPAL error log and export it through sysfs

2014-03-04 Thread Stewart Smith
Benjamin Herrenschmidt b...@kernel.crashing.org writes:
 On Wed, 2014-03-05 at 08:56 +0530, Vasant Hegde wrote:
 On 03/05/2014 07:26 AM, Stewart Smith wrote:
  Vasant Hegde hegdevas...@linux.vnet.ibm.com writes:
  +int64_t opal_send_ack_elog(uint64_t log_id);
 
  Stewart,
 
  Why are you creating 64bit log ID  when actual ID is 32bit ?
 
  IIRC it's what OPAL gives us, even though FSP MBOX spec says 32bit.
 
 
 Stewart,
 
 Better ask OPAL folks to fix in firmware ?

 Why bother ? That way if future versions of OPAL want to use 64-bit IDs,
 they can.

Yeah, that was my thought. The number of error logs on some POWER8
systems almost needs 64bit already :)

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

Re: [PATCH 1/2] sched: Remove unused mc_capable() and smt_capable()

2014-03-04 Thread Benjamin Herrenschmidt
On Tue, 2014-03-04 at 14:07 -0700, Bjorn Helgaas wrote:
 Remove mc_capable() and smt_capable().  Neither is used.
 
 Both were added by 5c45bf279d37 (sched: mc/smt power savings sched
 policy).  Uses of both were removed by 8e7fbcbc22c1 (sched: Remove stale
 power aware scheduling remnants and dysfunctional knobs).
 
 Signed-off-by: Bjorn Helgaas bhelg...@google.com

Acked-by: Benjamin Herrenschmidt b...@kernel.crashing.org


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

[PATCh v2 1/2] QE: split function mpc85xx_qe_init() into two functions.

2014-03-04 Thread Zhao Qiang
New QE doesn't have par_io, it doesn't need to init par_io
for new QE.
Split function mpc85xx_qe_init() into mpc85xx_qe_init()
and mpc85xx_qe_par_io_init().
Call mpc85xx_qe_init() for both new and old while
mpc85xx_qe_par_io_init() after mpc85xx_qe_init() for old.

Signed-off-by: Zhao Qiang b45...@freescale.com
---
Changes for v2:
-no

 arch/powerpc/platforms/85xx/common.c  | 6 ++
 arch/powerpc/platforms/85xx/mpc85xx.h | 2 ++
 arch/powerpc/platforms/85xx/mpc85xx_mds.c | 1 +
 arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 1 +
 arch/powerpc/platforms/85xx/twr_p102x.c   | 1 +
 5 files changed, 11 insertions(+)

diff --git a/arch/powerpc/platforms/85xx/common.c 
b/arch/powerpc/platforms/85xx/common.c
index 3b085c7..b564b5e 100644
--- a/arch/powerpc/platforms/85xx/common.c
+++ b/arch/powerpc/platforms/85xx/common.c
@@ -107,6 +107,12 @@ void __init mpc85xx_qe_init(void)
qe_reset();
of_node_put(np);
 
+}
+
+void __init mpc85xx_qe_par_io_init(void)
+{
+   struct device_node *np;
+
np = of_find_node_by_name(NULL, par_io);
if (np) {
struct device_node *ucc;
diff --git a/arch/powerpc/platforms/85xx/mpc85xx.h 
b/arch/powerpc/platforms/85xx/mpc85xx.h
index fc51dd4..39056f6 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx.h
+++ b/arch/powerpc/platforms/85xx/mpc85xx.h
@@ -10,8 +10,10 @@ static inline void __init mpc85xx_cpm2_pic_init(void) {}
 
 #ifdef CONFIG_QUICC_ENGINE
 extern void mpc85xx_qe_init(void);
+extern void mpc85xx_qe_par_io_init(void);
 #else
 static inline void __init mpc85xx_qe_init(void) {}
+static inline void __init mpc85xx_qe_par_io_init(void) {}
 #endif
 
 #endif
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_mds.c 
b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
index 34f3c5e..3c190b4 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_mds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_mds.c
@@ -239,6 +239,7 @@ static void __init mpc85xx_mds_qe_init(void)
struct device_node *np;
 
mpc85xx_qe_init();
+   mpc85xx_qe_par_io_init();
mpc85xx_mds_reset_ucc_phys();
 
if (machine_is(p1021_mds)) {
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c 
b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index e15bdd1..f9668ed 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -99,6 +99,7 @@ static void __init mpc85xx_rdb_setup_arch(void)
 
 #ifdef CONFIG_QUICC_ENGINE
mpc85xx_qe_init();
+   mpc85xx_qe_par_io_init();
 #if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE)
if (machine_is(p1025_rdb)) {
 
diff --git a/arch/powerpc/platforms/85xx/twr_p102x.c 
b/arch/powerpc/platforms/85xx/twr_p102x.c
index c25ff10..1eadb6d 100644
--- a/arch/powerpc/platforms/85xx/twr_p102x.c
+++ b/arch/powerpc/platforms/85xx/twr_p102x.c
@@ -77,6 +77,7 @@ static void __init twr_p1025_setup_arch(void)
 
 #ifdef CONFIG_QUICC_ENGINE
mpc85xx_qe_init();
+   mpc85xx_qe_par_io_init();
 
 #if defined(CONFIG_UCC_GETH) || defined(CONFIG_SERIAL_QE)
if (machine_is(twr_p1025)) {
-- 
1.8.5


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

[PATCh v2 2/2] Corenet: Add QE platform support for Corenet

2014-03-04 Thread Zhao Qiang
There is QE on platform T104x, add support.
Call funcs qe_ic_init and qe_init if CONFIG_QUICC_ENGINE is defined.

Signed-off-by: Zhao Qiang b45...@freescale.com
---
Changes for v2:
- use mpc85xx_qe_init() instead
 arch/powerpc/platforms/85xx/corenet_generic.c | 25 +
 1 file changed, 25 insertions(+)

diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index fbd871e..f1f4575 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -26,11 +26,14 @@
 #include asm/udbg.h
 #include asm/mpic.h
 #include asm/ehv_pic.h
+#include asm/qe.h
+#include asm/qe_ic.h
 
 #include linux/of_platform.h
 #include sysdev/fsl_soc.h
 #include sysdev/fsl_pci.h
 #include smp.h
+#include mpc85xx.h
 
 void __init corenet_gen_pic_init(void)
 {
@@ -38,6 +41,10 @@ void __init corenet_gen_pic_init(void)
unsigned int flags = MPIC_BIG_ENDIAN | MPIC_SINGLE_DEST_CPU |
MPIC_NO_RESET;
 
+#ifdef CONFIG_QUICC_ENGINE
+   struct device_node *np;
+#endif
+
if (ppc_md.get_irq == mpic_get_coreint_irq)
flags |= MPIC_ENABLE_COREINT;
 
@@ -45,6 +52,16 @@ void __init corenet_gen_pic_init(void)
BUG_ON(mpic == NULL);
 
mpic_init(mpic);
+
+#ifdef CONFIG_QUICC_ENGINE
+   np = of_find_compatible_node(NULL, NULL, fsl,qe-ic);
+   if (np) {
+   qe_ic_init(np, 0, qe_ic_cascade_low_mpic,
+   qe_ic_cascade_high_mpic);
+   of_node_put(np);
+   }
+#endif
+
 }
 
 /*
@@ -57,6 +74,11 @@ void __init corenet_gen_setup_arch(void)
swiotlb_detect_4g();
 
pr_info(%s board from Freescale Semiconductor\n, ppc_md.name);
+
+#ifdef CONFIG_QUICC_ENGINE
+   mpc85xx_qe_init();
+#endif
+
 }
 
 static const struct of_device_id of_device_ids[] = {
@@ -81,6 +103,9 @@ static const struct of_device_id of_device_ids[] = {
{
.compatible = fsl,qoriq-pcie-v3.0,
},
+   {
+   .compatible = fsl,qe,
+   },
/* The following two are for the Freescale hypervisor */
{
.name   = hypervisor,
-- 
1.8.5


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