[PATCH v6 2/2] powerpc/mpc85xx: Add FSL QorIQ DPAA QMan support to device tree(s)

2015-02-01 Thread Emil Medve
From: Kumar Gala 

Change-Id: If643fa5ba0a903aef8f5056a2c90ebecc995b760
Signed-off-by: Kumar Gala 
Signed-off-by: Geoff Thorpe 
Signed-off-by: Hai-Ying Wang 
Signed-off-by: Chunhe Lan 
Signed-off-by: Poonam Aggrwal 
[Emil Medve: Sync with the upstream binding]
Signed-off-by: Emil Medve 
---

v6: Rebased

 arch/powerpc/boot/dts/b4qds.dtsi|  12 ++
 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi |  69 ++
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi| 106 ++
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi |  43 
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi |  13 ++
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi |  78 +++
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 126 +++
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 318 
 arch/powerpc/boot/dts/kmcoge4.dts   |  12 ++
 arch/powerpc/boot/dts/oca4080.dts   |  12 ++
 arch/powerpc/boot/dts/p1023rdb.dts  |  12 ++
 arch/powerpc/boot/dts/p2041rdb.dts  |  12 ++
 arch/powerpc/boot/dts/p3041ds.dts   |  12 ++
 arch/powerpc/boot/dts/p4080ds.dts   |  12 ++
 arch/powerpc/boot/dts/p5020ds.dts   |  12 ++
 arch/powerpc/boot/dts/p5040ds.dts   |  12 ++
 arch/powerpc/boot/dts/t104xqds.dtsi |  12 ++
 arch/powerpc/boot/dts/t104xrdb.dtsi |  12 ++
 arch/powerpc/boot/dts/t208xqds.dtsi |  12 ++
 arch/powerpc/boot/dts/t208xrdb.dtsi |  12 ++
 arch/powerpc/boot/dts/t4240qds.dts  |  12 ++
 arch/powerpc/boot/dts/t4240rdb.dts  |  12 ++
 26 files changed, 985 insertions(+)

diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
index 24ed80d..559d006 100644
--- a/arch/powerpc/boot/dts/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/b4qds.dtsi
@@ -106,6 +106,14 @@
size = <0 0x100>;
alignment = <0 0x100>;
};
+   qman_fqd: qman-fqd {
+   size = <0 0x40>;
+   alignment = <0 0x40>;
+   };
+   qman_pfdr: qman-pfdr {
+   size = <0 0x200>;
+   alignment = <0 0x200>;
+   };
};
 
dcsr: dcsr@f {
@@ -116,6 +124,10 @@
ranges = <0x0 0xf 0xf400 0x200>;
};
 
+   qportals: qman-portals@ff600 {
+   ranges = <0x0 0xf 0xf600 0x200>;
+   };
+
soc: soc@ffe00 {
ranges = <0x 0xf 0xfe00 0x100>;
reg = <0xf 0xfe00 0 0x1000>;
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index 68b9a05..02ccde6 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -167,6 +167,75 @@
};
 };
 
+&qportals {
+   qportal14: qman-portal@38000 {
+   compatible = "fsl,qman-portal";
+   reg = <0x38000 0x4000>, <0x100e000 0x1000>;
+   interrupts = <132 0x2 0 0>;
+   fsl,qman-channel-id = <0xe>;
+   };
+   qportal15: qman-portal@3c000 {
+   compatible = "fsl,qman-portal";
+   reg = <0x3c000 0x4000>, <0x100f000 0x1000>;
+   interrupts = <134 0x2 0 0>;
+   fsl,qman-channel-id = <0xf>;
+   };
+   qportal16: qman-portal@4 {
+   compatible = "fsl,qman-portal";
+   reg = <0x4 0x4000>, <0x101 0x1000>;
+   interrupts = <136 0x2 0 0>;
+   fsl,qman-channel-id = <0x10>;
+   };
+   qportal17: qman-portal@44000 {
+   compatible = "fsl,qman-portal";
+   reg = <0x44000 0x4000>, <0x1011000 0x1000>;
+   interrupts = <138 0x2 0 0>;
+   fsl,qman-channel-id = <0x11>;
+   };
+   qportal18: qman-portal@48000 {
+   compatible = "fsl,qman-portal";
+   reg = <0x48000 0x4000>, <0x1012000 0x1000>;
+   interrupts = <140 0x2 0 0>;
+   fsl,qman-channel-id = <0x12>;
+   };
+   qportal19: qman-portal@4c000 {
+   compatible = "fsl,qman-portal";
+   reg = <0x4c000 0x4000>, <0x1013000 0x1000>;
+   interrupts = <142 0x2 0 0>;
+   fsl,qman-channel-id = <0x13>;
+   };
+   qportal20: qman-portal@5 {
+   compatible = "fsl,qman-portal";
+   reg = <0x5 0x4000>, <0x1014000 0x1000>;
+   interrupts = <144 0x2 0 0>;
+   fsl,qman-channel-id = <0x14>;
+   };
+   qportal21: qman-portal@54000 {
+   compatible = "fsl,qman-portal";
+   reg = <0x54000 0x4000>, <0x1015000 0x1000>;
+

[PATCH v6 1/2] powerpc/mpc85xx: Add FSL QorIQ DPAA BMan support to device tree(s)

2015-02-01 Thread Emil Medve
From: Kumar Gala 

Change-Id: If643fa5ba0a903aef8f5056a2c90ebecc995b760
Signed-off-by: Kumar Gala 
Signed-off-by: Geoff Thorpe 
Signed-off-by: Hai-Ying Wang 
Signed-off-by: Chunhe Lan 
Signed-off-by: Poonam Aggrwal 
[Emil Medve: Sync with the upstream binding]
Signed-off-by: Emil Medve 
---

v6: Rebased

 arch/powerpc/boot/dts/b4qds.dtsi|  17 +-
 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi |  60 ++-
 arch/powerpc/boot/dts/fsl/b4si-post.dtsi|  89 +-
 arch/powerpc/boot/dts/fsl/p1023si-post.dtsi |  37 +++-
 arch/powerpc/boot/dts/fsl/p2041si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p3041si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p4080si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p5020si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/p5040si-post.dtsi |  11 +-
 arch/powerpc/boot/dts/fsl/t1040si-post.dtsi |  65 ++-
 arch/powerpc/boot/dts/fsl/t2081si-post.dtsi | 105 ++-
 arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 265 +++-
 arch/powerpc/boot/dts/kmcoge4.dts   |  15 ++
 arch/powerpc/boot/dts/oca4080.dts   |  15 ++
 arch/powerpc/boot/dts/p1023rdb.dts  |  18 +-
 arch/powerpc/boot/dts/p2041rdb.dts  |  17 +-
 arch/powerpc/boot/dts/p3041ds.dts   |  17 +-
 arch/powerpc/boot/dts/p4080ds.dts   |  17 +-
 arch/powerpc/boot/dts/p5020ds.dts   |  17 +-
 arch/powerpc/boot/dts/p5040ds.dts   |  17 +-
 arch/powerpc/boot/dts/t104xqds.dtsi |  17 +-
 arch/powerpc/boot/dts/t104xrdb.dtsi |  14 ++
 arch/powerpc/boot/dts/t208xqds.dtsi |  17 +-
 arch/powerpc/boot/dts/t208xrdb.dtsi |  15 ++
 arch/powerpc/boot/dts/t4240qds.dts  |  17 +-
 arch/powerpc/boot/dts/t4240rdb.dts  |  15 ++
 26 files changed, 899 insertions(+), 22 deletions(-)

diff --git a/arch/powerpc/boot/dts/b4qds.dtsi b/arch/powerpc/boot/dts/b4qds.dtsi
index e5bde0b..24ed80d 100644
--- a/arch/powerpc/boot/dts/b4qds.dtsi
+++ b/arch/powerpc/boot/dts/b4qds.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4420DS Device Tree Source
  *
- * Copyright 2012 Freescale Semiconductor, Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor, Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -97,10 +97,25 @@
device_type = "memory";
};
 
+   reserved-memory {
+   #address-cells = <2>;
+   #size-cells = <2>;
+   ranges;
+
+   bman_fbpr: bman-fbpr {
+   size = <0 0x100>;
+   alignment = <0 0x100>;
+   };
+   };
+
dcsr: dcsr@f {
ranges = <0x 0xf 0x 0x01052000>;
};
 
+   bportals: bman-portals@ff400 {
+   ranges = <0x0 0xf 0xf400 0x200>;
+   };
+
soc: soc@ffe00 {
ranges = <0x 0xf 0xfe00 0x100>;
reg = <0xf 0xfe00 0 0x1000>;
diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi 
b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
index d0a5cde..68b9a05 100644
--- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi
@@ -1,7 +1,7 @@
 /*
  * B4860 Silicon/SoC Device Tree Source (post include)
  *
- * Copyright 2012 Freescale Semiconductor Inc.
+ * Copyright 2012 - 2014 Freescale Semiconductor Inc.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -109,6 +109,64 @@
};
 };
 
+&bportals {
+   bman-portal@38000 {
+   compatible = "fsl,bman-portal";
+   reg = <0x38000 0x4000>, <0x100e000 0x1000>;
+   interrupts = <133 2 0 0>;
+   };
+   bman-portal@3c000 {
+   compatible = "fsl,bman-portal";
+   reg = <0x3c000 0x4000>, <0x100f000 0x1000>;
+   interrupts = <135 2 0 0>;
+   };
+   bman-portal@4 {
+   compatible = "fsl,bman-portal";
+   reg = <0x4 0x4000>, <0x101 0x1000>;
+   interrupts = <137 2 0 0>;
+   };
+   bman-portal@44000 {
+   compatible = "fsl,bman-portal";
+   reg = <0x44000 0x4000>, <0x1011000 0x1000>;
+   interrupts = <139 2 0 0>;
+   };
+   bman-portal@48000 {
+   compatible = "fsl,bman-portal";
+   reg = <0x48000 0x4000>, <0x1012000 0x1000>;
+   interrupts = <141 2 0 0>;
+   };
+   bman-portal@4c000 {
+   compatible = "fsl,bman-portal";
+   reg = <0x4c000 0x4000>, <0x1013000 0x1000>;
+   interrupts = <143 2 0 0>;
+   };
+   bman-portal@5 {
+   compatible = "fsl,bman-portal";
+   reg = <0x5 0x4000>, <0x1014000 0x1000>;
+   interrupts = <145 2 0 0>;
+ 

Re: [PATCH V3] cpuidle/powernv: Read target_residency value of idle states from DT if available

2015-02-01 Thread Michael Ellerman
On Mon, 2015-02-02 at 10:40 +0530, Preeti U Murthy wrote:
> The device tree now exposes the residency values for different idle states. 
> Read
> these values instead of calculating residency from the latency values. The 
> values
> exposed in the DT are validated for optimal power efficiency. However to 
> maintain
> compatibility with the older firmware code which does not expose residency
> values, use default values as a fallback mechanism. While at it, use better
> APIs to parse the powermgmt device tree node so as to avoid endianness
> transformation.
> 
> Signed-off-by: Preeti U Murthy 
> ---
> Changes from V2: https://lkml.org/lkml/2015/1/27/1054
> 1. Used APIs to eliminate endianness transformation

Hi Preeti,

I thought I was pretty clear when I said you should do that as a follow-up
patch.

This is now doing too many things, it's not a single logical change, and it's
touching code in arch/powerpc and the driver. Which means neither I nor Rafael
can easily merge it.  

So please go back to the v2 you had. And then do the 
of_property_count_u32_elems()
changes as separate patches.

cheers


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

Re: [PATCH V3] cpuidle/powernv: Read target_residency value of idle states from DT if available

2015-02-01 Thread Stewart Smith
Preeti U Murthy  writes:
> The device tree now exposes the residency values for different idle states. 
> Read
> these values instead of calculating residency from the latency values. The 
> values
> exposed in the DT are validated for optimal power efficiency. However to 
> maintain
> compatibility with the older firmware code which does not expose residency
> values, use default values as a fallback mechanism. While at it, use better
> APIs to parse the powermgmt device tree node so as to avoid endianness
> transformation.
>
> Signed-off-by: Preeti U Murthy 

Same acked-by as before, from perspective of "I merged the firmware side
of things" and things look godo in relation to firmware PoV.

Acked-by: Stewart Smith 

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

[PATCH] powerpc/mm: warn on flushing tlb page in kernel context

2015-02-01 Thread Arseny Solokha
Function __flush_tlb_page() must only be called for user contexts, so
put in extra hardening to warn on calling it for kernel context.

Signed-off-by: Arseny Solokha 
---
 arch/powerpc/mm/tlb_nohash.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
index f38ea4d..cbd3d06 100644
--- a/arch/powerpc/mm/tlb_nohash.c
+++ b/arch/powerpc/mm/tlb_nohash.c
@@ -284,8 +284,15 @@ void __flush_tlb_page(struct mm_struct *mm, unsigned long 
vmaddr,
struct cpumask *cpu_mask;
unsigned int pid;
 
+   /*
+* This function as well as __local_flush_tlb_page() must only be called
+* for user contexts.
+*/
+   if (unlikely(WARN_ON(!mm)))
+   return;
+
preempt_disable();
-   pid = mm ? mm->context.id : 0;
+   pid = mm->context.id;
if (unlikely(pid == MMU_NO_CONTEXT))
goto bail;
cpu_mask = mm_cpumask(mm);
-- 
2.2.2

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

[PATCH V3] cpuidle/powernv: Read target_residency value of idle states from DT if available

2015-02-01 Thread Preeti U Murthy
The device tree now exposes the residency values for different idle states. Read
these values instead of calculating residency from the latency values. The 
values
exposed in the DT are validated for optimal power efficiency. However to 
maintain
compatibility with the older firmware code which does not expose residency
values, use default values as a fallback mechanism. While at it, use better
APIs to parse the powermgmt device tree node so as to avoid endianness
transformation.

Signed-off-by: Preeti U Murthy 
---
Changes from V2: https://lkml.org/lkml/2015/1/27/1054
1. Used APIs to eliminate endianness transformation

Changes from V1: https://lkml.org/lkml/2015/1/19/221
1. Used a better API for reading the DT property values.
2. Code cleanups

 arch/powerpc/platforms/powernv/setup.c |   37 --
 drivers/cpuidle/cpuidle-powernv.c  |   86 ++--
 2 files changed, 71 insertions(+), 52 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/setup.c 
b/arch/powerpc/platforms/powernv/setup.c
index b700a32..d6a9329 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -409,37 +410,40 @@ static int __init pnv_init_idle_states(void)
 {
struct device_node *power_mgt;
int dt_idle_states;
-   const __be32 *idle_state_flags;
-   u32 len_flags, flags;
+   u32 *flags;
int i;
 
supported_cpuidle_states = 0;
 
if (cpuidle_disable != IDLE_NO_OVERRIDE)
-   return 0;
+   goto out;
 
if (!firmware_has_feature(FW_FEATURE_OPALv3))
-   return 0;
+   goto out;
 
power_mgt = of_find_node_by_path("/ibm,opal/power-mgt");
if (!power_mgt) {
pr_warn("opal: PowerMgmt Node not found\n");
-   return 0;
+   goto out;
}
 
-   idle_state_flags = of_get_property(power_mgt,
-   "ibm,cpu-idle-state-flags", &len_flags);
-   if (!idle_state_flags) {
-   pr_warn("DT-PowerMgmt: missing ibm,cpu-idle-state-flags\n");
-   return 0;
+   dt_idle_states = of_property_count_u32_elems(power_mgt,
+   "ibm,cpu-idle-state-flags");
+   if (dt_idle_states < 0) {
+   pr_warn("cpuidle-powernv: no idle states found in the DT\n");
+   goto out;
}
 
-   dt_idle_states = len_flags / sizeof(u32);
-
-   for (i = 0; i < dt_idle_states; i++) {
-   flags = be32_to_cpu(idle_state_flags[i]);
-   supported_cpuidle_states |= flags;
+   flags = kzalloc(sizeof(*flags) * dt_idle_states, GFP_KERNEL);
+   if (of_property_read_u32_array(power_mgt,
+   "ibm,cpu-idle-state-flags", flags, dt_idle_states)) {
+   pr_warn("cpuidle-powernv: missing ibm,cpu-idle-state-flags in 
DT\n");
+   goto out_free;
}
+
+   for (i = 0; i < dt_idle_states; i++)
+   supported_cpuidle_states |= flags[i];
+
if (!(supported_cpuidle_states & OPAL_PM_SLEEP_ENABLED_ER1)) {
patch_instruction(
(unsigned int *)pnv_fastsleep_workaround_at_entry,
@@ -449,6 +453,9 @@ static int __init pnv_init_idle_states(void)
PPC_INST_NOP);
}
pnv_alloc_idle_core_states();
+out_free:
+   kfree(flags);
+out:
return 0;
 }
 
diff --git a/drivers/cpuidle/cpuidle-powernv.c 
b/drivers/cpuidle/cpuidle-powernv.c
index 223d505..2ef4b70 100644
--- a/drivers/cpuidle/cpuidle-powernv.c
+++ b/drivers/cpuidle/cpuidle-powernv.c
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -160,70 +161,81 @@ static int powernv_add_idle_states(void)
struct device_node *power_mgt;
int nr_idle_states = 1; /* Snooze */
int dt_idle_states;
-   const __be32 *idle_state_flags;
-const __be32 *idle_state_latency;
-u32 len_flags, flags, latency_ns;
-   int i;
+   u32 *latency_ns, *residency_ns, *flags;
+   int i, rc;
 
/* Currently we have snooze statically defined */
-
power_mgt = of_find_node_by_path("/ibm,opal/power-mgt");
if (!power_mgt) {
pr_warn("opal: PowerMgmt Node not found\n");
-   return nr_idle_states;
+   goto out;
}
 
-   idle_state_flags = of_get_property(power_mgt, 
"ibm,cpu-idle-state-flags", &len_flags);
-   if (!idle_state_flags) {
-   pr_warn("DT-PowerMgmt: missing ibm,cpu-idle-state-flags\n");
-   return nr_idle_states;
+   /* Read values of any property to determine the num of idle states */
+   dt_idle_states = of_property_count_u32_elems(power_mgt,
+   "ibm,cpu-idle-state-flags");
+   if (dt_idle_states < 0) {
+   pr_warn("cpuid

Re: [PATCH] powerpc/mm: bail out early when flushing TLB page

2015-02-01 Thread Arseny Solokha
> On Fri, 2015-01-30 at 19:08 +0700, Arseny Solokha wrote:
>> MMU_NO_CONTEXT is conditionally defined as 0 or (unsigned int)-1. However,
>> in __flush_tlb_page() a corresponding variable is only tested for open
>> coded 0, which can cause NULL pointer dereference if `mm' argument was
>> legitimately passed as such.
>>
>> Bail out early in case the first argument is NULL, thus eliminate confusion
>> between different values of MMU_NO_CONTEXT and avoid disabling and then
>> re-enabling preemption unnecessarily.
> 
> So the comment above isn't quite right... we don't *test* it for open
> coded 0, we test it for MMU_NO_CONTEXT, however we *set* it to 0 for
> NULL mm.
> 
> This is actually correct... on all except 8xx :-) 0 *is* the PID of the
> kernel context, and NULL mm usually means kernel context.

> However, it's correct that this function will not deal properly with a
> NULL mm for other reasons. It must only be called for user contexts.
> 
> Instead of just returning, I would WARN_ON, because if it's ever called
> for a kernel page, then it will not do what's expected and that will
> need fixing. Just a silent return isn't right.

Does this also hold true for __local_flush_tlb_page()? It's called from
local_flush_tlb_page() as follows:

  __local_flush_tlb_page(vma ? vma->vm_mm : NULL, vmaddr,
 mmu_get_tsize(mmu_virtual_psize), 0);

However, if MMU_NO_CONTEXT is 0 and __local_flush_tlb_page() is called with mm
set to NULL, it's effectively a no-op. What else am I missing?

Thanks,

Arsény


> This is different from returning on MMU_NO_CONTEXT, in this case, we
> know there's no active TLB entries for the process, and thus nothing to
> flush.
> 
> Cheers,
> Ben.
> 
>> Signed-off-by: Arseny Solokha 
>> ---
>>  arch/powerpc/mm/tlb_nohash.c | 5 -
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/mm/tlb_nohash.c b/arch/powerpc/mm/tlb_nohash.c
>> index f38ea4d..ab0616b 100644
>> --- a/arch/powerpc/mm/tlb_nohash.c
>> +++ b/arch/powerpc/mm/tlb_nohash.c
>> @@ -284,8 +284,11 @@ void __flush_tlb_page(struct mm_struct *mm, unsigned 
>> long vmaddr,
>>  struct cpumask *cpu_mask;
>>  unsigned int pid;
>>  
>> +if (unlikely(!mm))
>> +return;
>> +
>>  preempt_disable();
>> -pid = mm ? mm->context.id : 0
> 
> Here we test mm, if we pass NULL, that means the kernel mm which has PID
> 0, which is not MMU_NO_CONTEXT
>> ;
>> +pid = mm->context.id;
>>  if (unlikely(pid == MMU_NO_CONTEXT))
>>  goto bail;
>>  cpu_mask = mm_cpumask(mm);
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 00/15] powerpc: kill PPC_OF

2015-02-01 Thread Kevin Hao
On Mon, Feb 02, 2015 at 01:25:37PM +1100, Michael Ellerman wrote:
> On Sat, 2015-01-31 at 21:47 +0800, Kevin Hao wrote:
> > Hi,
> > 
> > This patch series tries to kill the PPC_OF.
> 
> So on the whole this series looks good.
> 
> Getting it merged is going to be a bit of a pain though. I assume most of them
> depend on patch 1, in which case they really need to go in as one series.

Agreed.

> 
> So you'll just have to collect acks from all the driver/subsystem maintainers,

Will do.

> and then we can take it all through the powerpc tree.

Thanks Michael.

Kevin


pgplMjtX9oeOB.pgp
Description: PGP signature
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH 01/15] PCI: introduce pci_device_to_OF_node() for !CONFIG_OF

2015-02-01 Thread Michael Ellerman
On Sat, 2015-01-31 at 21:47 +0800, Kevin Hao wrote:
> So we can avoid the ugly #ifdef in some drivers.
> 
> Signed-off-by: Kevin Hao 
> ---
>  include/linux/pci.h | 2 ++
>  1 file changed, 2 insertions(+)


Hi Bjorn,

Do you mind putting this into your next for 3.20? Or giving us an ACK for it if
you prefer.

cheers

> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 8323cbf93913..421eb6a9e600 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h
> @@ -1863,6 +1863,8 @@ static inline void pci_set_of_node(struct pci_dev *dev) 
> { }
>  static inline void pci_release_of_node(struct pci_dev *dev) { }
>  static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
>  static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
> +static inline struct device_node *
> +pci_device_to_OF_node(const struct pci_dev *pdev) { return NULL; }
>  #endif  /* CONFIG_OF */
>  
>  #ifdef CONFIG_EEH


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

Re: [PATCH 00/15] powerpc: kill PPC_OF

2015-02-01 Thread Michael Ellerman
On Sat, 2015-01-31 at 21:47 +0800, Kevin Hao wrote:
> Hi,
> 
> This patch series tries to kill the PPC_OF.

So on the whole this series looks good.

Getting it merged is going to be a bit of a pain though. I assume most of them
depend on patch 1, in which case they really need to go in as one series.

So you'll just have to collect acks from all the driver/subsystem maintainers,
and then we can take it all through the powerpc tree.

cheers


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

Re: [PATCH v7 0/4] Add support for parametrized events

2015-02-01 Thread Michael Ellerman
On Fri, 2015-01-30 at 11:52 -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Jan 29, 2015 at 03:28:43PM +1100, Michael Ellerman escreveu:
> > On Mon, 2015-01-26 at 17:43 -0800, Sukadev Bhattiprolu wrote:
> > > Description of "event parameters" from the documentation patch:
> > > 
> > > Cody P Schafer (6):
> > >   perf: provide sysfs_show for struct perf_pmu_events_attr
> > >   perf: add PMU_EVENT_ATTR_STRING() helper
> > >   powerpc/perf/hv-24x7: parse catalog and populate sysfs with events
> > >   powerpc/perf/{hv-gpci, hv-common}: generate requests with counters
> > > annotated
> > >   powerpc/perf/hv-gpci: add the remaining gpci requests
> > >   powerpc/perf/hv-24x7: Document sysfs event description entries
> > > 
> > > Sukadev Bhattiprolu (1):
> > >   perf: define EVENT_DEFINE_RANGE_FORMAT_LITE helper
> > 
> > Hi Sukadev,
> > 
> > I realise Cody wrote most of these and you are just getting them merged, but
> > they still need to be Signed-off-by you. Most of them aren't.
> > 
> > So please resend with them all signed off by you.
> > 
> > While you're at it, please drop all the CC lines, and move the changelog
> > annotations below the --- line so they are dropped when I apply them.
> > 
> > Also add Jiri's ack to the first two patches.
> 
> I'm ok taking Jiri's Ack for these and merge them, Suka, may I add your
> signed-off-by on those? (question for the record...).

Five of the seven are powerpc patches, so I'd rather they go via the powerpc
tree. Though if you really want to take them that's fine.

cheers


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

Re: [PATCH] cxl: remove redundant increment of hwirq

2015-02-01 Thread Michael Ellerman
On Sun, 2015-02-01 at 21:40 +, Colin King wrote:
> From: Colin Ian King 
> 
> Recent commit 80fa93fce37d3490f
> ("cxl: Name interrupts in /proc/interrupt") introduced a
> redundant increment of hwirq which is not used or even
> initialised at the point it is incremented. Detected by
> cppcheck:
> 
> [drivers/misc/cxl/irq.c:439]: (error) Uninitialized
>   variable: hwirq
> 
> Simple fix, remove the redundant increment.

This looks more or less the same as the previous patch you sent? The one which
has been in my next branch for 11 days?

cheers


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

[PATCH v3] net/fsl_pq_mdio: Document supported compatibles

2015-02-01 Thread Emil Medve
From: Shruti Kanetkar 

The device tree binding(s) document has fallen out of sync with the
driver code. Update the list of supported devices to reflect current
driver capabilities

Change-Id: I440d8de2ee2d9c3b7b23e69b3da851cab18a4c9a
Signed-off-by: Shruti Kanetkar 
Signed-off-by: Emil Medve 
---

v3: Separated from the FMan MDIO dt/binding patchset 
http://patchwork.ozlabs.org/patch/370870

 Documentation/devicetree/bindings/net/fsl-tsec-phy.txt | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt 
b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
index be6ea896..1e97532 100644
--- a/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
+++ b/Documentation/devicetree/bindings/net/fsl-tsec-phy.txt
@@ -8,7 +8,16 @@ of how to define a PHY.
 Required properties:
   - reg : Offset and length of the register set for the device
   - compatible : Should define the compatible device type for the
-mdio.  Currently, this is most likely to be "fsl,gianfar-mdio"
+mdio. Currently supported strings/devices are:
+   - "fsl,gianfar-tbi"
+   - "fsl,gianfar-mdio"
+   - "fsl,etsec2-tbi"
+   - "fsl,etsec2-mdio"
+   - "fsl,ucc-mdio"
+   - "fsl,fman-mdio"
+When device_type is "mdio", the following strings are also considered:
+   - "gianfar"
+   - "ucc_geth_phy"
 
 Example:
 
-- 
2.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v4 2/2] powerpc/corenet: Enable muxing MDIO buses via FPGA

2015-02-01 Thread Emil Medve
From: Shruti Kanetkar 

Change-Id: I00c521664573808af4f9a9c06a97665db470b49a
Signed-off-by: Andy Fleming 
Signed-off-by: Shaohui Xie 
Signed-off-by: Shruti Kanetkar 
Signed-off-by: Emil Medve 
---

v4: Add 'Signed-off-by'

v3: Spearated from the FMan MDIO dt/binding patchset 
http://patchwork.ozlabs.org/patch/370873
Also supersedes http://patchwork.ozlabs.org/patch/423348
Update via 'savedefconfig'
Auto-probe devices on 'fsl,fpga-qixis'

 arch/powerpc/configs/corenet32_smp_defconfig  | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig  | 1 +
 arch/powerpc/platforms/85xx/corenet_generic.c | 6 ++
 3 files changed, 8 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index 3cb094a..1dc74ee 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -105,6 +105,7 @@ CONFIG_VITESSE_PHY=y
 CONFIG_AT803X_PHY=y
 CONFIG_FIXED_PHY=y
 CONFIG_MDIO_BUS_MUX_GPIO=y
+CONFIG_MDIO_BUS_MUX_MMIOREG=y
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index 3b9d097..c2ff961 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -86,6 +86,7 @@ CONFIG_PHYLIB=y
 CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
 CONFIG_MDIO_BUS_MUX_GPIO=y
+CONFIG_MDIO_BUS_MUX_MMIOREG=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 0804b10..63bef30 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -91,6 +91,12 @@ static const struct of_device_id of_device_ids[] = {
.compatible = "mdio-mux-gpio"
},
{
+   .compatible = "fsl,fpga-ngpixis"
+   },
+   {
+   .compatible = "fsl,fpga-qixis"
+   },
+   {
.compatible = "fsl,srio",
},
{
-- 
2.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH v4 1/2] powerpc/corenet: Enable muxing MDIO buses via GPIO

2015-02-01 Thread Emil Medve
From: Andy Fleming 

Change-Id: I4489db79957ad533f4ba3f04fe7d5bcb3288e981
Signed-off-by: Andy Fleming 
Signed-off-by: Shaohui Xie 
Signed-off-by: Shruti Kanetkar 
Signed-off-by: Emil Medve 
---

v4: Add 'Signed-off-by'

v3: Spearated from the FMan MDIO dt/binding patchset 
http://patchwork.ozlabs.org/patch/370871
Also supersedes http://patchwork.ozlabs.org/patch/423350
Update via 'savedefconfig'

 arch/powerpc/configs/corenet32_smp_defconfig  | 1 +
 arch/powerpc/configs/corenet64_smp_defconfig  | 2 ++
 arch/powerpc/platforms/85xx/corenet_generic.c | 3 +++
 3 files changed, 6 insertions(+)

diff --git a/arch/powerpc/configs/corenet32_smp_defconfig 
b/arch/powerpc/configs/corenet32_smp_defconfig
index 7cc3cf8..3cb094a 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -104,6 +104,7 @@ CONFIG_E1000E=y
 CONFIG_VITESSE_PHY=y
 CONFIG_AT803X_PHY=y
 CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BUS_MUX_GPIO=y
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
 # CONFIG_INPUT_MOUSE is not set
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig 
b/arch/powerpc/configs/corenet64_smp_defconfig
index 61838c1..3b9d097 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -82,8 +82,10 @@ CONFIG_DUMMY=y
 CONFIG_FSL_PQ_MDIO=y
 CONFIG_FSL_XGMAC_MDIO=y
 CONFIG_E1000E=y
+CONFIG_PHYLIB=y
 CONFIG_VITESSE_PHY=y
 CONFIG_FIXED_PHY=y
+CONFIG_MDIO_BUS_MUX_GPIO=y
 CONFIG_INPUT_FF_MEMLESS=m
 # CONFIG_INPUT_MOUSEDEV is not set
 # CONFIG_INPUT_KEYBOARD is not set
diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c 
b/arch/powerpc/platforms/85xx/corenet_generic.c
index 1f309cc..0804b10 100644
--- a/arch/powerpc/platforms/85xx/corenet_generic.c
+++ b/arch/powerpc/platforms/85xx/corenet_generic.c
@@ -88,6 +88,9 @@ static const struct of_device_id of_device_ids[] = {
.compatible = "simple-bus"
},
{
+   .compatible = "mdio-mux-gpio"
+   },
+   {
.compatible = "fsl,srio",
},
{
-- 
2.2.2
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] cxl: remove redundant increment of hwirq

2015-02-01 Thread Colin King
From: Colin Ian King 

Recent commit 80fa93fce37d3490f
("cxl: Name interrupts in /proc/interrupt") introduced a
redundant increment of hwirq which is not used or even
initialised at the point it is incremented. Detected by
cppcheck:

[drivers/misc/cxl/irq.c:439]: (error) Uninitialized
  variable: hwirq

Simple fix, remove the redundant increment.

Signed-off-by: Colin Ian King 
---
 drivers/misc/cxl/irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/cxl/irq.c b/drivers/misc/cxl/irq.c
index c294925..68ab608 100644
--- a/drivers/misc/cxl/irq.c
+++ b/drivers/misc/cxl/irq.c
@@ -436,7 +436,7 @@ int afu_register_irqs(struct cxl_context *ctx, u32 count)
 */
INIT_LIST_HEAD(&ctx->irq_names);
for (r = 1; r < CXL_IRQ_RANGES; r++) {
-   for (i = 0; i < ctx->irqs.range[r]; hwirq++, i++) {
+   for (i = 0; i < ctx->irqs.range[r]; i++) {
irq_name = kmalloc(sizeof(struct cxl_irq_name),
   GFP_KERNEL);
if (!irq_name)
-- 
2.1.4

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

Re: nvram and generic_nvram modules are problematic, was Re: [PATCH] arch: m68k: mac: misc.c: Remove some unused functions

2015-02-01 Thread Geert Uytterhoeven
On Sun, Feb 1, 2015 at 4:39 AM, Finn Thain  wrote:
> On Sun, 4 Jan 2015, Geert Uytterhoeven wrote:
>
>> On Sun, Jan 4, 2015 at 8:21 AM, Finn Thain  
>> wrote:
>> > On Thu, 1 Jan 2015, Rickard Strandqvist wrote:
>> > > Removes some functions that are not used anywhere:
>> > > mac_pram_write() mac_pram_read()
>> >
>> > ... I'd rather not remove all of this code. Better to finish the
>> > implementation.
>>
>> Indeed.
>>
>> > Would it be acceptable to utilize drivers/char/generic_nvram.c and
>> > CONFIG_GENERIC_NVRAM? This is the PowerMac PRAM driver but looks
>> > generic enough that it may not need any modification for 68k Macs.
>>
>> Yes, that would be great.
>>
>
> Unfortunately, it seems to be unworkable.

An alternative could be to just provide an nvram attribute file in sysfs,
like many RTC drivers do.

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: nvram and generic_nvram modules are problematic, was Re: [PATCH] arch: m68k: mac: misc.c: Remove some unused functions

2015-02-01 Thread Russell King - ARM Linux
On Sun, Feb 01, 2015 at 02:39:42PM +1100, Finn Thain wrote:
> I find the ARM support in drivers/char/nvram to be surprising, not to say 
> questionable. The /proc/driver/nvram implementation, given 
> defined(__arm__), decodes the NVRAM contents in exactly the same format as 
> when defined(__i386__) || defined(__x86_64__).

That's because it's used on the Netwinder and EBSA285 platforms, which
are PCI-like, complete with a southbridge which makes them look like a
PC.

> Whereas, only MIPS and 
> PowerPC defconfigs set CONFIG_RTC_DRV_CMOS at all, and without that symbol 
> the driver will never be built for ARM. This raises the question, does 
> /proc/driver/nvram do anything useful on any ARM platforms?

Yes.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev