[PATCH 04/15] powerpc: don't use module_init in non-modular 83xx suspend code

2015-05-28 Thread Paul Gortmaker
The suspend.o is built for SUSPEND -- which is bool, and hence
this code is either present or absent.  It will never be modular,
so using module_init as an alias for __initcall can be somewhat
misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of device_initcall
directly in this change means that the runtime impact is
zero -- it will remain at level 6 in initcall ordering.

Cc: Scott Wood 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/platforms/83xx/suspend.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/suspend.c 
b/arch/powerpc/platforms/83xx/suspend.c
index c9adbfb65006..fcbea4b51a78 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -445,5 +445,4 @@ static int pmc_init(void)
 {
return platform_driver_register(&pmc_driver);
 }
-
-module_init(pmc_init);
+device_initcall(pmc_init);
-- 
2.2.1

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

[PATCH 03/15] powerpc: use device_initcall for registering rtc devices

2015-05-28 Thread Paul Gortmaker
Currently these two RTC devices are in core platform code
where it is not possible for them to be modular.  It will
never be modular, so using module_init as an alias for
__initcall can be somewhat misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of device_initcall
directly in this change means that the runtime impact is
zero -- they will remain at level 6 in initcall ordering.

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Geoff Levand 
Acked-by: Geoff Levand 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/kernel/time.c| 2 +-
 arch/powerpc/platforms/ps3/time.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 56f44848b044..43922509a483 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -1124,4 +1124,4 @@ static int __init rtc_init(void)
return PTR_ERR_OR_ZERO(pdev);
 }
 
-module_init(rtc_init);
+device_initcall(rtc_init);
diff --git a/arch/powerpc/platforms/ps3/time.c 
b/arch/powerpc/platforms/ps3/time.c
index ce73ce865613..791c6142c4a7 100644
--- a/arch/powerpc/platforms/ps3/time.c
+++ b/arch/powerpc/platforms/ps3/time.c
@@ -92,5 +92,4 @@ static int __init ps3_rtc_init(void)
 
return PTR_ERR_OR_ZERO(pdev);
 }
-
-module_init(ps3_rtc_init);
+device_initcall(ps3_rtc_init);
-- 
2.2.1

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

[PATCH 00/15] Replace module_init with device_initcall in non modules

2015-05-28 Thread Paul Gortmaker
This series of commits converts non-modular code that is using
the module_init() call to hook itself into the system to instead
use device_initcall().

The conversion is a runtime no-op, since module_init actually
becomes __initcall in the non-modular case, and that in turn gets
mapped onto device_initcall.

We fix this up now, so that we can relocate module_init from
init.h into module.h in a future series.

The files changed here are just limited to those that would
otherwise have to add module.h to obviously non-modular code, since
we don't want to do that.

This work is factored out from what was a previously larger series[1] so
that there is a common theme and lower patch count to ease review.

Paul.

[1] https://marc.info/?l=linux-kernel&m=139033951228828

---

Cc: Benjamin Herrenschmidt 
Cc: Chris Zankel 
Cc: David Howells 
Cc: Fenghua Yu 
Cc: Geoff Levand 
Cc: Helge Deller 
Cc: "H. Peter Anvin" 
Cc: Ingo Molnar 
Cc: Ivan Kokshaysky 
Cc: "James E.J. Bottomley" 
Cc: Jesper Nilsson 
Cc: Koichi Yasutake 
Cc: Matt Turner 
Cc: Max Filippov 
Cc: Mikael Starvik 
Cc: Mike Turquette 
Cc: Paul Mackerras 
Cc: Paul Mundt 
Cc: Richard Henderson 
Cc: Russell King 
Cc: Scott Wood 
Cc: Thomas Gleixner 
Cc: Thomas Meyer 
Cc: Tony Luck 
Cc: linux-al...@vger.kernel.org
Cc: linux-am33-l...@redhat.com
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-cris-ker...@axis.com
Cc: linux-i...@vger.kernel.org
Cc: linux-par...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux...@vger.kernel.org
Cc: linux-xte...@linux-xtensa.org
Cc: x...@kernel.org

Paul Gortmaker (15):
  x86: don't use module_init in non-modular intel_mid_vrtc.c
  x86: don't use module_init in non-modular devicetree.c code
  powerpc: use device_initcall for registering rtc devices
  powerpc: don't use module_init in non-modular 83xx suspend code
  arm: don't use module_init in non-modular mach-vexpress/spc.c code
  alpha: don't use module_init for non-modular core code
  ia64: don't use module_init for non-modular core kernel/mca.c code
  ia64: don't use module_init in non-modular sim/simscsi.c code
  cris: don't use module_init for non-modular core intmem.c code
  parisc: don't use module_init for non-modular core pdc_cons code
  parisc64: don't use module_init for non-modular core perf code
  mn10300: don't use module_init in non-modular flash.c code
  sh: don't use module_init in non-modular psw.c code
  xtensa: don't use module_init for non-modular core network.c code
  drivers/clk: don't use module_init in clk-nomadik.c which is
non-modular

 arch/alpha/kernel/srmcons.c  |  3 +--
 arch/arm/mach-vexpress/spc.c |  2 +-
 arch/cris/arch-v32/mm/intmem.c   |  3 +--
 arch/ia64/hp/sim/simscsi.c   | 11 +--
 arch/ia64/sn/kernel/mca.c|  3 +--
 arch/mn10300/unit-asb2303/flash.c|  3 +--
 arch/parisc/kernel/pdc_cons.c|  3 +--
 arch/parisc/kernel/perf.c|  3 +--
 arch/powerpc/kernel/time.c   |  2 +-
 arch/powerpc/platforms/83xx/suspend.c|  3 +--
 arch/powerpc/platforms/ps3/time.c|  3 +--
 arch/sh/boards/mach-landisk/psw.c|  2 +-
 arch/x86/kernel/devicetree.c |  2 +-
 arch/x86/platform/intel-mid/intel_mid_vrtc.c |  3 +--
 arch/xtensa/platforms/iss/network.c  |  4 +---
 drivers/clk/clk-nomadik.c|  3 +--
 16 files changed, 16 insertions(+), 37 deletions(-)

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

[PATCH 06/11] powerpc: don't use module_init for non-modular core hugetlb code

2015-05-31 Thread Paul Gortmaker
The hugetlbpage.o is obj-y (always built in).  It will never
be modular, so using module_init as an alias for __initcall is
somewhat misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of arch_initcall (which
makes sense for arch code) will thus change this registration
from level 6-device to level 3-arch (i.e. slightly earlier).
However no observable impact of that small difference has
been observed during testing, or is expected.

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/mm/hugetlbpage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 3385e3d0506e..f1e00ac9283c 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -933,7 +933,7 @@ static int __init hugetlbpage_init(void)
return 0;
 }
 #endif
-module_init(hugetlbpage_init);
+arch_initcall(hugetlbpage_init);
 
 void flush_dcache_icache_hugepage(struct page *page)
 {
-- 
2.2.1

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

[PATCH 05/11] powerpc: use subsys_initcall for Freescale Local Bus

2015-05-31 Thread Paul Gortmaker
The FSL_SOC option is bool, and hence this code is either
present or absent.  It will never be modular, so using
module_init as an alias for __initcall is rather misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of subsys_initcall (which
makes sense for bus code) will thus change this registration
from level 6-device to level 4-subsys (i.e. slightly earlier).
However no observable impact of that small difference has
been observed during testing, or is expected.

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Scott Wood 
Acked-by: Scott Wood 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/sysdev/fsl_lbc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c
index d631022ffb4b..38138cf8d33e 100644
--- a/arch/powerpc/sysdev/fsl_lbc.c
+++ b/arch/powerpc/sysdev/fsl_lbc.c
@@ -407,4 +407,4 @@ static int __init fsl_lbc_init(void)
 {
return platform_driver_register(&fsl_lbc_ctrl_driver);
 }
-module_init(fsl_lbc_init);
+subsys_initcall(fsl_lbc_init);
-- 
2.2.1

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

[PATCH 00/11] Replace module_init with an alternate initcall in non modules

2015-05-31 Thread Paul Gortmaker
This series of commits converts non-modular code that is using the
module_init() call to hook itself into the system to instead use one of
the alternate priority initcalls.

Unlike the earlier series[1] that used device_initcall and hence was a
runtime no-op, these commits change to one of the alternate initcalls,
because (a) we have them and (b) it seems like the right thing to do.
For example, it would seem logical to use arch_initcall for arch
specific setup code and fs_initcall for filesystem setup code.

This does mean however, that changes in the init ordering will be taking
place, and so there is a small risk that some kind of implicit init
ordering issue may lie uncovered.  But I think it is still better to
give these ones sensible priorities than to just assign them all to
device_initcall in order to exactly preserve the old ordering.

Thad said, we have already made similar changes in core kernel code
in commit c96d6660dc65b0a90aea9834bfd8be1d5656da18 ("kernel: audit/fix
non-modular users of module_init in core code") without any regressions
reported, so this type of change isn't without precedent.

This work is factored out from what was a previously larger series[2] so
that there is a common theme and lower patch count to ease review.

Paul.

[1] https://lkml.org/lkml/2015/5/28/809
[2] https://marc.info/?l=linux-kernel&m=139033951228828

---

Cc: Andrew Morton 
Cc: Arnaldo Carvalho de Melo 
Cc: Benjamin Herrenschmidt 
Cc: "David S. Miller" 
Cc: Eric Paris 
Cc: "H. Peter Anvin" 
Cc: Ingo Molnar 
Cc: John McCutchan 
Cc: Jozsef Kadlecsik 
Cc: Pablo Neira Ayuso 
Cc: Patrick McHardy 
Cc: Paul Mackerras 
Cc: Peter Zijlstra 
Cc: Robert Love 
Cc: Russell King 
Cc: Scott Wood 
Cc: Thomas Gleixner 
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux...@kvack.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: net...@vger.kernel.org
Cc: netfilter-de...@vger.kernel.org
Cc: x...@kernel.org


Paul Gortmaker (11):
  mm: replace module_init usages with subsys_initcall in nommu.c
  fs/notify: don't use module_init for non-modular inotify_user code
  netfilter: don't use module_init/exit in core IPV4 code
  x86: don't use module_init for non-modular core bootflag code
  powerpc: use subsys_initcall for Freescale Local Bus
  powerpc: don't use module_init for non-modular core hugetlb code
  arm: use subsys_initcall in non-modular pl320 IPC code
  lib/list_sort: use late_initcall to hook in self tests
  mm/page_owner.c: use late_initcall to hook in enabling
  x86: perf_event_intel_bts.c: use arch_initcall to hook in enabling
  x86: perf_event_intel_pt.c: use arch_initcall to hook in enabling

 arch/powerpc/mm/hugetlbpage.c  | 2 +-
 arch/powerpc/sysdev/fsl_lbc.c  | 2 +-
 arch/x86/kernel/bootflag.c | 2 +-
 arch/x86/kernel/cpu/perf_event_intel_bts.c | 3 +--
 arch/x86/kernel/cpu/perf_event_intel_pt.c  | 3 +--
 drivers/mailbox/pl320-ipc.c| 2 +-
 fs/notify/inotify/inotify_user.c   | 4 ++--
 lib/list_sort.c| 2 +-
 mm/nommu.c | 4 ++--
 mm/page_owner.c| 2 +-
 net/ipv4/netfilter.c   | 9 +
 11 files changed, 13 insertions(+), 22 deletions(-)

-- 
2.2.1

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

[PATCH] powerpc: delete __cpuinit usage from all users

2013-06-17 Thread Paul Gortmaker
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications.  For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.

After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out.  Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.

This removes all the powerpc uses of the __cpuinit macros.

[1] https://lkml.org/lkml/2013/5/20/589

Signed-off-by: Paul Gortmaker 
---

[This was generated against today's linux-next tree ; I'm assuming all
 pending powerpc changes are in there currently.]

 arch/powerpc/include/asm/rtas.h|  4 ++--
 arch/powerpc/include/asm/vdso.h|  2 +-
 arch/powerpc/kernel/cacheinfo.c| 19 +++
 arch/powerpc/kernel/rtas.c |  4 ++--
 arch/powerpc/kernel/smp.c  |  2 +-
 arch/powerpc/kernel/sysfs.c|  6 +++---
 arch/powerpc/kernel/time.c |  1 -
 arch/powerpc/kernel/vdso.c |  2 +-
 arch/powerpc/mm/44x_mmu.c  |  6 +++---
 arch/powerpc/mm/hash_utils_64.c|  2 +-
 arch/powerpc/mm/mmu_context_nohash.c   |  6 +++---
 arch/powerpc/mm/numa.c |  7 +++
 arch/powerpc/mm/tlb_nohash.c   |  2 +-
 arch/powerpc/perf/core-book3s.c|  4 ++--
 arch/powerpc/platforms/44x/currituck.c |  4 ++--
 arch/powerpc/platforms/44x/iss4xx.c|  4 ++--
 arch/powerpc/platforms/85xx/smp.c  |  6 +++---
 arch/powerpc/platforms/powermac/smp.c  |  2 +-
 arch/powerpc/platforms/powernv/smp.c   |  2 +-
 19 files changed, 43 insertions(+), 42 deletions(-)

diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 34fd704..c7a8bfc 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -350,8 +350,8 @@ static inline u32 rtas_config_addr(int busno, int devfn, 
int reg)
(devfn << 8) | (reg & 0xff);
 }
 
-extern void __cpuinit rtas_give_timebase(void);
-extern void __cpuinit rtas_take_timebase(void);
+extern void rtas_give_timebase(void);
+extern void rtas_take_timebase(void);
 
 #ifdef CONFIG_PPC_RTAS
 static inline int page_is_rtas_user_buf(unsigned long pfn)
diff --git a/arch/powerpc/include/asm/vdso.h b/arch/powerpc/include/asm/vdso.h
index 50f261b..0d9cecd 100644
--- a/arch/powerpc/include/asm/vdso.h
+++ b/arch/powerpc/include/asm/vdso.h
@@ -22,7 +22,7 @@ extern unsigned long vdso64_rt_sigtramp;
 extern unsigned long vdso32_sigtramp;
 extern unsigned long vdso32_rt_sigtramp;
 
-int __cpuinit vdso_getcpu_init(void);
+int vdso_getcpu_init(void);
 
 #else /* __ASSEMBLY__ */
 
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index 92c6b00..ddaecb1 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -131,7 +131,8 @@ static const char *cache_type_string(const struct cache 
*cache)
return cache_type_info[cache->type].name;
 }
 
-static void __cpuinit cache_init(struct cache *cache, int type, int level, 
struct device_node *ofnode)
+static void cache_init(struct cache *cache, int type, int level,
+  struct device_node *ofnode)
 {
cache->type = type;
cache->level = level;
@@ -385,7 +386,7 @@ static struct cache *__cpuinit 
cache_lookup_or_instantiate(struct device_node *n
return cache;
 }
 
-static void __cpuinit link_cache_lists(struct cache *smaller, struct cache 
*bigger)
+static void link_cache_lists(struct cache *smaller, struct cache *bigger)
 {
while (smaller->next_local) {
if (smaller->next_local == bigger)
@@ -396,13 +397,13 @@ static void __cpuinit link_cache_lists(struct cache 
*smaller, struct cache *bigg
smaller->next_local = bigger;
 }
 
-static void __cpuinit do_subsidiary_caches_debugcheck(struct cache *cache)
+static void do_subsidiary_caches_debugcheck(struct cache *cache)
 {
WARN_ON_ONCE(cache->level != 1);
WARN_ON_ONCE(strcmp(cache->ofnode->type, "cpu"));
 }
 
-static void __cpuinit do_subsidiary_caches(struct cache *cache)
+static void do_subsidiary_caches(struct cache *cache)
 {
struct device_node *subcache_node;
int level = cache->level;
@@ -653,7 +654,7 @@ static struct kobj_type cache_index_type = {
.default_attrs = cache_index_default_attrs,
 };
 
-static void __cpuinit cacheinfo_create_index_opt_attrs(struct cache_index_dir 
*dir)
+static void cacheinfo_create_index_opt_attrs(struct cache_index_dir *dir)
 {
const char *cache_name;
const char *cache_type;
@@ -696,7 +697,8 @@ static void __cpuinit 
cacheinfo_create_index_opt_attrs(struct cache_index_dir *d
kfree(buf

Re: [PATCH] powerpc: delete __cpuinit usage from all users

2013-06-18 Thread Paul Gortmaker
On 13-06-17 04:10 PM, Paul Gortmaker wrote:
> The __cpuinit type of throwaway sections might have made sense
> some time ago when RAM was more constrained, but now the savings
> do not offset the cost and complications.  For example, the fix in
> commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
> is a good example of the nasty type of bugs that can be created
> with improper use of the various __init prefixes.
> 
> After a discussion on LKML[1] it was decided that cpuinit should go
> the way of devinit and be phased out.  Once all the users are gone,
> we can then finally remove the macros themselves from linux/init.h.
> 
> This removes all the powerpc uses of the __cpuinit macros.

I see I missed a couple with a too limited regex.  I'll resend a v2
shortly.  It is up to you guys whether you want to carry this in the
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git#next
repo, or have me keep it with the arch independent __cpuinit removal
changes.  In mips for example, Ralf expected some significant tree
churn still pending and wanted to handle the conflicts himself, so
he took the mips chunk in his tree.

Thanks,
P.
--

> 
> [1] https://lkml.org/lkml/2013/5/20/589
> 
> Signed-off-by: Paul Gortmaker 
> ---
> 
> [This was generated against today's linux-next tree ; I'm assuming all
>  pending powerpc changes are in there currently.]
> 
>  arch/powerpc/include/asm/rtas.h|  4 ++--
>  arch/powerpc/include/asm/vdso.h|  2 +-
>  arch/powerpc/kernel/cacheinfo.c| 19 +++
>  arch/powerpc/kernel/rtas.c |  4 ++--
>  arch/powerpc/kernel/smp.c  |  2 +-
>  arch/powerpc/kernel/sysfs.c|  6 +++---
>  arch/powerpc/kernel/time.c |  1 -
>  arch/powerpc/kernel/vdso.c |  2 +-
>  arch/powerpc/mm/44x_mmu.c  |  6 +++---
>  arch/powerpc/mm/hash_utils_64.c|  2 +-
>  arch/powerpc/mm/mmu_context_nohash.c   |  6 +++---
>  arch/powerpc/mm/numa.c |  7 +++
>  arch/powerpc/mm/tlb_nohash.c   |  2 +-
>  arch/powerpc/perf/core-book3s.c|  4 ++--
>  arch/powerpc/platforms/44x/currituck.c |  4 ++--
>  arch/powerpc/platforms/44x/iss4xx.c|  4 ++--
>  arch/powerpc/platforms/85xx/smp.c  |  6 +++---
>  arch/powerpc/platforms/powermac/smp.c  |  2 +-
>  arch/powerpc/platforms/powernv/smp.c   |  2 +-
>  19 files changed, 43 insertions(+), 42 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
> index 34fd704..c7a8bfc 100644
> --- a/arch/powerpc/include/asm/rtas.h
> +++ b/arch/powerpc/include/asm/rtas.h
> @@ -350,8 +350,8 @@ static inline u32 rtas_config_addr(int busno, int devfn, 
> int reg)
>   (devfn << 8) | (reg & 0xff);
>  }
>  
> -extern void __cpuinit rtas_give_timebase(void);
> -extern void __cpuinit rtas_take_timebase(void);
> +extern void rtas_give_timebase(void);
> +extern void rtas_take_timebase(void);
>  
>  #ifdef CONFIG_PPC_RTAS
>  static inline int page_is_rtas_user_buf(unsigned long pfn)
> diff --git a/arch/powerpc/include/asm/vdso.h b/arch/powerpc/include/asm/vdso.h
> index 50f261b..0d9cecd 100644
> --- a/arch/powerpc/include/asm/vdso.h
> +++ b/arch/powerpc/include/asm/vdso.h
> @@ -22,7 +22,7 @@ extern unsigned long vdso64_rt_sigtramp;
>  extern unsigned long vdso32_sigtramp;
>  extern unsigned long vdso32_rt_sigtramp;
>  
> -int __cpuinit vdso_getcpu_init(void);
> +int vdso_getcpu_init(void);
>  
>  #else /* __ASSEMBLY__ */
>  
> diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
> index 92c6b00..ddaecb1 100644
> --- a/arch/powerpc/kernel/cacheinfo.c
> +++ b/arch/powerpc/kernel/cacheinfo.c
> @@ -131,7 +131,8 @@ static const char *cache_type_string(const struct cache 
> *cache)
>   return cache_type_info[cache->type].name;
>  }
>  
> -static void __cpuinit cache_init(struct cache *cache, int type, int level, 
> struct device_node *ofnode)
> +static void cache_init(struct cache *cache, int type, int level,
> +struct device_node *ofnode)
>  {
>   cache->type = type;
>   cache->level = level;
> @@ -385,7 +386,7 @@ static struct cache *__cpuinit 
> cache_lookup_or_instantiate(struct device_node *n
>   return cache;
>  }
>  
> -static void __cpuinit link_cache_lists(struct cache *smaller, struct cache 
> *bigger)
> +static void link_cache_lists(struct cache *smaller, struct cache *bigger)
>  {
>   while (smaller->next_local) {
>   if (smaller->next_local == bigger)
> @@ -396,13 +397,13 @@ static void __cpuinit link_cache_lists(struct cache 
> *smaller,

[PATCH 04/32] powerpc: delete __cpuinit usage from all users

2013-06-24 Thread Paul Gortmaker
The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications.  For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.

After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out.  Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.

This removes all the powerpc uses of the __cpuinit macros.  There
are no __CPUINIT users in assembly files in powerpc.

[1] https://lkml.org/lkml/2013/5/20/589

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Josh Boyer 
Cc: Matt Porter 
Cc: Kumar Gala 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---

[This commit is part of the __cpuinit removal work.  If you don't see
 any problems with it, then you don't have to do anything ; it will be
 submitted with all the rest of the __cpuinit removal work.  On the
 other hand, if you want to carry this patch in with your other pending
 changes so as to handle conflicts with other pending work yourself, then
 that is fine too, as the commits can largely be treated independently.
 For more information, please see: https://lkml.org/lkml/2013/6/20/513 ]

 arch/powerpc/include/asm/rtas.h|  4 ++--
 arch/powerpc/include/asm/vdso.h|  2 +-
 arch/powerpc/kernel/cacheinfo.c| 36 --
 arch/powerpc/kernel/rtas.c |  4 ++--
 arch/powerpc/kernel/smp.c  |  4 ++--
 arch/powerpc/kernel/sysfs.c|  6 +++---
 arch/powerpc/kernel/time.c |  1 -
 arch/powerpc/kernel/vdso.c |  2 +-
 arch/powerpc/mm/44x_mmu.c  |  6 +++---
 arch/powerpc/mm/hash_utils_64.c|  2 +-
 arch/powerpc/mm/mmu_context_nohash.c   |  6 +++---
 arch/powerpc/mm/numa.c |  7 +++
 arch/powerpc/mm/tlb_nohash.c   |  2 +-
 arch/powerpc/perf/core-book3s.c|  4 ++--
 arch/powerpc/platforms/44x/currituck.c |  4 ++--
 arch/powerpc/platforms/44x/iss4xx.c|  4 ++--
 arch/powerpc/platforms/85xx/smp.c  |  6 +++---
 arch/powerpc/platforms/powermac/smp.c  |  2 +-
 arch/powerpc/platforms/powernv/smp.c   |  2 +-
 19 files changed, 54 insertions(+), 50 deletions(-)

diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h
index 34fd704..c7a8bfc 100644
--- a/arch/powerpc/include/asm/rtas.h
+++ b/arch/powerpc/include/asm/rtas.h
@@ -350,8 +350,8 @@ static inline u32 rtas_config_addr(int busno, int devfn, 
int reg)
(devfn << 8) | (reg & 0xff);
 }
 
-extern void __cpuinit rtas_give_timebase(void);
-extern void __cpuinit rtas_take_timebase(void);
+extern void rtas_give_timebase(void);
+extern void rtas_take_timebase(void);
 
 #ifdef CONFIG_PPC_RTAS
 static inline int page_is_rtas_user_buf(unsigned long pfn)
diff --git a/arch/powerpc/include/asm/vdso.h b/arch/powerpc/include/asm/vdso.h
index 50f261b..0d9cecd 100644
--- a/arch/powerpc/include/asm/vdso.h
+++ b/arch/powerpc/include/asm/vdso.h
@@ -22,7 +22,7 @@ extern unsigned long vdso64_rt_sigtramp;
 extern unsigned long vdso32_sigtramp;
 extern unsigned long vdso32_rt_sigtramp;
 
-int __cpuinit vdso_getcpu_init(void);
+int vdso_getcpu_init(void);
 
 #else /* __ASSEMBLY__ */
 
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index 92c6b00..9262cf2 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -131,7 +131,8 @@ static const char *cache_type_string(const struct cache 
*cache)
return cache_type_info[cache->type].name;
 }
 
-static void __cpuinit cache_init(struct cache *cache, int type, int level, 
struct device_node *ofnode)
+static void cache_init(struct cache *cache, int type, int level,
+  struct device_node *ofnode)
 {
cache->type = type;
cache->level = level;
@@ -140,7 +141,7 @@ static void __cpuinit cache_init(struct cache *cache, int 
type, int level, struc
list_add(&cache->list, &cache_list);
 }
 
-static struct cache *__cpuinit new_cache(int type, int level, struct 
device_node *ofnode)
+static struct cache *new_cache(int type, int level, struct device_node *ofnode)
 {
struct cache *cache;
 
@@ -324,7 +325,8 @@ static bool cache_node_is_unified(const struct device_node 
*np)
return of_get_property(np, "cache-unified", NULL);
 }
 
-static struct cache *__cpuinit cache_do_one_devnode_unified(struct device_node 
*node, int level)
+static struct cache *cache_do_one_devnode_unified(struct device_node *node,
+ int level)
 {
struct cache *cache;
 
@@ -335,7 +337,8 @@ static struct cache *__cpuinit 
cache_do_one_devnode_unified(struct d

[PATCH-next 00/32] Delete support for __cpuinit

2013-06-24 Thread Paul Gortmaker
[Resending with only lists on Cc: -- previous mail header on the 00/32
 was too long; failed to get passed vger's crap filters.]

On 13-06-24 03:30 PM, Paul Gortmaker wrote:
> This is the whole patch queue for removal of __cpuinit support
> against the latest linux-next tree (Jun24th).  Some of you may
> have already seen chunks of it, or already read the logistics
> of what is being done (and why) here:
> 
>   https://lkml.org/lkml/2013/6/20/513
> 
> I won't repeat all that here again, other than to say this send
> is to ensure arch/subsystem maintainers get a 2nd chance to know
> what is going on and to look at what is being proposed for their
> area of code.  That, and to ensure one complete continuous copy
> of it gets mailed out.  You can also see the patch queue here:
> 
>   http://git.kernel.org/cgit/linux/kernel/git/paulg/cpuinit-delete.git
> 
> If you've noticed that a chunk for MIPS isn't present here, that
> is because it has already been queued in the linux-mips for-next
> branch.
> 
> Thanks,
> Paul.
> 
> ---
> Cc: Len Brown 
> Cc: "Rafael J. Wysocki" 
> Cc: Richard Henderson 
> Cc: Ivan Kokshaysky 
> Cc: Matt Turner 
> Cc: Vineet Gupta 
> Cc: Russell King 
> Cc: Will Deacon 
> Cc: Catalin Marinas 
> Cc: Will Deacon 
> Cc: Mike Frysinger 
> Cc: Bob Liu 
> Cc: Sonic Zhang 
> Cc: Jens Axboe 
> Cc: John Stultz 
> Cc: Thomas Gleixner 
> Cc: "Rafael J. Wysocki" 
> Cc: Viresh Kumar 
> Cc: Mikael Starvik 
> Cc: Jesper Nilsson 
> Cc: Greg Kroah-Hartman 
> Cc: David Howells 
> Cc: Richard Kuo 
> Cc: Fenghua Yu 
> Cc: Tony Luck 
> Cc: Fenghua Yu 
> Cc: Hirokazu Takata 
> Cc: James Hogan 
> Cc: Arnd Bergmann 
> Cc: Rusty Russell 
> Cc: "David S. Miller" 
> Cc: Jonas Bonn 
> Cc: Helge Deller 
> Cc: Benjamin Herrenschmidt 
> Cc: Paul Mackerras 
> Cc: Josh Boyer 
> Cc: Matt Porter 
> Cc: Kumar Gala 
> Cc: "Paul E. McKenney" 
> Cc: Josh Triplett 
> Cc: Dipankar Sarma 
> Cc: Martin Schwidefsky 
> Cc: Heiko Carstens 
> Cc: Chen Liqin 
> Cc: Lennox Wu 
> Cc: Paul Mundt 
> Cc: "David S. Miller" 
> Cc: Chris Metcalf 
> Cc: Thomas Gleixner 
> Cc: Ingo Molnar 
> Cc: "H. Peter Anvin" 
> Cc: Chris Zankel 
> Cc: Max Filippov 
> Cc: linux-a...@vger.kernel.org
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: uclinux-dist-de...@blackfin.uclinux.org
> Cc: cpuf...@vger.kernel.org
> Cc: linux...@vger.kernel.org
> Cc: linux-cris-ker...@axis.com
> Cc: linux-hexa...@vger.kernel.org
> Cc: lm-sens...@lm-sensors.org
> Cc: linux-i...@vger.kernel.org
> Cc: linux-m...@ml.linux-m32r.org
> Cc: linux-m32r...@ml.linux-m32r.org
> Cc: net...@vger.kernel.org
> Cc: li...@lists.openrisc.net
> Cc: linux-par...@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux...@de.ibm.com
> Cc: linux-s...@vger.kernel.org
> Cc: linux...@vger.kernel.org
> Cc: sparcli...@vger.kernel.org
> Cc: x...@kernel.org
> Cc: linux-xte...@linux-xtensa.org
> 
> Paul Gortmaker (32):
>   init.h: remove __cpuinit sections from the kernel
>   modpost: remove all traces of cpuinit/cpuexit sections
>   alpha: delete __cpuinit usage from all users
>   powerpc: delete __cpuinit usage from all users
>   parisc: delete __cpuinit usage from all users
>   ia64: delete __cpuinit usage from all ia64 users
>   arm: delete __cpuinit/__CPUINIT usage from all ARM users
>   sparc: delete __cpuinit/__CPUINIT usage from all users
>   arm64: delete __cpuinit usage from all users
>   arc: delete __cpuinit usage from all arc files
>   blackfin: delete __cpuinit usage from all blackfin files
>   s390: delete __cpuinit usage from all s390 files
>   sh: delete __cpuinit usage from all sh files
>   tile: delete __cpuinit usage from all tile files
>   metag: delete __cpuinit usage from all metag files
>   cris: delete __cpuinit usage from all cris files
>   frv: delete __cpuinit usage from all frv files
>   hexagon: delete __cpuinit usage from all hexagon files
>   m32r: delete __cpuinit usage from all m32r files
>   openrisc: delete __cpuinit usage from all openrisc files
>   xtensa: delete __cpuinit usage from all xtensa files
>   score: delete __cpuinit usage from all score files
>   x86: delete __cpuinit usage from all x86 files
>   clocksource+irqchip: delete __cpuinit usage from all related files
>   cpufreq: delete __cpuinit usage from all cpufreq files
>   hwmon: delete __cpuinit usage from all hwmon files
>   acpi: delete __cpuinit usage from all acpi files
>   net: delete __cpuinit usage from all net files
>   rcu: delete __cpuinit usage from all rcu files
>   kernel: delete __cpuinit usage from all core kernel files
&g

[PATCH-next 00/32] Delete support for __cpuinit

2013-06-24 Thread Paul Gortmaker
This is the whole patch queue for removal of __cpuinit support
against the latest linux-next tree (Jun24th).  Some of you may
have already seen chunks of it, or already read the logistics
of what is being done (and why) here:

  https://lkml.org/lkml/2013/6/20/513

I won't repeat all that here again, other than to say this send
is to ensure arch/subsystem maintainers get a 2nd chance to know
what is going on and to look at what is being proposed for their
area of code.  That, and to ensure one complete continuous copy
of it gets mailed out.  You can also see the patch queue here:

  http://git.kernel.org/cgit/linux/kernel/git/paulg/cpuinit-delete.git

If you've noticed that a chunk for MIPS isn't present here, that
is because it has already been queued in the linux-mips for-next
branch.

Thanks,
Paul.

---
Cc: Len Brown 
Cc: "Rafael J. Wysocki" 
Cc: Richard Henderson 
Cc: Ivan Kokshaysky 
Cc: Matt Turner 
Cc: Vineet Gupta 
Cc: Russell King 
Cc: Will Deacon 
Cc: Catalin Marinas 
Cc: Will Deacon 
Cc: Mike Frysinger 
Cc: Bob Liu 
Cc: Sonic Zhang 
Cc: Jens Axboe 
Cc: John Stultz 
Cc: Thomas Gleixner 
Cc: "Rafael J. Wysocki" 
Cc: Viresh Kumar 
Cc: Mikael Starvik 
Cc: Jesper Nilsson 
Cc: Greg Kroah-Hartman 
Cc: David Howells 
Cc: Richard Kuo 
Cc: Fenghua Yu 
Cc: Tony Luck 
Cc: Fenghua Yu 
Cc: Hirokazu Takata 
Cc: James Hogan 
Cc: Arnd Bergmann 
Cc: Rusty Russell 
Cc: "David S. Miller" 
Cc: Jonas Bonn 
Cc: Helge Deller 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Josh Boyer 
Cc: Matt Porter 
Cc: Kumar Gala 
Cc: "Paul E. McKenney" 
Cc: Josh Triplett 
Cc: Dipankar Sarma 
Cc: Martin Schwidefsky 
Cc: Heiko Carstens 
Cc: Chen Liqin 
Cc: Lennox Wu 
Cc: Paul Mundt 
Cc: "David S. Miller" 
Cc: Chris Metcalf 
Cc: Thomas Gleixner 
Cc: Ingo Molnar 
Cc: "H. Peter Anvin" 
Cc: Chris Zankel 
Cc: Max Filippov 
Cc: linux-a...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: uclinux-dist-de...@blackfin.uclinux.org
Cc: cpuf...@vger.kernel.org
Cc: linux...@vger.kernel.org
Cc: linux-cris-ker...@axis.com
Cc: linux-hexa...@vger.kernel.org
Cc: lm-sens...@lm-sensors.org
Cc: linux-i...@vger.kernel.org
Cc: linux-m...@ml.linux-m32r.org
Cc: linux-m32r...@ml.linux-m32r.org
Cc: net...@vger.kernel.org
Cc: li...@lists.openrisc.net
Cc: linux-par...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux...@de.ibm.com
Cc: linux-s...@vger.kernel.org
Cc: linux...@vger.kernel.org
Cc: sparcli...@vger.kernel.org
Cc: x...@kernel.org
Cc: linux-xte...@linux-xtensa.org

Paul Gortmaker (32):
  init.h: remove __cpuinit sections from the kernel
  modpost: remove all traces of cpuinit/cpuexit sections
  alpha: delete __cpuinit usage from all users
  powerpc: delete __cpuinit usage from all users
  parisc: delete __cpuinit usage from all users
  ia64: delete __cpuinit usage from all ia64 users
  arm: delete __cpuinit/__CPUINIT usage from all ARM users
  sparc: delete __cpuinit/__CPUINIT usage from all users
  arm64: delete __cpuinit usage from all users
  arc: delete __cpuinit usage from all arc files
  blackfin: delete __cpuinit usage from all blackfin files
  s390: delete __cpuinit usage from all s390 files
  sh: delete __cpuinit usage from all sh files
  tile: delete __cpuinit usage from all tile files
  metag: delete __cpuinit usage from all metag files
  cris: delete __cpuinit usage from all cris files
  frv: delete __cpuinit usage from all frv files
  hexagon: delete __cpuinit usage from all hexagon files
  m32r: delete __cpuinit usage from all m32r files
  openrisc: delete __cpuinit usage from all openrisc files
  xtensa: delete __cpuinit usage from all xtensa files
  score: delete __cpuinit usage from all score files
  x86: delete __cpuinit usage from all x86 files
  clocksource+irqchip: delete __cpuinit usage from all related files
  cpufreq: delete __cpuinit usage from all cpufreq files
  hwmon: delete __cpuinit usage from all hwmon files
  acpi: delete __cpuinit usage from all acpi files
  net: delete __cpuinit usage from all net files
  rcu: delete __cpuinit usage from all rcu files
  kernel: delete __cpuinit usage from all core kernel files
  drivers: delete __cpuinit usage from all remaining drivers files
  block: delete __cpuinit usage from all block files

 Documentation/cpu-hotplug.txt |  6 +--
 arch/alpha/kernel/smp.c   | 10 ++---
 arch/alpha/kernel/traps.c |  4 +-
 arch/arc/include/asm/irq.h|  2 +-
 arch/arc/kernel/irq.c |  2 +-
 arch/arc/kernel/setup.c   | 10 ++---
 arch/arc/kernel/smp.c |  4 +-
 arch/arc/kernel/time.c|  6 +--
 arch/arc/mm/cache_arc700.c|  4 +-
 arch/arc/mm/tlb.c |  4 +-
 arch/arm/common/mcpm_platsmp.c|  4 +-
 arch/arm/include/asm/arch_timer.h |  2 +-
 arch/arm/kernel/head-common.S

Re: [PATCH] macintosh/ans-lcd: fix build failure after module_init/exit relocation

2015-07-18 Thread Paul Gortmaker
[[PATCH] macintosh/ans-lcd: fix build failure after module_init/exit 
relocation] On 17/07/2015 (Fri 14:20) Luis Henriques wrote:

> After commit 0fd972a7d91d ("module: relocate module_init from init.h to 
> module.h")
> ans-lcd module fails to build with:
> 
> drivers/macintosh/ans-lcd.c:201:1: warning: data definition has no type or 
> storage class [enabled by default]
>  module_init(anslcd_init);
>  ^
> drivers/macintosh/ans-lcd.c:201:1: error: type defaults to 'int' in 
> declaration of 'module_init' [-Werror=implicit-int]
> drivers/macintosh/ans-lcd.c:201:1: warning: parameter names (without types) 
> in function declaration [enabled by default]
> drivers/macintosh/ans-lcd.c:202:1: warning: data definition has no type or 
> storage class [enabled by default]
>  module_exit(anslcd_exit);
>  ^
> drivers/macintosh/ans-lcd.c:202:1: error: type defaults to 'int' in 
> declaration of 'module_exit' [-Werror=implicit-int]
> drivers/macintosh/ans-lcd.c:202:1: warning: parameter names (without types) 
> in function declaration [enabled by default]
> drivers/macintosh/ans-lcd.c:155:1: warning: 'anslcd_init' defined but not 
> used [-Wunused-function]
>  anslcd_init(void)
>  ^
> drivers/macintosh/ans-lcd.c:195:1: warning: 'anslcd_exit' defined but not 
> used [-Wunused-function]
>  anslcd_exit(void)
>  ^
> 
> This commit fixes it by replacing linux/init.h by linux/module.h.

Guess it was inevitable I miss at least one.   This old beast must not
get coverage under any of the ppc defconfigs or allmodconfig, since I
did both...  are you using a custom config for an older box?

Anyway, the thing is controlled by a tristate, so this is the right fix.

I don't have _any_ other fixes queued for that cleanup series, so I'm fine
with this going via the ppc tree, since I'm sure there will be pending
commits there.

Acked-by: Paul Gortmaker 

Thanks,
Paul.
--

> 
> Fixes: 0fd972a7d91d ("module: relocate module_init from init.h to module.h")
> Signed-off-by: Luis Henriques 
> ---
>  drivers/macintosh/ans-lcd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c
> index 1a57e88a38f7..cd35079c8c98 100644
> --- a/drivers/macintosh/ans-lcd.c
> +++ b/drivers/macintosh/ans-lcd.c
> @@ -7,7 +7,7 @@
>  #include 
>  #include 
>  #include 
> -#include 
> +#include 
>  #include 
>  #include 
>  
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH 3/5] drivers/tty: make hvc_console.c explicitly non-modular

2015-08-08 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/tty/hvc/Kconfig:config HVC_DRIVER
drivers/tty/hvc/Kconfig:bool

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only, even
though someone bothered to comment that the code was not used.

Unlike other changes, this driver binds in w/o using module_init,
so we dont have init ordering concerns with this commit.

Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 drivers/tty/hvc/hvc_console.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
index 4e9c4cc9e1b5..9c30f67c802a 100644
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -29,7 +29,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -1005,19 +1005,3 @@ put_tty:
 out:
return err;
 }
-
-/* This isn't particularly necessary due to this being a console driver
- * but it is nice to be thorough.
- */
-static void __exit hvc_exit(void)
-{
-   if (hvc_driver) {
-   kthread_stop(hvc_task);
-
-   tty_unregister_driver(hvc_driver);
-   /* return tty_struct instances allocated in hvc_init(). */
-   put_tty_driver(hvc_driver);
-   unregister_console(&hvc_console);
-   }
-}
-module_exit(hvc_exit);
-- 
2.5.0

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

[PATCH 0/5] drivers/tty: make more bool drivers explicitly non-modular

2015-08-08 Thread Paul Gortmaker
This second set of patches to drivers/tty steps outside of the serial
dir, and an improved auditing finds two more serial drivers pretending
to be modular that really are not.

The reasoning for doing this is the same as the first set[1] of patches
and is largely copied below:

  In the previous merge window, we made changes to allow better
  delineation between modular and non-modular code in commit
  0fd972a7d91d6e15393c449492a04d94c0b89351 ("module: relocate module_init
  from init.h to module.h").  This allows us to now ensure module code
  looks modular and non-modular code does not accidentally look modular
  without suffering build breakage.
  
  Here we target code that is, by nature of their Kconfig settings, only
  available to be built-in, but implicitly presenting itself as being
  possibly modular by way of using modular headers, macros, and functions.
  
  The goal here is to remove that illusion of modularity from these
  drivers, but in a way that leaves the actual runtime unchanged.
  In doing so, we remove code that has never been tested and adds
  no value to the tree.  And we begin the process of expecting a
  level of consistency between the Kconfig of a driver and the code
  that the driver uses.
  
Build tested for allyesconfig on x86_64, and ARM for lpc81xx, and powerpc
for hvc_console and mpsc, layered onto tty/tty-next as a baseline.

Paul.

[1] 
https://lkml.kernel.org/r/1437530538-5078-1-git-send-email-paul.gortma...@windriver.com
--

Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: Joachim Eastwood 
Cc: linux-arm-ker...@lists.infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-ser...@vger.kernel.org

Paul Gortmaker (5):
  drivers/tty: make pty.c slightly more explicitly non-modular
  drivers/tty: make sysrq.c slightly more explicitly non-modular
  drivers/tty: make hvc_console.c explicitly non-modular
  drivers/tty: make serial/mpsc.c driver explicitly non-modular
  drivers/tty: make serial 8250_lpc18xx.c explicitly non-modular

 drivers/tty/hvc/hvc_console.c  | 18 +
 drivers/tty/pty.c  |  7 +--
 drivers/tty/serial/8250/8250_lpc18xx.c | 19 --
 drivers/tty/serial/mpsc.c  | 36 +++---
 drivers/tty/sysrq.c|  6 +-
 5 files changed, 18 insertions(+), 68 deletions(-)

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

[PATCH 3/5] drivers/tty: make hvc_console.c explicitly non-modular

2015-08-19 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/tty/hvc/Kconfig:config HVC_DRIVER
drivers/tty/hvc/Kconfig:bool

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only, even
though someone bothered to comment that the code was not used.

Unlike other changes, this driver binds in w/o using module_init,
so we dont have init ordering concerns with this commit.

Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Acked-by: Michael Ellerman 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 drivers/tty/hvc/hvc_console.c | 18 +-
 1 file changed, 1 insertion(+), 17 deletions(-)

diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c
index 4e9c4cc9e1b5..9c30f67c802a 100644
--- a/drivers/tty/hvc/hvc_console.c
+++ b/drivers/tty/hvc/hvc_console.c
@@ -29,7 +29,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -1005,19 +1005,3 @@ put_tty:
 out:
return err;
 }
-
-/* This isn't particularly necessary due to this being a console driver
- * but it is nice to be thorough.
- */
-static void __exit hvc_exit(void)
-{
-   if (hvc_driver) {
-   kthread_stop(hvc_task);
-
-   tty_unregister_driver(hvc_driver);
-   /* return tty_struct instances allocated in hvc_init(). */
-   put_tty_driver(hvc_driver);
-   unregister_console(&hvc_console);
-   }
-}
-module_exit(hvc_exit);
-- 
2.5.0

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

[PATCH v2 0/5] drivers/tty: make more bool drivers explicitly non-modular

2015-08-19 Thread Paul Gortmaker
[v2: drop dead module code removal from 8250_lpc18xx.c ; instead convert it
 from bool to tristate ; also add ack to hvc_console commit.]

This second set of patches to drivers/tty steps outside of the serial
dir, and an improved auditing finds two more serial drivers pretending
to be modular that really are not.

The reasoning for doing this is the same as the first set[1] of patches
and is largely copied below:

  In the previous merge window, we made changes to allow better
  delineation between modular and non-modular code in commit
  0fd972a7d91d6e15393c449492a04d94c0b89351 ("module: relocate module_init
  from init.h to module.h").  This allows us to now ensure module code
  looks modular and non-modular code does not accidentally look modular
  without suffering build breakage.
  
  Here we target code that is, by nature of their Kconfig settings, only
  available to be built-in, but implicitly presenting itself as being
  possibly modular by way of using modular headers, macros, and functions.
  
  The goal here is to remove that illusion of modularity from these
  drivers, but in a way that leaves the actual runtime unchanged.
  In doing so, we remove code that has never been tested and adds
  no value to the tree.  And we begin the process of expecting a
  level of consistency between the Kconfig of a driver and the code
  that the driver uses.
  
Build tested for allyesconfig on x86_64, and ARM for lpc81xx, and powerpc
for hvc_console and mpsc, layered onto tty/tty-next as a baseline.

Paul.

[1] 
https://lkml.kernel.org/r/1437530538-5078-1-git-send-email-paul.gortma...@windriver.com
--

Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: Joachim Eastwood 
Cc: linux-arm-ker...@lists.infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-ser...@vger.kernel.org

Paul Gortmaker (5):
  drivers/tty: make pty.c slightly more explicitly non-modular
  drivers/tty: make sysrq.c slightly more explicitly non-modular
  drivers/tty: make hvc_console.c explicitly non-modular
  drivers/tty: make serial/mpsc.c driver explicitly non-modular
  drivers/tty: make serial 8250_lpc18xx.c Kconfig a tristate

 drivers/tty/hvc/hvc_console.c   | 18 +-
 drivers/tty/pty.c   |  7 +--
 drivers/tty/serial/8250/Kconfig |  2 +-
 drivers/tty/serial/mpsc.c   | 36 +++-
 drivers/tty/sysrq.c |  6 +-
 5 files changed, 15 insertions(+), 54 deletions(-)

-- 
2.5.0

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

Re: Anyone have a PrPmc 280/2800 handy?

2013-01-19 Thread Paul Gortmaker
On Thu, Jan 17, 2013 at 5:33 PM, Mark A. Greer  wrote:
> Hello.
>
> I want to make some fixups to the marvell hostbridge and
> mpsc code and would like to test them on a PrPmc280/2800.
> The problem is, I don't have one anymore.

Hi Mark,

Is there another platform that uses mpsc that can be used for
testing?  I ask because I did spend a lot of time with PrPMC-280
and motload/powerboot; some standalone, some on ATCA-F101.
And with that hindsight, I can't help thinking that the right thing
to do some eight years later is to simply consider removing the
support for these old platforms.  Would that make your validation
easier?  If so, then I'd recommend it.  This is of course, just my opinion.

Paul.
--

>
> If you have one handy and don't mind running a quick boot
> test for me,  please let me know.
>
> Thanks,
>
> Mark
> --
> ___
> 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


[PATCH 4/4] powerpc: enable MTD options in sbc8548 defconfig

2013-01-23 Thread Paul Gortmaker
This board has soldered on flash, and a SODIMM flash module.
Both can be used for booting, via switching JP12 and SW2.8
and using the sbc8548-altflash.dts when booting from SODIMM.

Here we enable MTD in kernel so that we can see the bootloader
(and other flash sectors) from linux.

Normal configuration:

 root@sbc8548:~# cat /proc/mtd
 dev:size   erasesize  name
 mtd0: 007a 0002 "space"
 mtd1: 0006 0002 "bootloader"
 mtd2: 03f0 0008 "space"
 mtd3: 0010 0008 "bootloader"
 root@sbc8548:~# dd if=/dev/mtd1 count=1 bs=48|hexdump -C
 1+0 records in
 1+0 records out
   27 05 19 56 55 2d 42 6f  6f 74 20 32 30 31 32 2e  |'..VU-Boot 2012.|
 0010  31 30 2d 64 69 72 74 79  20 28 4a 61 6e 20 31 39  |10-dirty (Jan 19|
 0020  20 32 30 31 33 20 2d 20  31 39 3a 34 30 3a 31 31  | 2013 - 19:40:11|
 0030
 root@sbc8548:~# dd if=/dev/mtd3 count=1 bs=48|hexdump -C
 1+0 records in
 1+0 records out
   27 05 19 56 55 2d 42 6f  6f 74 20 32 30 31 32 2e  |'..VU-Boot 2012.|
 0010  31 30 2d 64 69 72 74 79  20 28 44 65 63 20 31 33  |10-dirty (Dec 13|
 0020  20 32 30 31 32 20 2d 20  31 35 3a 30 30 3a 30 37  | 2012 - 15:00:07|
 0030
 root@sbc8548:~#

Alternate configuration, with sbc8548-altflash.dts:

 root@sbc8548:~# cat /proc/mtd
 dev:size   erasesize  name
 mtd0: 03f0 0008 "space"
 mtd1: 0010 0008 "bootloader"
 mtd2: 007a 0002 "space"
 mtd3: 0006 0002 "bootloader"
 root@sbc8548:~# dd if=/dev/mtd1 count=1 bs=48|hexdump -C
 1+0 records in
 1+0 records out
   27 05 19 56 55 2d 42 6f  6f 74 20 32 30 31 32 2e  |'..VU-Boot 2012.|
 0010  31 30 2d 64 69 72 74 79  20 28 44 65 63 20 31 33  |10-dirty (Dec 13|
 0020  20 32 30 31 32 20 2d 20  31 35 3a 30 30 3a 30 37  | 2012 - 15:00:07|
 0030
 root@sbc8548:~# dd if=/dev/mtd3 count=1 bs=48|hexdump -C
 1+0 records in
 1+0 records out
   27 05 19 56 55 2d 42 6f  6f 74 20 32 30 31 32 2e  |'..VU-Boot 2012.|
 0010  31 30 2d 64 69 72 74 79  20 28 4a 61 6e 20 31 39  |10-dirty (Jan 19|
 0020  20 32 30 31 33 20 2d 20  31 39 3a 34 30 3a 31 31  | 2013 - 19:40:11|
 0030
 root@sbc8548:~#

Note that in the latter, the larger SODIMM device appears 1st,
as mtd0 and mtd1, as indicated in the sizes, and in the date
of the u-boot image.

The kernel configuration is the same in both cases; only the dtb
needs to be changed in accordance with the JP12/SW2.8 settings.

Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/configs/85xx/sbc8548_defconfig | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/arch/powerpc/configs/85xx/sbc8548_defconfig 
b/arch/powerpc/configs/85xx/sbc8548_defconfig
index 5b2b651..008a7a4 100644
--- a/arch/powerpc/configs/85xx/sbc8548_defconfig
+++ b/arch/powerpc/configs/85xx/sbc8548_defconfig
@@ -55,3 +55,22 @@ CONFIG_ROOT_NFS=y
 # CONFIG_RCU_CPU_STALL_DETECTOR is not set
 CONFIG_SYSCTL_SYSCALL_CHECK=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_MTD=y
+CONFIG_MTD_OF_PARTS=y
+CONFIG_MTD_CHAR=y
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+CONFIG_MTD_CFI=y
+CONFIG_MTD_GEN_PROBE=y
+CONFIG_MTD_CFI_ADV_OPTIONS=y
+CONFIG_MTD_CFI_NOSWAP=y
+CONFIG_MTD_CFI_GEOMETRY=y
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+CONFIG_MTD_CFI_I4=y
+CONFIG_MTD_CFI_INTELEXT=y
+CONFIG_MTD_CFI_UTIL=y
+CONFIG_MTD_PHYSMAP_OF=y
-- 
1.8.1

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


[PATCH 0/4] powerpc: update sbc8548 flash/mtd settings

2013-01-23 Thread Paul Gortmaker
The sbc8548 dts information for flash was out of date with respect
to u-boot configuration changes made just over a year ago.  However
MTD support wasn't enabled by default, so the stale information
wasn't really an issue.

Here we update that information, split the dts file to allow
sharing the common blocks between the two possible flash
mappings, add the second mapping for when the jumpers are
configured for booting off alternate flash, and add the
necessary MTD settings to the defconfig, so that ease of
use out of the box is improved.

Thanks,
Paul

---

The following changes since commit 7d1f9aeff1ee4a20b1aeb377dd0f579fe9647619:

  Linux 3.8-rc4 (2013-01-17 19:25:45 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux.git sbc8548-flash

for you to fetch changes up to e43fbd09e84ad455f84bfd9c317c94d9dac84e31:

  powerpc: enable MTD options in sbc8548 defconfig (2013-01-23 14:49:10 -0500)

----
Paul Gortmaker (4):
  powerpc: split sbc8548 dts file into pre and post chunks
  powerpc: update sbc8548 flash information to match recent u-boot
  powerpc: add alternate dts file for sbc8548 boot via SODIMM
  powerpc: enable MTD options in sbc8548 defconfig

 arch/powerpc/boot/dts/sbc8548-altflash.dts  | 115 +
 arch/powerpc/boot/dts/sbc8548-post.dtsi | 295 +++
 arch/powerpc/boot/dts/sbc8548-pre.dtsi  |  52 
 arch/powerpc/boot/dts/sbc8548.dts   | 356 ++--
 arch/powerpc/configs/85xx/sbc8548_defconfig |  19 ++
 5 files changed, 500 insertions(+), 337 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/sbc8548-altflash.dts
 create mode 100644 arch/powerpc/boot/dts/sbc8548-post.dtsi
 create mode 100644 arch/powerpc/boot/dts/sbc8548-pre.dtsi
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH 1/4] powerpc: split sbc8548 dts file into pre and post chunks

2013-01-23 Thread Paul Gortmaker
Updates to u-boot allow this board to boot off of either
the 8MB soldered on flash, or the 64MB SODIMM flash.

This is achieved by changing JP12 and SW2.8 which in turn
swaps which flash device appears on /CS0 and /CS6 respectively.

Since the flash devices are not the same size, this also
changes the MTD memory map layout on the local bus.

Here we split the common chunks out into a pre and post
include, so they can be reused by an upcoming "alternative
boot" dts file; leaving only the local bus chunk behind.

No content changes are made at this point - it is just purely
the move to using include files.

Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/boot/dts/sbc8548-post.dtsi | 295 +
 arch/powerpc/boot/dts/sbc8548-pre.dtsi  |  52 ++
 arch/powerpc/boot/dts/sbc8548.dts   | 322 +---
 3 files changed, 351 insertions(+), 318 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/sbc8548-post.dtsi
 create mode 100644 arch/powerpc/boot/dts/sbc8548-pre.dtsi

diff --git a/arch/powerpc/boot/dts/sbc8548-post.dtsi 
b/arch/powerpc/boot/dts/sbc8548-post.dtsi
new file mode 100644
index 000..33a47e2
--- /dev/null
+++ b/arch/powerpc/boot/dts/sbc8548-post.dtsi
@@ -0,0 +1,295 @@
+/*
+ * SBC8548 Device Tree Source
+ *
+ * Copyright 2007 Wind River Systems Inc.
+ *
+ * Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * 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.
+ */
+
+/{
+   soc8548@e000 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   device_type = "soc";
+   ranges = <0x 0xe000 0x0010>;
+   bus-frequency = <0>;
+   compatible = "simple-bus";
+
+   ecm-law@0 {
+   compatible = "fsl,ecm-law";
+   reg = <0x0 0x1000>;
+   fsl,num-laws = <10>;
+   };
+
+   ecm@1000 {
+   compatible = "fsl,mpc8548-ecm", "fsl,ecm";
+   reg = <0x1000 0x1000>;
+   interrupts = <17 2>;
+   interrupt-parent = <&mpic>;
+   };
+
+   memory-controller@2000 {
+   compatible = "fsl,mpc8548-memory-controller";
+   reg = <0x2000 0x1000>;
+   interrupt-parent = <&mpic>;
+   interrupts = <0x12 0x2>;
+   };
+
+   L2: l2-cache-controller@2 {
+   compatible = "fsl,mpc8548-l2-cache-controller";
+   reg = <0x2 0x1000>;
+   cache-line-size = <0x20>;   // 32 bytes
+   cache-size = <0x8>; // L2, 512K
+   interrupt-parent = <&mpic>;
+   interrupts = <0x10 0x2>;
+   };
+
+   i2c@3000 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   cell-index = <0>;
+   compatible = "fsl-i2c";
+   reg = <0x3000 0x100>;
+   interrupts = <0x2b 0x2>;
+   interrupt-parent = <&mpic>;
+   dfsrr;
+   };
+
+   i2c@3100 {
+   #address-cells = <1>;
+   #size-cells = <0>;
+   cell-index = <1>;
+   compatible = "fsl-i2c";
+   reg = <0x3100 0x100>;
+   interrupts = <0x2b 0x2>;
+   interrupt-parent = <&mpic>;
+   dfsrr;
+   };
+
+   dma@21300 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   compatible = "fsl,mpc8548-dma", "fsl,eloplus-dma";
+   reg = <0x21300 0x4>;
+   ranges = <0x0 0x21100 0x200>;
+   cell-index = <0>;
+   dma-channel@0 {
+   compatible = "fsl,mpc8548-dma-channel",
+   "fsl,eloplus-dma-channel";
+   reg = <0x0 0x80>;
+   cell-index = <0>;
+   interrupt-parent =

[PATCH 2/4] powerpc: update sbc8548 flash information to match recent u-boot

2013-01-23 Thread Paul Gortmaker
The original memory map for the sbc8548 had the 64MB SODIMM flash
device misaligned by 8MB to allow a window of address space for
the soldered on 8MB device -- i.e.

 start   end CS   width   Desc.
 --
 fb80_   ff7f_   CS6 32  SODIMM flash (64MB)
 ff80_   _   CS0 8   Boot flash (8MB)

However, if we want to change the configuration so that it boots
off the 64MB flash, it is in turn then aligned with a 64MB boundary,
starting at fc00_ (and the 8MB @ fb80_ -> fbff_).

This makes for complicated updates, since what is the beginning
of the physical device is 8MB into its address space in the default
configuration shown above.

This issue was fixed as of u-boot commit 3fd673cf363bc86ed42eff713d4
("sbc8548: relocate 64MB user flash to sane boundary") -- in which
the SODIMM was mapped to ec00_ (natively aligned under efff_)
and so when JP12/SW2.8 are switched, it will be a a simple 0xec --> 0xfc
mapping between the two instances.

Here we make the associated changes in the localbus flash memory
map in the dts file:  indicating the 64MB device starts at ec00_
and that the tail end of the 64MB device (last 2 sectors) can contain
a bootloader image.

The partitions for both flash devices get a clean-up; there were
non-meaningful assignments in there that probably originated from
the MPC8548CDS on which the file was based on.  Now there is just
the categorization of free space and bootloader images.

Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/boot/dts/sbc8548.dts | 34 +++---
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/boot/dts/sbc8548.dts 
b/arch/powerpc/boot/dts/sbc8548.dts
index ad8dc68..1df2a09 100644
--- a/arch/powerpc/boot/dts/sbc8548.dts
+++ b/arch/powerpc/boot/dts/sbc8548.dts
@@ -28,23 +28,25 @@
  0x3 0x0 0xf000 0x0400 /*64MB SDRAM*/
  0x4 0x0 0xf400 0x0400 /*64MB SDRAM*/
  0x5 0x0 0xf800 0x00b1 /* EPLD */
- 0x6 0x0 0xfb80 0x0400>;   /*64MB Flash*/
+ 0x6 0x0 0xec00 0x0400>;   /*64MB Flash*/
 
 
flash@0,0 {
#address-cells = <1>;
#size-cells = <1>;
-   compatible = "cfi-flash";
+   compatible = "intel,JS28F640", "cfi-flash";
reg = <0x0 0x0 0x80>;
bank-width = <1>;
device-width = <1>;
partition@0x0 {
label = "space";
-   reg = <0x 0x0010>;
+   /* FF80 -> FFF9 */
+   reg = <0x 0x007a>;
};
-   partition@0x10 {
+   partition@0x7a {
label = "bootloader";
-   reg = <0x0010 0x0070>;
+   /* FFFA ->  */
+   reg = <0x007a 0x0006>;
read-only;
};
};
@@ -87,26 +89,20 @@
#address-cells = <1>;
#size-cells = <1>;
reg = <0x6 0x0 0x0400>;
-   compatible = "cfi-flash";
+   compatible = "intel,JS28F128", "cfi-flash";
bank-width = <4>;
device-width = <1>;
partition@0x0 {
+   label = "space";
+   /* EC00 -> EFEF */
+   reg = <0x 0x03f0>;
+   };
+   partition@0x03f0 {
label = "bootloader";
-   reg = <0x 0x0010>;
+   /* EFF0 -> EFFF */
+   reg = <0x03f0 0x0010>;
read-only;
};
-   partition@0x0010 {
-   label = "file-system";
-   reg = <0x0010 0x01f0>;
-   };
-   partition@0x0200 {
-   label = "boo

[PATCH 3/4] powerpc: add alternate dts file for sbc8548 boot via SODIMM

2013-01-23 Thread Paul Gortmaker
By moving the two JP12 jumpers 90 degrees, and switching the
setting of SW2.8, the sbc8548 can be configured to boot off
the alternate 64MB SODIMM, which when populated with u-boot
can be a handy recovery option, in case the u-boot in the
8MB soldered on flash gets corrupted.  Here we add an alternate
dts file to match that configuration.

To better highlight the differences, the output from the u-boot
"fli" command is shown for the normal configuration and then
the alternate configuration.

Normal:
 ---
Bank # 1: CFI conformant flash (8 x 8)  Size: 8 MB in 64 Sectors
  Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x17
  Erase timeout: 4096 ms, write timeout: 1 ms
  Buffer write timeout: 2 ms, buffer size: 32 bytes

  Sector Start Addresses:
  FF80 E  FF82 E  FF84 E  FF86 E  FF88 E
 [...]
  FFEE E  FFF0 E  FFF2 E  FFF4 E  FFF6 E
  FFF8FFFA   RO   FFFC   RO   FFFE   RO

Bank # 2: CFI conformant flash (32 x 8)  Size: 64 MB in 128 Sectors
  Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18
  Erase timeout: 4096 ms, write timeout: 1 ms
  Buffer write timeout: 2 ms, buffer size: 32 bytes

  Sector Start Addresses:
  EC00 E  EC08 E  EC10 E  EC18 E  EC20 E
 [...]
  EFC0 E  EFC8 E  EFD0 E  EFD8 E  EFE0 E
  EFE8 E  EFF0EFF8
 ---

Alternate:
 ---
Bank # 1: CFI conformant flash (32 x 8)  Size: 64 MB in 128 Sectors
  Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x18
  Erase timeout: 4096 ms, write timeout: 1 ms
  Buffer write timeout: 2 ms, buffer size: 32 bytes

  Sector Start Addresses:
  FC00 E  FC08 E  FC10 E  FC18 E  FC20 E
 [...]
  FFC0 E  FFC8 E  FFD0 E  FFD8 E  FFE0 E
  FFE8 E  FFF0   RO   FFF8   RO

Bank # 2: CFI conformant flash (8 x 8)  Size: 8 MB in 64 Sectors
  Intel Extended command set, Manufacturer ID: 0x89, Device ID: 0x17
  Erase timeout: 4096 ms, write timeout: 1 ms
  Buffer write timeout: 2 ms, buffer size: 32 bytes

  Sector Start Addresses:
  EF80 E  EF82 E  EF84 E  EF86 E  EF88 E
 [...]
  EFEE E  EFF0 E  EFF2 E  EFF4 E  EFF6 E
  EFF8 E  EFFAEFFCEFFE
 ---

Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/boot/dts/sbc8548-altflash.dts | 115 +
 1 file changed, 115 insertions(+)
 create mode 100644 arch/powerpc/boot/dts/sbc8548-altflash.dts

diff --git a/arch/powerpc/boot/dts/sbc8548-altflash.dts 
b/arch/powerpc/boot/dts/sbc8548-altflash.dts
new file mode 100644
index 000..0b38a0d
--- /dev/null
+++ b/arch/powerpc/boot/dts/sbc8548-altflash.dts
@@ -0,0 +1,115 @@
+/*
+ * SBC8548 Device Tree Source
+ *
+ * Configured for booting off the alternate (64MB SODIMM) flash.
+ * Requires switching JP12 jumpers and changing SW2.8 setting.
+ *
+ * Copyright 2013 Wind River Systems Inc.
+ *
+ * Paul Gortmaker (see MAINTAINERS for contact information)
+ *
+ * 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.
+ */
+
+
+/dts-v1/;
+
+/include/ "sbc8548-pre.dtsi"
+
+/{
+   localbus@e000 {
+   #address-cells = <2>;
+   #size-cells = <1>;
+   compatible = "simple-bus";
+   reg = <0xe000 0x5000>;
+   interrupt-parent = <&mpic>;
+
+   ranges = <0x0 0x0 0xfc00 0x0400 /*64MB Flash*/
+ 0x3 0x0 0xf000 0x0400 /*64MB SDRAM*/
+ 0x4 0x0 0xf400 0x0400 /*64MB SDRAM*/
+ 0x5 0x0 0xf800 0x00b1 /* EPLD */
+ 0x6 0x0 0xef80 0x0080>;   /*8MB Flash*/
+
+   flash@0,0 {
+   #address-cells = <1>;
+   #size-cells = <1>;
+   reg = <0x0 0x0 0x0400>;
+   compatible = "intel,JS28F128", "cfi-flash";
+   bank-width = <4>;
+   device-width = <1>;
+   partition@0x0 {
+   label = "space";
+   /* FC00 -> FFEF */
+   reg = <0x 0x03f0>;
+   };
+   partition@0x03f0 {
+   label = 

Re: Gianfar breaks one of my test configs

2013-02-24 Thread Paul Gortmaker
On Sun, Feb 24, 2013 at 9:43 AM, Benjamin Herrenschmidt
 wrote:
> Hi folks !
>
> Current Linus tree as of this morning fails to build with one of my
> (semi-random) test configs (attached):
>
> /home/benh/linux-powerpc-test/drivers/net/ethernet/freescale/gianfar.c: In 
> function 'gfar_netpoll':
> /home/benh/linux-powerpc-test/drivers/net/ethernet/freescale/gianfar.c:2909:32:
>  error: 'struct gfar_priv_grp' has no member named 'interruptTransmit'

I see the problem - it wasn't tested with NET_POLL.   I'll have a fix
out shortly.

Thanks,
Paul.
--

> /home/benh/linux-powerpc-test/drivers/net/ethernet/freescale/gianfar.c:2910:32:
>  error: 'struct gfar_priv_grp' has no member named 'interruptReceive'
> /home/benh/linux-powerpc-test/drivers/net/ethernet/freescale/gianfar.c:2911:32:
>  error: 'struct gfar_priv_grp' has no member named 'interruptError'
> /home/benh/linux-powerpc-test/drivers/net/ethernet/freescale/gianfar.c:2912:35:
>  error: 'struct gfar_priv_grp' has no member named 'interruptTransmit'
> /home/benh/linux-powerpc-test/drivers/net/ethernet/freescale/gianfar.c:2914:31:
>  error: 'struct gfar_priv_grp' has no member named 'interruptError'
> /home/benh/linux-powerpc-test/drivers/net/ethernet/freescale/gianfar.c:2915:31:
>  error: 'struct gfar_priv_grp' has no member named 'interruptReceive'
> /home/benh/linux-powerpc-test/drivers/net/ethernet/freescale/gianfar.c:2916:31:
>  error: 'struct gfar_priv_grp' has no member named 'interruptTransmit'
> /home/benh/linux-powerpc-test/drivers/net/ethernet/freescale/gianfar.c:2920:32:
>  error: 'struct gfar_priv_grp' has no member named 'interruptTransmit'
> /home/benh/linux-powerpc-test/drivers/net/ethernet/freescale/gianfar.c:2921:35:
>  error: 'struct gfar_priv_grp' has no member named 'interruptTransmit'
> /home/benh/linux-powerpc-test/drivers/net/ethernet/freescale/gianfar.c:2923:31:
>  error: 'struct gfar_priv_grp' has no member named 'interruptTransmit'
> make[5]: *** [drivers/net/ethernet/freescale/gianfar.o] Error 1
> make[5]: *** Waiting for unfinished jobs
>
> Cheers,
> Ben.
>
>
> ___
> 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


[PATCH net] gianfar: fix compile fail for NET_POLL=y due to struct packing

2013-02-24 Thread Paul Gortmaker
Commit ee873fda3bec7c668407b837fc5519eb961fcd37 ("gianfar: Pack struct
gfar_priv_grp into three cachelines") moved the irq number and names
off into a separate struct and created accessors for them.  However
it was never tested with NET_POLL enabled, and so some conversions
that were simply overlooked went undetected until now.

Make the netpoll ones also use the gfar_irq() accessors.

Reported-by: Benjamin Herrenschmidt 
Cc: Benjamin Herrenschmidt 
Cc: Claudiu Manoil 
Cc: Jianhua Xie 
Signed-off-by: Paul Gortmaker 
---

[compile tested for sbc8548 with NET_POLL=y]

 drivers/net/ethernet/freescale/gianfar.c | 26 ++
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c 
b/drivers/net/ethernet/freescale/gianfar.c
index 4b5e8a6..d2c5441 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -2906,21 +2906,23 @@ static void gfar_netpoll(struct net_device *dev)
/* If the device has multiple interrupts, run tx/rx */
if (priv->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) {
for (i = 0; i < priv->num_grps; i++) {
-   disable_irq(priv->gfargrp[i].interruptTransmit);
-   disable_irq(priv->gfargrp[i].interruptReceive);
-   disable_irq(priv->gfargrp[i].interruptError);
-   gfar_interrupt(priv->gfargrp[i].interruptTransmit,
-  &priv->gfargrp[i]);
-   enable_irq(priv->gfargrp[i].interruptError);
-   enable_irq(priv->gfargrp[i].interruptReceive);
-   enable_irq(priv->gfargrp[i].interruptTransmit);
+   struct gfar_priv_grp *grp = &priv->gfargrp[i];
+
+   disable_irq(gfar_irq(grp, TX)->irq);
+   disable_irq(gfar_irq(grp, RX)->irq);
+   disable_irq(gfar_irq(grp, ER)->irq);
+   gfar_interrupt(gfar_irq(grp, TX)->irq, grp);
+   enable_irq(gfar_irq(grp, ER)->irq);
+   enable_irq(gfar_irq(grp, RX)->irq);
+   enable_irq(gfar_irq(grp, TX)->irq);
}
} else {
for (i = 0; i < priv->num_grps; i++) {
-   disable_irq(priv->gfargrp[i].interruptTransmit);
-   gfar_interrupt(priv->gfargrp[i].interruptTransmit,
-  &priv->gfargrp[i]);
-   enable_irq(priv->gfargrp[i].interruptTransmit);
+   struct gfar_priv_grp *grp = &priv->gfargrp[i];
+
+   disable_irq(gfar_irq(grp, TX)->irq);
+   gfar_interrupt(gfar_irq(grp, TX)->irq, grp);
+   enable_irq(gfar_irq(grp, TX)->irq);
}
}
 }
-- 
1.8.1.2

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


[PATCH 1/2] powerpc: drop return value from set_breakpoint as it is unused

2014-04-29 Thread Paul Gortmaker
None of the callers check the return value, so it might as
well not have one at all.

Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/include/asm/debug.h | 2 +-
 arch/powerpc/kernel/process.c| 8 
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/include/asm/debug.h b/arch/powerpc/include/asm/debug.h
index d2516308ed1e..1d7f966d3b18 100644
--- a/arch/powerpc/include/asm/debug.h
+++ b/arch/powerpc/include/asm/debug.h
@@ -46,7 +46,7 @@ static inline int debugger_break_match(struct pt_regs *regs) 
{ return 0; }
 static inline int debugger_fault_handler(struct pt_regs *regs) { return 0; }
 #endif
 
-int set_breakpoint(struct arch_hw_breakpoint *brk);
+void set_breakpoint(struct arch_hw_breakpoint *brk);
 #ifdef CONFIG_PPC_ADV_DEBUG_REGS
 extern void do_send_trap(struct pt_regs *regs, unsigned long address,
 unsigned long error_code, int signal_code, int brkpt);
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 31d021506d21..c4e3d50e86f8 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -495,14 +495,14 @@ static inline int set_dawr(struct arch_hw_breakpoint *brk)
return 0;
 }
 
-int set_breakpoint(struct arch_hw_breakpoint *brk)
+void set_breakpoint(struct arch_hw_breakpoint *brk)
 {
__get_cpu_var(current_brk) = *brk;
 
if (cpu_has_feature(CPU_FTR_DAWR))
-   return set_dawr(brk);
-
-   return set_dabr(brk);
+   set_dawr(brk);
+   else
+   set_dabr(brk);
 }
 
 #ifdef CONFIG_PPC64
-- 
1.9.0

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

[PATCH 0/2] Fix smp_processor_id() in preemptible splat

2014-04-29 Thread Paul Gortmaker
This seems to have been around for a while; I tripped over it while
working on testing 3.10-rt with Steven, and then confirmed it still
was an issue on today's mainline. (didn't check -next however...)

I didn't bisect, but it looks like it may have come in from the
changes in v3.9-rc1~100^2~57.  It probably only impacts the older
cores like the 74xx that don't have CONFIG_HAVE_HW_BREAKPOINT,
and I know I haven't booted my sbc8641D in over a year, so no
surprise this went undetected for a while.  Maybe adding a Cc:
stable is warranted?

It is pretty hard to ignore the splats since you get one per process,
so it must be just the older platform never getting much testing.

The 1st patch is just a small cleanup that makes the 2nd patch
a bit smaller.

If the __set_breakpoint() addition isn't liked, then we could
alternatively just wrap the one call site with preempt_dis/en/able.

Paul.
---

Paul Gortmaker (2):
  powerpc: drop return value from set_breakpoint as it is unused
  powerpc: fix smp_processor_id() in preemptible splat in set_breakpoint

 arch/powerpc/include/asm/debug.h |  3 ++-
 arch/powerpc/include/asm/hw_breakpoint.h |  2 +-
 arch/powerpc/kernel/hw_breakpoint.c  |  8 
 arch/powerpc/kernel/process.c| 15 +++
 arch/powerpc/kernel/signal.c |  2 +-
 arch/powerpc/xmon/xmon.c |  2 +-
 6 files changed, 20 insertions(+), 12 deletions(-)

-- 
1.9.0

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

[PATCH 2/2] powerpc: fix smp_processor_id() in preemptible splat in set_breakpoint

2014-04-29 Thread Paul Gortmaker
Currently, on 8641D, which doesn't set CONFIG_HAVE_HW_BREAKPOINT
we get the following splat:

BUG: using smp_processor_id() in preemptible [] code: login/1382
caller is set_breakpoint+0x1c/0xa0
CPU: 0 PID: 1382 Comm: login Not tainted 3.15.0-rc3-00041-g2aafe1a4d451 #1
Call Trace:
[decd5d80] [c0008dc4] show_stack+0x50/0x158 (unreliable)
[decd5dc0] [c03c6fa0] dump_stack+0x7c/0xdc
[decd5de0] [c01f8818] check_preemption_disabled+0xf4/0x104
[decd5e00] [c00086b8] set_breakpoint+0x1c/0xa0
[decd5e10] [c00d4530] flush_old_exec+0x2bc/0x588
[decd5e40] [c011c468] load_elf_binary+0x2ac/0x1164
[decd5ec0] [c00d35f8] search_binary_handler+0xc4/0x1f8
[decd5ef0] [c00d4ee8] do_execve+0x3d8/0x4b8
[decd5f40] [c001185c] ret_from_syscall+0x0/0x38
 --- Exception: c01 at 0xfeee554
LR = 0xfeee7d4

The call path in this case is:

flush_thread
   --> set_debug_reg_defaults
 --> set_breakpoint
   --> __get_cpu_var

Since preemption is enabled in the cleanup of flush thread, and
there is no need to disable it, introduce the distinction between
set_breakpoint and __set_breakpoint, leaving only the flush_thread
instance as the current user of set_breakpoint.

Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/include/asm/debug.h |  1 +
 arch/powerpc/include/asm/hw_breakpoint.h |  2 +-
 arch/powerpc/kernel/hw_breakpoint.c  |  8 
 arch/powerpc/kernel/process.c| 11 +--
 arch/powerpc/kernel/signal.c |  2 +-
 arch/powerpc/xmon/xmon.c |  2 +-
 6 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/include/asm/debug.h b/arch/powerpc/include/asm/debug.h
index 1d7f966d3b18..a954e4975049 100644
--- a/arch/powerpc/include/asm/debug.h
+++ b/arch/powerpc/include/asm/debug.h
@@ -47,6 +47,7 @@ static inline int debugger_fault_handler(struct pt_regs 
*regs) { return 0; }
 #endif
 
 void set_breakpoint(struct arch_hw_breakpoint *brk);
+void __set_breakpoint(struct arch_hw_breakpoint *brk);
 #ifdef CONFIG_PPC_ADV_DEBUG_REGS
 extern void do_send_trap(struct pt_regs *regs, unsigned long address,
 unsigned long error_code, int signal_code, int brkpt);
diff --git a/arch/powerpc/include/asm/hw_breakpoint.h 
b/arch/powerpc/include/asm/hw_breakpoint.h
index eb0f4ac75c4c..ac6432d9be46 100644
--- a/arch/powerpc/include/asm/hw_breakpoint.h
+++ b/arch/powerpc/include/asm/hw_breakpoint.h
@@ -79,7 +79,7 @@ static inline void hw_breakpoint_disable(void)
brk.address = 0;
brk.type = 0;
brk.len = 0;
-   set_breakpoint(&brk);
+   __set_breakpoint(&brk);
 }
 extern void thread_change_pc(struct task_struct *tsk, struct pt_regs *regs);
 
diff --git a/arch/powerpc/kernel/hw_breakpoint.c 
b/arch/powerpc/kernel/hw_breakpoint.c
index b0a1792279bb..0bb5918faaaf 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -72,7 +72,7 @@ int arch_install_hw_breakpoint(struct perf_event *bp)
 * If so, DABR will be populated in single_step_dabr_instruction().
 */
if (current->thread.last_hit_ubp != bp)
-   set_breakpoint(info);
+   __set_breakpoint(info);
 
return 0;
 }
@@ -198,7 +198,7 @@ void thread_change_pc(struct task_struct *tsk, struct 
pt_regs *regs)
 
info = counter_arch_bp(tsk->thread.last_hit_ubp);
regs->msr &= ~MSR_SE;
-   set_breakpoint(info);
+   __set_breakpoint(info);
tsk->thread.last_hit_ubp = NULL;
 }
 
@@ -284,7 +284,7 @@ int __kprobes hw_breakpoint_handler(struct die_args *args)
if (!(info->type & HW_BRK_TYPE_EXTRANEOUS_IRQ))
perf_bp_event(bp, regs);
 
-   set_breakpoint(info);
+   __set_breakpoint(info);
 out:
rcu_read_unlock();
return rc;
@@ -316,7 +316,7 @@ int __kprobes single_step_dabr_instruction(struct die_args 
*args)
if (!(info->type & HW_BRK_TYPE_EXTRANEOUS_IRQ))
perf_bp_event(bp, regs);
 
-   set_breakpoint(info);
+   __set_breakpoint(info);
current->thread.last_hit_ubp = NULL;
 
/*
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index c4e3d50e86f8..bc2d668b68ed 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -495,7 +495,7 @@ static inline int set_dawr(struct arch_hw_breakpoint *brk)
return 0;
 }
 
-void set_breakpoint(struct arch_hw_breakpoint *brk)
+void __set_breakpoint(struct arch_hw_breakpoint *brk)
 {
__get_cpu_var(current_brk) = *brk;
 
@@ -505,6 +505,13 @@ void set_breakpoint(struct arch_hw_breakpoint *brk)
set_dabr(brk);
 }
 
+void set_breakpoint(struct arch_hw_breakpoint *brk)
+{
+   preempt_disable();
+   __set_breakpoint(brk);
+   preempt_enable();
+}
+
 #ifdef CONFIG_PPC64
 DEFINE_PER_CPU(struct cpu_usage, cpu_usage_array);
 #endif
@@ -834,7 +841,7 @@ struct task_stru

mpic build failure for 7447_hpc defconfig (bisected)

2014-01-08 Thread Paul Gortmaker
Commit 446f6d06fab0b49c61887ecbe8286d6aaa796637 ("powerpc/mpic: Properly
set default triggers") breaks the mpc7447_hpc_defconfig as follows:

  CC  arch/powerpc/sysdev/mpic.o
arch/powerpc/sysdev/mpic.c: In function 'mpic_set_irq_type':
arch/powerpc/sysdev/mpic.c:886:9: error: case label does not reduce to an 
integer constant
arch/powerpc/sysdev/mpic.c:890:9: error: case label does not reduce to an 
integer constant
arch/powerpc/sysdev/mpic.c:894:9: error: case label does not reduce to an 
integer constant
arch/powerpc/sysdev/mpic.c:898:9: error: case label does not reduce to an 
integer constant

Looking at the cpp output (gcc 4.7.3 from the kernel.org toolchains), I see:

   case mpic->hw_set[MPIC_IDX_VECPRI_SENSE_EDGE] |
mpic->hw_set[MPIC_IDX_VECPRI_POLARITY_POSITIVE]:

The pointer into an array appears because CONFIG_MPIC_WEIRD=y is set for
this thing.

---
  #ifdef CONFIG_MPIC_WEIRD
  static u32 mpic_infos[][MPIC_IDX_END] = {
[0] = { /* Original OpenPIC compatible MPIC */

  [...]

  #define MPIC_INFO(name) mpic->hw_set[MPIC_IDX_##name]

  #else /* CONFIG_MPIC_WEIRD */

  #define MPIC_INFO(name) MPIC_##name

  #endif /* CONFIG_MPIC_WEIRD */
---


Given it has been broken since 3.4-rc5, is it safe to say MPIC_WEIRD is dead
and unused?  Or should the case be converted to if/else or similar?  Or were
other versions of gcc actually able to "see" constant numbers?

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


[PATCH] powerpc: delete non-required instances of include

2014-01-09 Thread Paul Gortmaker
None of these files are actually using any __init type directives
and hence don't need to include .  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

The one instance where we add an include for init.h covers off
a case where that file was implicitly getting it from another
header which itself didn't need it.

Signed-off-by: Paul Gortmaker 
---

[ build tested for every arch/powerpc/config/* file, on next
  branch of benh/powerpc.git -- v3.13-rc1-92-gdece8ada993e ]

 arch/powerpc/include/asm/paca.h| 1 -
 arch/powerpc/include/asm/ppc_asm.h | 1 -
 arch/powerpc/include/asm/ps3.h | 1 -
 arch/powerpc/include/asm/vio.h | 1 -
 arch/powerpc/kernel/cacheinfo.c| 1 -
 arch/powerpc/kernel/crash.c| 1 -
 arch/powerpc/kernel/eeh_pe.c   | 1 -
 arch/powerpc/kernel/head_64.S  | 1 +
 arch/powerpc/kernel/hw_breakpoint.c| 1 -
 arch/powerpc/kernel/iomap.c| 1 -
 arch/powerpc/kernel/kgdb.c | 1 -
 arch/powerpc/kernel/process.c  | 1 -
 arch/powerpc/kernel/smp-tbsync.c   | 1 -
 arch/powerpc/kernel/syscalls.c | 1 -
 arch/powerpc/kernel/vdso32/vdso32_wrapper.S| 1 -
 arch/powerpc/kernel/vdso64/vdso64_wrapper.S| 1 -
 arch/powerpc/mm/pgtable.c  | 1 -
 arch/powerpc/mm/pgtable_64.c   | 1 -
 arch/powerpc/mm/tlb_hash64.c   | 1 -
 arch/powerpc/oprofile/op_model_7450.c  | 1 -
 arch/powerpc/oprofile/op_model_cell.c  | 1 -
 arch/powerpc/oprofile/op_model_fsl_emb.c   | 1 -
 arch/powerpc/oprofile/op_model_pa6t.c  | 1 -
 arch/powerpc/oprofile/op_model_power4.c| 1 -
 arch/powerpc/oprofile/op_model_rs64.c  | 1 -
 arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c | 1 -
 arch/powerpc/platforms/83xx/suspend.c  | 1 -
 arch/powerpc/platforms/85xx/sgy_cts1000.c  | 1 -
 arch/powerpc/platforms/chrp/smp.c  | 1 -
 arch/powerpc/platforms/embedded6xx/hlwd-pic.c  | 1 -
 arch/powerpc/platforms/pasemi/dma_lib.c| 1 -
 arch/powerpc/platforms/powermac/pfunc_core.c   | 1 -
 arch/powerpc/platforms/powernv/eeh-ioda.c  | 1 -
 arch/powerpc/platforms/pseries/cmm.c   | 1 -
 arch/powerpc/platforms/pseries/dtl.c   | 1 -
 arch/powerpc/sysdev/cpm2_pic.c | 1 -
 arch/powerpc/sysdev/fsl_ifc.c  | 1 -
 arch/powerpc/sysdev/ge/ge_pic.h| 1 -
 arch/powerpc/sysdev/i8259.c| 1 -
 arch/powerpc/sysdev/mpc8xx_pic.c   | 1 -
 arch/powerpc/sysdev/qe_lib/qe_io.c | 1 -
 arch/powerpc/sysdev/qe_lib/ucc.c   | 1 -
 arch/powerpc/sysdev/qe_lib/ucc_fast.c  | 1 -
 arch/powerpc/sysdev/qe_lib/ucc_slow.c  | 1 -
 arch/powerpc/sysdev/udbg_memcons.c | 1 -
 arch/powerpc/sysdev/xics/icp-hv.c  | 1 -
 46 files changed, 1 insertion(+), 45 deletions(-)

diff --git a/arch/powerpc/include/asm/paca.h b/arch/powerpc/include/asm/paca.h
index c3523d1dda58..68bee4636045 100644
--- a/arch/powerpc/include/asm/paca.h
+++ b/arch/powerpc/include/asm/paca.h
@@ -16,7 +16,6 @@
 
 #ifdef CONFIG_PPC64
 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/powerpc/include/asm/ppc_asm.h 
b/arch/powerpc/include/asm/ppc_asm.h
index f595b98079ee..7689e0e98d33 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -4,7 +4,6 @@
 #ifndef _ASM_POWERPC_PPC_ASM_H
 #define _ASM_POWERPC_PPC_ASM_H
 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/powerpc/include/asm/ps3.h b/arch/powerpc/include/asm/ps3.h
index 678a7c1d9cb8..a1bc7e758422 100644
--- a/arch/powerpc/include/asm/ps3.h
+++ b/arch/powerpc/include/asm/ps3.h
@@ -21,7 +21,6 @@
 #if !defined(_ASM_POWERPC_PS3_H)
 #define _ASM_POWERPC_PS3_H
 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/powerpc/include/asm/vio.h b/arch/powerpc/include/asm/vio.h
index 68d0cc998b1b..4f9b7ca0710f 100644
--- a/arch/powerpc/include/asm/vio.h
+++ b/arch/powerpc/include/asm/vio.h
@@ -15,7 +15,6 @@
 #define _ASM_POWERPC_VIO_H
 #ifdef __KERNEL__
 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index 654932727873..abfa011344d9 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -12,7 +12,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index fdcd8f551aff..18d7c80ddeb9 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -17,7 +17,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c
index f9450537e335..1feccd64f955 100644

[PATCH] powerpc: fix 8xx and 6xx final link failures

2014-01-09 Thread Paul Gortmaker
As of commit b81f18e55e9f4ea81759bcb00fea295de679bbe8 ("powerpc/boot:
Only build board support files when required.") the two defconfigs
ep88xc_defconfig and storcenter_defconfig would fail final link as
follows:

  WRAParch/powerpc/boot/dtbImage.ep88xc
arch/powerpc/boot/wrapper.a(mpc8xx.o): In function `mpc885_get_clock':
arch/powerpc/boot/mpc8xx.c:30: undefined reference to `fsl_get_immr'
make[1]: *** [arch/powerpc/boot/dtbImage.ep88xc] Error 1

 ...and...

  WRAParch/powerpc/boot/cuImage.storcenter
arch/powerpc/boot/cuboot-pq2.o: In function `pq2_platform_fixups':
cuboot-pq2.c:(.text+0x324): undefined reference to `fsl_get_immr'
make[1]: *** [arch/powerpc/boot/cuImage.storcenter] Error 1

We need the fsl-soc board files built for these two platforms.

Cc: Tony Breeds 
Cc: Benjamin Herrenschmidt 
Fixes: b81f18e55e9f ("powerpc/boot: Only build board support files when 
required.")
Signed-off-by: Paul Gortmaker 

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index ca7f08c..4676e55 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -71,9 +71,9 @@ src-wlib-y := string.S crt0.S crtsavres.S stdio.c main.c \
uartlite.c mpc52xx-psc.c
 src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c
 src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c
-src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c
+src-wlib-$(CONFIG_8xx) += mpc8xx.c planetcore.c fsl-soc.c
 src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c
-src-wlib-$(CONFIG_EMBEDDED6xx) += mv64x60.c mv64x60_i2c.c ugecon.c
+src-wlib-$(CONFIG_EMBEDDED6xx) += mv64x60.c mv64x60_i2c.c ugecon.c fsl-soc.c
 
 src-plat-y := of.c epapr.c
 src-plat-$(CONFIG_40x) += fixed-head.S ep405.c cuboot-hotfoot.c \
-- 
1.8.5.1

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


[PATCH 0/4] remap non-modular uses of module_init properly

2014-01-13 Thread Paul Gortmaker
The goal is to move module_init/module_exit from init.h and into
module.h -- however in doing so, we uncover several instances in
powerpc code where module_init is used somewhat incorrectly by
non modular code, and a file that needs module.h but isn't sourcing
it.  We need to make these fixups 1st before changing the headers
so that we don't cause build failures.

The changes are largely inert, however we do cause a largely trivial
change in the initcall ordering -- that happens because module_init
is really device_initcall; and yet we shouldn't be using device_initcall
where clearly arch_initcall or subsys_initcall are more appropriate.

Boot tested on sbc8548 on powerpc next branch of today.

Paul Gortmaker (4):
  powerpc: use device_initcall for registering rtc devices
  powerpc: book3s kvm can be modular so it should use module.h
  powerpc: use subsys_initcall for Freescale Local Bus
  powerpc: don't use module_init for non-modular core hugetlb code

 arch/powerpc/kernel/time.c| 2 +-
 arch/powerpc/kvm/book3s.c | 2 +-
 arch/powerpc/mm/hugetlbpage.c | 2 +-
 arch/powerpc/platforms/ps3/time.c | 3 +--
 arch/powerpc/sysdev/fsl_lbc.c | 2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)

-- 
1.8.5.2

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


[PATCH 4/4] powerpc: don't use module_init for non-modular core hugetlb code

2014-01-13 Thread Paul Gortmaker
The hugetlbpage.o is obj-y (always built in).  It will never
be modular, so using module_init as an alias for __initcall is
somewhat misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of arch_initcall (which
makes sense for arch code) will thus change this registration
from level 6-device to level 3-arch (i.e. slightly earlier).
However no observable impact of that small difference has
been observed during testing, or is expected.

Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/mm/hugetlbpage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 90bb6d9409bf..d25c202420da 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -911,7 +911,7 @@ static int __init hugetlbpage_init(void)
return 0;
 }
 #endif
-module_init(hugetlbpage_init);
+arch_initcall(hugetlbpage_init);
 
 void flush_dcache_icache_hugepage(struct page *page)
 {
-- 
1.8.5.2

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


[PATCH 1/4] powerpc: use device_initcall for registering rtc devices

2014-01-13 Thread Paul Gortmaker
Currently these two RTC devices are in core platform code
where it is not possible for them to be modular.  It will
never be modular, so using module_init as an alias for
__initcall can be somewhat misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of device_initcall
directly in this change means that the runtime impact is
zero -- they will remain at level 6 in initcall ordering.

Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/kernel/time.c| 2 +-
 arch/powerpc/platforms/ps3/time.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index afb1b56ef4fa..bee2bb2bbc75 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -1053,4 +1053,4 @@ static int __init rtc_init(void)
return PTR_ERR_OR_ZERO(pdev);
 }
 
-module_init(rtc_init);
+device_initcall(rtc_init);
diff --git a/arch/powerpc/platforms/ps3/time.c 
b/arch/powerpc/platforms/ps3/time.c
index ce73ce865613..791c6142c4a7 100644
--- a/arch/powerpc/platforms/ps3/time.c
+++ b/arch/powerpc/platforms/ps3/time.c
@@ -92,5 +92,4 @@ static int __init ps3_rtc_init(void)
 
return PTR_ERR_OR_ZERO(pdev);
 }
-
-module_init(ps3_rtc_init);
+device_initcall(ps3_rtc_init);
-- 
1.8.5.2

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


[PATCH 3/4] powerpc: use subsys_initcall for Freescale Local Bus

2014-01-13 Thread Paul Gortmaker
The FSL_SOC option is bool, and hence this code is either
present or absent.  It will never be modular, so using
module_init as an alias for __initcall is rather misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of subsys_initcall (which
makes sense for bus code) will thus change this registration
from level 6-device to level 4-subsys (i.e. slightly earlier).
However no observable impact of that small difference has
been observed during testing, or is expected.

Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/sysdev/fsl_lbc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c
index 6bc5a546d49f..9f00e5f84abe 100644
--- a/arch/powerpc/sysdev/fsl_lbc.c
+++ b/arch/powerpc/sysdev/fsl_lbc.c
@@ -388,4 +388,4 @@ static int __init fsl_lbc_init(void)
 {
return platform_driver_register(&fsl_lbc_ctrl_driver);
 }
-module_init(fsl_lbc_init);
+subsys_initcall(fsl_lbc_init);
-- 
1.8.5.2

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


[PATCH 2/4] powerpc: book3s kvm can be modular so it should use module.h

2014-01-13 Thread Paul Gortmaker
KVM support is tristate, so this file should be including
module.h instead of export.h -- it only works currently because
module_init is currently (mis)placed in init.h -- but we are
intending to clean that up and relocate it to module.h

Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/kvm/book3s.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 8912608b7e1b..279459e8a072 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -16,7 +16,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
-- 
1.8.5.2

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


Re: [PATCH V5 0/8] cpuidle/ppc: Enable deep idle states on PowerNV

2014-01-15 Thread Paul Gortmaker
On 14-01-15 03:07 AM, Preeti U Murthy wrote:

[...]

> 
> This patchset is based on mainline commit-id:8ae516aa8b8161254d3,  and the

I figured I'd give this a quick sanity build test for a few
configs, but v3.13-rc1-141-g8ae516aa8b81 seems too old; Ben's
ppc next branch is at v3.13-rc1-160-gfac515db4520 and it fails:

---
$ git am ppc-idle
Applying: powerpc: Free up the slot of PPC_MSG_CALL_FUNC_SINGLE IPI message
Applying: powerpc: Implement tick broadcast IPI as a fixed IPI message
Applying: cpuidle/ppc: Split timer_interrupt() into timer handling and 
interrupt handling routines
error: patch failed: arch/powerpc/kernel/time.c:510
error: arch/powerpc/kernel/time.c: patch does not apply
Patch failed at 0003 cpuidle/ppc: Split timer_interrupt() into timer handling 
and interrupt handling routines
The copy of the patch that failed is found in:
   /home/paul/git/linux-head/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
$ dry-run
patching file arch/powerpc/kernel/time.c
Hunk #3 FAILED at 544.
Hunk #4 FAILED at 554.
Hunk #5 succeeded at 862 (offset 12 lines).
2 out of 5 hunks FAILED -- saving rejects to file arch/powerpc/kernel/time.c.rej


It appears to conflict with:

commit 0215f7d8c53fb192cd4491ede0ece5cca6b5db57
Author: Benjamin Herrenschmidt 
Date:   Tue Jan 14 17:11:39 2014 +1100

powerpc: Fix races with irq_work


Paul.
--

> cpuidle driver for powernv posted by Deepthi Dharwar:
> https://lkml.org/lkml/2014/1/14/172
> 
> 
> Changes in V5:
> -
> The primary change in this version is in Patch[6/8].
> As per the discussions in V4 posting of this patchset, it was decided to
> refine handling the wakeup of CPUs in fast-sleep by doing the following:
> 
> 1. In V4, a polling mechanism was used by the CPU handling broadcast to
> find out the time of next wakeup of the CPUs in deep idle states. V5 avoids
> polling by a way described under PATCH[6/8] in this patchset.
> 
> 2. The mechanism of broadcast handling of CPUs in deep idle in the absence of 
> an
> external wakeup device should be generic and not arch specific code. Hence in 
> this
> version this functionality has been integrated into the tick broadcast 
> framework in
> the kernel unlike before where it was handled in powerpc specific code.
> 
> 3. It was suggested that the "broadcast cpu" can be the time keeping cpu
> itself. However this has challenges of its own:
> 
>  a. The time keeping cpu need not exist when all cpus are idle. Hence there
> are phases in time when time keeping cpu is absent. But for the use case that
> this patchset is trying to address we rely on the presence of a broadcast cpu
> all the time.
> 
>  b. The nomination and un-assignment of the time keeping cpu is not protected
> by a lock today and need not be as well since such is its use case in the
> kernel. However we would need locks if we double up the time keeping cpu as 
> the
> broadcast cpu.
> 
> Hence the broadcast cpu is independent of the time-keeping cpu. However 
> PATCH[6/8]
> proposes a simpler solution to pick a broadcast cpu in this version.
> 
> 
> 
> Changes in V4:
> -
> https://lkml.org/lkml/2013/11/29/97
> 
> 1. Add Fast Sleep CPU idle state on PowerNV.
> 
> 2. Add the required context management for Fast Sleep and the call to OPAL
> to synchronize time base after wakeup from fast sleep.
> 
> 4. Add parsing of CPU idle states from the device tree to populate the
> cpuidle
> state table.
> 
> 5. Rename ambiguous functions in the code around waking up of CPUs from fast
> sleep.
> 
> 6. Fixed a bug in re-programming of the hrtimer that is queued to wakeup the
> CPUs in fast sleep and modified Changelogs.
> 
> 7. Added the ARCH_HAS_TICK_BROADCAST option. This signifies that we have a
> arch specific function to perform broadcast.
> 
> 
> Changes in V3:
> -
> http://thread.gmane.org/gmane.linux.power-management.general/38113
> 
> 1. Fix the way in which a broadcast ipi is handled on the idling cpus. Timer
> handling on a broadcast ipi is being done now without missing out any timer
> stats generation.
> 
> 2. Fix a bug in the programming of the hrtimer meant to do broadcast. Program
> it to trigger at the earlier of a "broadcast period", and the next wakeup
> event. By introducing the "broadcast period" as the maximum period after
> which the broadcast hrtimer can fire, we ensure that we do not miss
> wakeups in corner cases.
> 
> 3. On hotplug of a broadcast cpu, trigger the hrtimer meant to do broadcast
> to fire immediately on the new broadcast cpu. This will ensure we do not miss
> doing a broadcast pending in the nearest future.
> 
> 4. Change the type of allocation from GFP_KERNEL to GFP_NOWAIT while
> initializing bc_hrtimer since we are in an atomic context and cannot sleep.
> 
> 5. Use the broadcast ipi to wakeup the newly nomina

[PATCH] drivers/tty/hvc: don't use module_init in non-modular hyp. console code

2014-01-15 Thread Paul Gortmaker
The HVC_OPAL/RTAS/UDBG options are all bool, and hence their support
is either present or absent.  It will never be modular, so using
module_init as an alias for __initcall is rather misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of device_initcall
directly in this change means that the runtime impact is
zero -- it will remain at level 6 in initcall ordering.

Also the __exitcall functions have been outright deleted since
they are only ever of interest to UML, and UML will never be
using any of this code.

Cc: Richard Weinberger 
Cc: Greg Kroah-Hartman 
Signed-off-by: Paul Gortmaker 

diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
index 6496872e2e47..b01659bd4f7c 100644
--- a/drivers/tty/hvc/hvc_opal.c
+++ b/drivers/tty/hvc/hvc_opal.c
@@ -255,13 +255,7 @@ static int __init hvc_opal_init(void)
/* Register as a vio device to receive callbacks */
return platform_driver_register(&hvc_opal_driver);
 }
-module_init(hvc_opal_init);
-
-static void __exit hvc_opal_exit(void)
-{
-   platform_driver_unregister(&hvc_opal_driver);
-}
-module_exit(hvc_opal_exit);
+device_initcall(hvc_opal_init);
 
 static void udbg_opal_putc(char c)
 {
diff --git a/drivers/tty/hvc/hvc_rtas.c b/drivers/tty/hvc/hvc_rtas.c
index 0069bb86ba49..08c87920b74a 100644
--- a/drivers/tty/hvc/hvc_rtas.c
+++ b/drivers/tty/hvc/hvc_rtas.c
@@ -102,17 +102,7 @@ static int __init hvc_rtas_init(void)
 
return 0;
 }
-module_init(hvc_rtas_init);
-
-/* This will tear down the tty portion of the driver */
-static void __exit hvc_rtas_exit(void)
-{
-   /* Really the fun isn't over until the worker thread breaks down and
-* the tty cleans up */
-   if (hvc_rtas_dev)
-   hvc_remove(hvc_rtas_dev);
-}
-module_exit(hvc_rtas_exit);
+device_initcall(hvc_rtas_init);
 
 /* This will happen prior to module init.  There is no tty at this time? */
 static int __init hvc_rtas_console_init(void)
diff --git a/drivers/tty/hvc/hvc_udbg.c b/drivers/tty/hvc/hvc_udbg.c
index 72228276fe31..9cf573d06a29 100644
--- a/drivers/tty/hvc/hvc_udbg.c
+++ b/drivers/tty/hvc/hvc_udbg.c
@@ -80,14 +80,7 @@ static int __init hvc_udbg_init(void)
 
return 0;
 }
-module_init(hvc_udbg_init);
-
-static void __exit hvc_udbg_exit(void)
-{
-   if (hvc_udbg_dev)
-   hvc_remove(hvc_udbg_dev);
-}
-module_exit(hvc_udbg_exit);
+device_initcall(hvc_udbg_init);
 
 static int __init hvc_udbg_console_init(void)
 {
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index 636c9baad7a5..2dc2831840ca 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -561,18 +561,7 @@ static int __init xen_hvc_init(void)
 #endif
return r;
 }
-
-static void __exit xen_hvc_fini(void)
-{
-   struct xencons_info *entry, *next;
-
-   if (list_empty(&xenconsoles))
-   return;
-
-   list_for_each_entry_safe(entry, next, &xenconsoles, list) {
-   xen_console_remove(entry);
-   }
-}
+device_initcall(xen_hvc_init);
 
 static int xen_cons_init(void)
 {
@@ -598,10 +587,6 @@ static int xen_cons_init(void)
hvc_instantiate(HVC_COOKIE, 0, ops);
return 0;
 }
-
-
-module_init(xen_hvc_init);
-module_exit(xen_hvc_fini);
 console_initcall(xen_cons_init);
 
 #ifdef CONFIG_EARLY_PRINTK
-- 
1.8.5.2

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


[PATCH v2] drivers/tty/hvc: don't use module_init in non-modular hyp. console code

2014-01-15 Thread Paul Gortmaker
The HVC_OPAL/RTAS/UDBG/XEN options are all bool, and hence their support
is either present or absent.  It will never be modular, so using
module_init as an alias for __initcall is rather misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of device_initcall
directly in this change means that the runtime impact is
zero -- it will remain at level 6 in initcall ordering.

Also the __exitcall functions have been outright deleted since
they are only ever of interest to UML, and UML will never be
using any of this code.

Cc: Richard Weinberger 
Cc: Konrad Rzeszutek Wilk 
Cc: Boris Ostrovsky 
Cc: David Vrabel 
Cc: Greg Kroah-Hartman 
Signed-off-by: Paul Gortmaker 
---

[v2: unchanged; just added xen guys to Cc list, as hvc_xen isnt
 hooked into the MAINTAINERS file as of yet, so I forgot them.]

diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
index 6496872e2e47..b01659bd4f7c 100644
--- a/drivers/tty/hvc/hvc_opal.c
+++ b/drivers/tty/hvc/hvc_opal.c
@@ -255,13 +255,7 @@ static int __init hvc_opal_init(void)
/* Register as a vio device to receive callbacks */
return platform_driver_register(&hvc_opal_driver);
 }
-module_init(hvc_opal_init);
-
-static void __exit hvc_opal_exit(void)
-{
-   platform_driver_unregister(&hvc_opal_driver);
-}
-module_exit(hvc_opal_exit);
+device_initcall(hvc_opal_init);
 
 static void udbg_opal_putc(char c)
 {
diff --git a/drivers/tty/hvc/hvc_rtas.c b/drivers/tty/hvc/hvc_rtas.c
index 0069bb86ba49..08c87920b74a 100644
--- a/drivers/tty/hvc/hvc_rtas.c
+++ b/drivers/tty/hvc/hvc_rtas.c
@@ -102,17 +102,7 @@ static int __init hvc_rtas_init(void)
 
return 0;
 }
-module_init(hvc_rtas_init);
-
-/* This will tear down the tty portion of the driver */
-static void __exit hvc_rtas_exit(void)
-{
-   /* Really the fun isn't over until the worker thread breaks down and
-* the tty cleans up */
-   if (hvc_rtas_dev)
-   hvc_remove(hvc_rtas_dev);
-}
-module_exit(hvc_rtas_exit);
+device_initcall(hvc_rtas_init);
 
 /* This will happen prior to module init.  There is no tty at this time? */
 static int __init hvc_rtas_console_init(void)
diff --git a/drivers/tty/hvc/hvc_udbg.c b/drivers/tty/hvc/hvc_udbg.c
index 72228276fe31..9cf573d06a29 100644
--- a/drivers/tty/hvc/hvc_udbg.c
+++ b/drivers/tty/hvc/hvc_udbg.c
@@ -80,14 +80,7 @@ static int __init hvc_udbg_init(void)
 
return 0;
 }
-module_init(hvc_udbg_init);
-
-static void __exit hvc_udbg_exit(void)
-{
-   if (hvc_udbg_dev)
-   hvc_remove(hvc_udbg_dev);
-}
-module_exit(hvc_udbg_exit);
+device_initcall(hvc_udbg_init);
 
 static int __init hvc_udbg_console_init(void)
 {
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index 636c9baad7a5..2dc2831840ca 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -561,18 +561,7 @@ static int __init xen_hvc_init(void)
 #endif
return r;
 }
-
-static void __exit xen_hvc_fini(void)
-{
-   struct xencons_info *entry, *next;
-
-   if (list_empty(&xenconsoles))
-   return;
-
-   list_for_each_entry_safe(entry, next, &xenconsoles, list) {
-   xen_console_remove(entry);
-   }
-}
+device_initcall(xen_hvc_init);
 
 static int xen_cons_init(void)
 {
@@ -598,10 +587,6 @@ static int xen_cons_init(void)
hvc_instantiate(HVC_COOKIE, 0, ops);
return 0;
 }
-
-
-module_init(xen_hvc_init);
-module_exit(xen_hvc_fini);
 console_initcall(xen_cons_init);
 
 #ifdef CONFIG_EARLY_PRINTK
-- 
1.8.5.2

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


[PATCH 11/73] powerpc: book3s KVM can be modular so it should use module.h

2014-01-21 Thread Paul Gortmaker
Even though KVM is bool, KVM_BOOK3S_32 and KVM_BOOK3S_64 are declared
as Kconfig tristate, so this file really should be including
module.h instead of export.h -- it only works currently because
module_init is currently (mis)placed in init.h -- but we are
intending to clean that up and relocate it to module.h

Cc: Gleb Natapov 
Cc: Paolo Bonzini 
Cc: Alexander Graf 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: k...@vger.kernel.org
Cc: kvm-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/kvm/book3s.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 8912608..279459e 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -16,7 +16,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
-- 
1.8.4.1

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


[PATCH 12/73] powerpc: kvm e500/44x is not modular, so don't use module_init

2014-01-21 Thread Paul Gortmaker
In powerpc, CONFIG_KVM is bool, and  so are these three subarch
options, for the 44x and e500 variants.  This means that any
module_exit() calls and functions used by them such as the
kvmppc_booke_exit() are dead code.  Here we remove them.

In addition, rather than use module_init, which is just
__initcall for non-modules, we update those as well.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of subsys_initcall (which
seems to make sense for netfilter code) will thus change this
registration from level 6-device to level 4-subsys (i.e. slightly
earlier).

However no impact of that small difference is expected,
since the arch independent kvm code doesn't trigger any init;
it is the arch initcalls here which actually call kvm_init.

Cc: Gleb Natapov 
Cc: Paolo Bonzini 
Cc: Alexander Graf 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: k...@vger.kernel.org
Cc: kvm-...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/include/asm/kvm_ppc.h |  1 -
 arch/powerpc/kvm/44x.c | 10 +-
 arch/powerpc/kvm/booke.c   |  6 --
 arch/powerpc/kvm/e500.c| 10 +-
 arch/powerpc/kvm/e500mc.c  | 10 +-
 5 files changed, 3 insertions(+), 34 deletions(-)

diff --git a/arch/powerpc/include/asm/kvm_ppc.h 
b/arch/powerpc/include/asm/kvm_ppc.h
index c8317fb..8466df5 100644
--- a/arch/powerpc/include/asm/kvm_ppc.h
+++ b/arch/powerpc/include/asm/kvm_ppc.h
@@ -109,7 +109,6 @@ extern void kvmppc_core_flush_tlb(struct kvm_vcpu *vcpu);
 extern int kvmppc_core_check_requests(struct kvm_vcpu *vcpu);
 
 extern int kvmppc_booke_init(void);
-extern void kvmppc_booke_exit(void);
 
 extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu);
 extern int kvmppc_kvm_pv(struct kvm_vcpu *vcpu);
diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c
index 93221e8..2129fc1 100644
--- a/arch/powerpc/kvm/44x.c
+++ b/arch/powerpc/kvm/44x.c
@@ -222,12 +222,4 @@ static int __init kvmppc_44x_init(void)
 err_out:
return r;
 }
-
-static void __exit kvmppc_44x_exit(void)
-{
-   kvmppc_pr_ops = NULL;
-   kvmppc_booke_exit();
-}
-
-module_init(kvmppc_44x_init);
-module_exit(kvmppc_44x_exit);
+subsys_initcall(kvmppc_44x_init);
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
index 0591e05..49dffa2 100644
--- a/arch/powerpc/kvm/booke.c
+++ b/arch/powerpc/kvm/booke.c
@@ -1995,9 +1995,3 @@ int __init kvmppc_booke_init(void)
 #endif /* !BOOKE_HV */
return 0;
 }
-
-void __exit kvmppc_booke_exit(void)
-{
-   free_pages(kvmppc_booke_handlers, VCPU_SIZE_ORDER);
-   kvm_exit();
-}
diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c
index 497b142..115ef12 100644
--- a/arch/powerpc/kvm/e500.c
+++ b/arch/powerpc/kvm/e500.c
@@ -564,12 +564,4 @@ static int __init kvmppc_e500_init(void)
 err_out:
return r;
 }
-
-static void __exit kvmppc_e500_exit(void)
-{
-   kvmppc_pr_ops = NULL;
-   kvmppc_booke_exit();
-}
-
-module_init(kvmppc_e500_init);
-module_exit(kvmppc_e500_exit);
+subsys_initcall(kvmppc_e500_init);
diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c
index 4132cd2..612c216 100644
--- a/arch/powerpc/kvm/e500mc.c
+++ b/arch/powerpc/kvm/e500mc.c
@@ -382,12 +382,4 @@ static int __init kvmppc_e500mc_init(void)
 err_out:
return r;
 }
-
-static void __exit kvmppc_e500mc_exit(void)
-{
-   kvmppc_pr_ops = NULL;
-   kvmppc_booke_exit();
-}
-
-module_init(kvmppc_e500mc_init);
-module_exit(kvmppc_e500mc_exit);
+subsys_initcall(kvmppc_e500mc_init);
-- 
1.8.4.1

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


[PATCH 13/73] powerpc: use subsys_initcall for Freescale Local Bus

2014-01-21 Thread Paul Gortmaker
The FSL_SOC option is bool, and hence this code is either
present or absent.  It will never be modular, so using
module_init as an alias for __initcall is rather misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of subsys_initcall (which
makes sense for bus code) will thus change this registration
from level 6-device to level 4-subsys (i.e. slightly earlier).
However no observable impact of that small difference has
been observed during testing, or is expected.

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Scott Wood 
Acked-by: Scott Wood 
Cc: Kumar Gala 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/sysdev/fsl_lbc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/sysdev/fsl_lbc.c b/arch/powerpc/sysdev/fsl_lbc.c
index d631022..38138cf 100644
--- a/arch/powerpc/sysdev/fsl_lbc.c
+++ b/arch/powerpc/sysdev/fsl_lbc.c
@@ -407,4 +407,4 @@ static int __init fsl_lbc_init(void)
 {
return platform_driver_register(&fsl_lbc_ctrl_driver);
 }
-module_init(fsl_lbc_init);
+subsys_initcall(fsl_lbc_init);
-- 
1.8.4.1

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


[PATCH 14/73] powerpc: don't use module_init for non-modular core hugetlb code

2014-01-21 Thread Paul Gortmaker
The hugetlbpage.o is obj-y (always built in).  It will never
be modular, so using module_init as an alias for __initcall is
somewhat misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of arch_initcall (which
makes sense for arch code) will thus change this registration
from level 6-device to level 3-arch (i.e. slightly earlier).
However no observable impact of that small difference has
been observed during testing, or is expected.

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/mm/hugetlbpage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
index 90bb6d9..d25c202 100644
--- a/arch/powerpc/mm/hugetlbpage.c
+++ b/arch/powerpc/mm/hugetlbpage.c
@@ -911,7 +911,7 @@ static int __init hugetlbpage_init(void)
return 0;
 }
 #endif
-module_init(hugetlbpage_init);
+arch_initcall(hugetlbpage_init);
 
 void flush_dcache_icache_hugepage(struct page *page)
 {
-- 
1.8.4.1

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


[PATCH 15/73] powerpc: don't use module_init in non-modular 83xx suspend code

2014-01-21 Thread Paul Gortmaker
The suspend.o is built for SUSPEND -- which is bool, and hence
this code is either present or absent.  It will never be modular,
so using module_init as an alias for __initcall can be somewhat
misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of device_initcall
directly in this change means that the runtime impact is
zero -- it will remain at level 6 in initcall ordering.

Cc: Kumar Gala 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/platforms/83xx/suspend.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/suspend.c 
b/arch/powerpc/platforms/83xx/suspend.c
index 4b4c081..e9f07c6 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -446,5 +446,4 @@ static int pmc_init(void)
 {
return platform_driver_register(&pmc_driver);
 }
-
-module_init(pmc_init);
+device_initcall(pmc_init);
-- 
1.8.4.1

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


[PATCH RFC 00/73] tree-wide: clean up some no longer required #include

2014-01-21 Thread Paul Gortmaker
continue daily re-test on linux-next across ~10 different
arch, using allyesconfig, allmodconfig and arch specific defconfigs
for things like mips/arm/powerpc; as I have been doing for a while.

Where: This work exists as a queue of patches that I apply to
linux-next; since the changes are fixing some things that currently
can only be found there.  The patch series can be found at:

   http://git.kernel.org/cgit/linux/kernel/git/paulg/init.git
   git://git.kernel.org/pub/scm/linux/kernel/git/paulg/init.git

The patches are not in strict chronological order, since when I've
found a header change causes a build regression that is due to an
implicit dependency/inclusion, I place the dependency fix before the
header change that caused it, so that bisection is preserved.

I've avoided annoying Stephen with another queue of patches for
linux-next while the development content was in flux, but now that
the merge window has opened, and new additions are fewer, perhaps he
wouldn't mind tacking it on the end...  Stephen?

In order to reduce the size of the overall queue here, I have already
put some dependency-free changes through maintainer trees after
re-testing them on whatever their development baseline was.  That made
sense for the larger ones (drivers/[net,usb,input] some arch trees...)
and for the kernel/ mm/ and fs/ ones where the changes were less
trivial and an earlier review was desired. But that independent treatment
doesn't scale for handling all the commits -- hence ~1400 of the
full ~2k of init.h removals remain here in this series.

What: The audit for removal of extra init.h lines has covered
drivers/, all of the main architectures (and some of the more fringe
ones), and core dirs like mm/ fs/ and kernel/ too.  The removals from
include/ itself are probably the most valuable, in terms of reducing
the amount of stuff we needlessly feed CPP.  There is probably more
fringe ones to be found, but this covers the majority of them.
Additional ones can be fed in later (through the trivial tree perhaps)
as desired.

Build coverage (from memory) has included, but is not limited to:

  allyesconfig, allmodconfig:
x86, x86_64, ia64, s390, arm, mips, sparc, powerpc
  arch specifc arch//config/*config files:
arm, mips, powerpc
  defconfig:
(all of the above), c6x, parisc, uml, tile, c6x, blackfin, ...

and it will continue to take place for the next ~2wks, until I can
reliably apply the queue to master and submit a pull request.

Thanks for reading this far, and thanks to those who have merged init.h
cleanup commits already!  Additional comments, reviews and acks welcomed.

Paul.
---

Cc: linux-al...@vger.kernel.org
Cc: linux-a...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-i...@vger.kernel.org
Cc: linux-m...@lists.linux-m68k.org
Cc: linux-m...@linux-mips.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-s...@vger.kernel.org
Cc: sparcli...@vger.kernel.org
Cc: x...@kernel.org
Cc: net...@vger.kernel.org
Cc: k...@vger.kernel.org
Cc: s...@canb.auug.org.au
Cc: ru...@rustcorp.com.au
Cc: gre...@linuxfoundation.org
Cc: a...@linux-foundation.org
Cc: torva...@linux-foundation.org

Paul Gortmaker (73):
  init: delete the __cpuinit related stubs
  mm: replace module_init usages with subsys_initcall in nommu.c
  fs/notify: don't use module_init for non-modular inotify_user code
  netfilter: don't use module_init/exit in core IPV4 code
  x86: don't use module_init in non-modular intel_mid_vrtc.c
  x86: don't use module_init for non-modular core bootflag code
  x86: replace __init_or_module with __init in non-modular vsmp_64.c
  drivers/tty/hvc: don't use module_init in non-modular hyp. console code
  staging: don't use module_init in non-modular ion_dummy_driver.c
  powerpc: use device_initcall for registering rtc devices
  powerpc: book3s KVM can be modular so it should use module.h
  powerpc: kvm e500/44x is not modular, so don't use module_init
  powerpc: use subsys_initcall for Freescale Local Bus
  powerpc: don't use module_init for non-modular core hugetlb code
  powerpc: don't use module_init in non-modular 83xx suspend code
  arm: include module.h in drivers/bus/omap_l3_smx.c
  arm: fix implicit module.h use in mach-at91 gpio.h
  arm: fix implicit #include  in entry asm.
  arm: mach-s3c64xx mach-crag6410-module.c is not modular
  arm: use subsys_initcall in non-modular pl320 IPC code
  arm: don't use module_init in non-modular mach-vexpress/spc.c code
  alpha: don't use module_init for non-modular core code
  sparc: don't use module_init in non-modular pci.c code
  m68k: don't use module_init in non-modular mvme16x/rtc.c code
  ia64: don't use module_init for non-modular core kernel/mca.c code
  ia64: don't use module_init in non-modular sim/simscsi.c code
  drivers/clk: don't use module_init in clk-nomadik.c which is non-modular
  cpuidle: don't use modular platform register i

[PATCH 39/73] powerpc: delete another unrequired instance of

2014-01-21 Thread Paul Gortmaker
Most were already deleted in the 1st pass audit; this instance
showed up more recently.

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/sysdev/indirect_pci.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/powerpc/sysdev/indirect_pci.c 
b/arch/powerpc/sysdev/indirect_pci.c
index 1f6c570..66f5fd1 100644
--- a/arch/powerpc/sysdev/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
@@ -13,7 +13,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
-- 
1.8.4.1

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


[PATCH 66/73] drivers/macintosh: delete non-required instances of include

2014-01-21 Thread Paul Gortmaker
None of these files are actually using any __init type directives
and hence don't need to include .  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Cc: Benjamin Herrenschmidt 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 drivers/macintosh/adb-iop.c | 1 -
 drivers/macintosh/ams/ams-input.c   | 1 -
 drivers/macintosh/macio-adb.c   | 1 -
 drivers/macintosh/via-macii.c   | 1 -
 drivers/macintosh/via-pmu68k.c  | 1 -
 drivers/macintosh/windfarm_ad7417_sensor.c  | 1 -
 drivers/macintosh/windfarm_fcu_controls.c   | 1 -
 drivers/macintosh/windfarm_lm75_sensor.c| 1 -
 drivers/macintosh/windfarm_max6690_sensor.c | 1 -
 drivers/macintosh/windfarm_smu_sat.c| 1 -
 10 files changed, 10 deletions(-)

diff --git a/drivers/macintosh/adb-iop.c b/drivers/macintosh/adb-iop.c
index f5f4da3..2c242f7 100644
--- a/drivers/macintosh/adb-iop.c
+++ b/drivers/macintosh/adb-iop.c
@@ -16,7 +16,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include  
diff --git a/drivers/macintosh/ams/ams-input.c 
b/drivers/macintosh/ams/ams-input.c
index 2edae7d..b1bdd48 100644
--- a/drivers/macintosh/ams/ams-input.c
+++ b/drivers/macintosh/ams/ams-input.c
@@ -14,7 +14,6 @@
 
 #include 
 #include 
-#include 
 #include 
 
 #include "ams.h"
diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c
index 87de8d9..c8fcac0 100644
--- a/drivers/macintosh/macio-adb.c
+++ b/drivers/macintosh/macio-adb.c
@@ -14,7 +14,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 struct preg {
diff --git a/drivers/macintosh/via-macii.c b/drivers/macintosh/via-macii.c
index 3725f08..fd27da3 100644
--- a/drivers/macintosh/via-macii.c
+++ b/drivers/macintosh/via-macii.c
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c
index a00ee41..d2e252e 100644
--- a/drivers/macintosh/via-pmu68k.c
+++ b/drivers/macintosh/via-pmu68k.c
@@ -25,7 +25,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
diff --git a/drivers/macintosh/windfarm_ad7417_sensor.c 
b/drivers/macintosh/windfarm_ad7417_sensor.c
index 7c28b71..76715a7 100644
--- a/drivers/macintosh/windfarm_ad7417_sensor.c
+++ b/drivers/macintosh/windfarm_ad7417_sensor.c
@@ -11,7 +11,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/macintosh/windfarm_fcu_controls.c 
b/drivers/macintosh/windfarm_fcu_controls.c
index 0226b79..50ba619 100644
--- a/drivers/macintosh/windfarm_fcu_controls.c
+++ b/drivers/macintosh/windfarm_fcu_controls.c
@@ -12,7 +12,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c 
b/drivers/macintosh/windfarm_lm75_sensor.c
index 590214b..704dd2e 100644
--- a/drivers/macintosh/windfarm_lm75_sensor.c
+++ b/drivers/macintosh/windfarm_lm75_sensor.c
@@ -12,7 +12,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c 
b/drivers/macintosh/windfarm_max6690_sensor.c
index 87e439b..a3504d3 100644
--- a/drivers/macintosh/windfarm_max6690_sensor.c
+++ b/drivers/macintosh/windfarm_max6690_sensor.c
@@ -8,7 +8,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/drivers/macintosh/windfarm_smu_sat.c 
b/drivers/macintosh/windfarm_smu_sat.c
index ad6223e..b6d70d2 100644
--- a/drivers/macintosh/windfarm_smu_sat.c
+++ b/drivers/macintosh/windfarm_smu_sat.c
@@ -10,7 +10,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-- 
1.8.4.1

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


[PATCH 10/73] powerpc: use device_initcall for registering rtc devices

2014-01-21 Thread Paul Gortmaker
Currently these two RTC devices are in core platform code
where it is not possible for them to be modular.  It will
never be modular, so using module_init as an alias for
__initcall can be somewhat misleading.

Fix this up now, so that we can relocate module_init from
init.h into module.h in the future.  If we don't do this, we'd
have to add module.h to obviously non-modular code, and that
would be a worse thing.

Note that direct use of __initcall is discouraged, vs. one
of the priority categorized subgroups.  As __initcall gets
mapped onto device_initcall, our use of device_initcall
directly in this change means that the runtime impact is
zero -- they will remain at level 6 in initcall ordering.

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Geoff Levand 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/kernel/time.c| 2 +-
 arch/powerpc/platforms/ps3/time.c | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index b3dab20..63b34fc 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -1064,4 +1064,4 @@ static int __init rtc_init(void)
return PTR_ERR_OR_ZERO(pdev);
 }
 
-module_init(rtc_init);
+device_initcall(rtc_init);
diff --git a/arch/powerpc/platforms/ps3/time.c 
b/arch/powerpc/platforms/ps3/time.c
index ce73ce8..791c614 100644
--- a/arch/powerpc/platforms/ps3/time.c
+++ b/arch/powerpc/platforms/ps3/time.c
@@ -92,5 +92,4 @@ static int __init ps3_rtc_init(void)
 
return PTR_ERR_OR_ZERO(pdev);
 }
-
-module_init(ps3_rtc_init);
+device_initcall(ps3_rtc_init);
-- 
1.8.4.1

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


Re: [PATCH 12/73] powerpc: kvm e500/44x is not modular, so don't use module_init

2014-01-21 Thread Paul Gortmaker
On 14-01-21 04:22 PM, Paul Gortmaker wrote:
> In powerpc, CONFIG_KVM is bool, and  so are these three subarch
> options, for the 44x and e500 variants.  This means that any
> module_exit() calls and functions used by them such as the
> kvmppc_booke_exit() are dead code.  Here we remove them.
> 
> In addition, rather than use module_init, which is just
> __initcall for non-modules, we update those as well.
> 
> Note that direct use of __initcall is discouraged, vs. one
> of the priority categorized subgroups.  As __initcall gets
> mapped onto device_initcall, our use of subsys_initcall (which
> seems to make sense for netfilter code) will thus change this

I've fixed the above --  s/netfilter/PPC KVM/

The risks of recycling commit logs...

Paul.
--

> registration from level 6-device to level 4-subsys (i.e. slightly
> earlier).
> 
> However no impact of that small difference is expected,
> since the arch independent kvm code doesn't trigger any init;
> it is the arch initcalls here which actually call kvm_init.
> 
> Cc: Gleb Natapov 
> Cc: Paolo Bonzini 
> Cc: Alexander Graf 
> Cc: Benjamin Herrenschmidt 
> Cc: Paul Mackerras 
> Cc: k...@vger.kernel.org
> Cc: kvm-...@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Paul Gortmaker 
> ---
>  arch/powerpc/include/asm/kvm_ppc.h |  1 -
>  arch/powerpc/kvm/44x.c | 10 +-
>  arch/powerpc/kvm/booke.c   |  6 --
>  arch/powerpc/kvm/e500.c| 10 +-
>  arch/powerpc/kvm/e500mc.c  | 10 +-
>  5 files changed, 3 insertions(+), 34 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/kvm_ppc.h 
> b/arch/powerpc/include/asm/kvm_ppc.h
> index c8317fb..8466df5 100644
> --- a/arch/powerpc/include/asm/kvm_ppc.h
> +++ b/arch/powerpc/include/asm/kvm_ppc.h
> @@ -109,7 +109,6 @@ extern void kvmppc_core_flush_tlb(struct kvm_vcpu *vcpu);
>  extern int kvmppc_core_check_requests(struct kvm_vcpu *vcpu);
>  
>  extern int kvmppc_booke_init(void);
> -extern void kvmppc_booke_exit(void);
>  
>  extern void kvmppc_core_destroy_mmu(struct kvm_vcpu *vcpu);
>  extern int kvmppc_kvm_pv(struct kvm_vcpu *vcpu);
> diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c
> index 93221e8..2129fc1 100644
> --- a/arch/powerpc/kvm/44x.c
> +++ b/arch/powerpc/kvm/44x.c
> @@ -222,12 +222,4 @@ static int __init kvmppc_44x_init(void)
>  err_out:
>   return r;
>  }
> -
> -static void __exit kvmppc_44x_exit(void)
> -{
> - kvmppc_pr_ops = NULL;
> - kvmppc_booke_exit();
> -}
> -
> -module_init(kvmppc_44x_init);
> -module_exit(kvmppc_44x_exit);
> +subsys_initcall(kvmppc_44x_init);
> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
> index 0591e05..49dffa2 100644
> --- a/arch/powerpc/kvm/booke.c
> +++ b/arch/powerpc/kvm/booke.c
> @@ -1995,9 +1995,3 @@ int __init kvmppc_booke_init(void)
>  #endif /* !BOOKE_HV */
>   return 0;
>  }
> -
> -void __exit kvmppc_booke_exit(void)
> -{
> - free_pages(kvmppc_booke_handlers, VCPU_SIZE_ORDER);
> - kvm_exit();
> -}
> diff --git a/arch/powerpc/kvm/e500.c b/arch/powerpc/kvm/e500.c
> index 497b142..115ef12 100644
> --- a/arch/powerpc/kvm/e500.c
> +++ b/arch/powerpc/kvm/e500.c
> @@ -564,12 +564,4 @@ static int __init kvmppc_e500_init(void)
>  err_out:
>   return r;
>  }
> -
> -static void __exit kvmppc_e500_exit(void)
> -{
> - kvmppc_pr_ops = NULL;
> - kvmppc_booke_exit();
> -}
> -
> -module_init(kvmppc_e500_init);
> -module_exit(kvmppc_e500_exit);
> +subsys_initcall(kvmppc_e500_init);
> diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c
> index 4132cd2..612c216 100644
> --- a/arch/powerpc/kvm/e500mc.c
> +++ b/arch/powerpc/kvm/e500mc.c
> @@ -382,12 +382,4 @@ static int __init kvmppc_e500mc_init(void)
>  err_out:
>   return r;
>  }
> -
> -static void __exit kvmppc_e500mc_exit(void)
> -{
> - kvmppc_pr_ops = NULL;
> - kvmppc_booke_exit();
> -}
> -
> -module_init(kvmppc_e500mc_init);
> -module_exit(kvmppc_e500mc_exit);
> +subsys_initcall(kvmppc_e500mc_init);
> 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 10/73] powerpc: use device_initcall for registering rtc devices

2014-01-21 Thread Paul Gortmaker
On Tue, Jan 21, 2014 at 6:48 PM, Geoff Levand  wrote:
> Hi Paul,
>
> On Tue, 2014-01-21 at 16:22 -0500, Paul Gortmaker wrote:
>> Currently these two RTC devices are in core platform code
>> where it is not possible for them to be modular.  It will
>> never be modular, so using module_init as an alias for
>> __initcall can be somewhat misleading.
>>
>>  arch/powerpc/kernel/time.c| 2 +-
>>  arch/powerpc/platforms/ps3/time.c | 3 +--
>>  2 files changed, 2 insertions(+), 3 deletions(-)
>
> I tested the PS3 part of this patch and it seems to work OK.
>
> Acked-by: Geoff Levand 

Thanks Geoff for the review and testing; I'll add the ack.

Paul.
--

>
> ___
> 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


Re: [PATCH RFC 00/73] tree-wide: clean up some no longer required #include

2014-01-22 Thread Paul Gortmaker
[Re: [PATCH RFC 00/73] tree-wide: clean up some no longer required #include 
] On 22/01/2014 (Wed 18:00) Stephen Rothwell wrote:

> Hi Paul,
> 
> On Tue, 21 Jan 2014 16:22:03 -0500 Paul Gortmaker 
>  wrote:
> >
> > Where: This work exists as a queue of patches that I apply to
> > linux-next; since the changes are fixing some things that currently
> > can only be found there.  The patch series can be found at:
> > 
> >http://git.kernel.org/cgit/linux/kernel/git/paulg/init.git
> >git://git.kernel.org/pub/scm/linux/kernel/git/paulg/init.git
> > 
> > I've avoided annoying Stephen with another queue of patches for
> > linux-next while the development content was in flux, but now that
> > the merge window has opened, and new additions are fewer, perhaps he
> > wouldn't mind tacking it on the end...  Stephen?
> 
> OK, I have added this to the end of linux-next today - we will see how we
> go.  It is called "init".

Thanks, it was a great help as it uncovered a few issues in fringe arch
that I didn't have toolchains for, and I've fixed all of those up.

I've noticed that powerpc has been un-buildable for a while now; I have
used this hack patch locally so I could run the ppc defconfigs to check
that I didn't break anything.  Maybe useful for linux-next in the
interim?  It is a hack patch -- Not-Signed-off-by: Paul Gortmaker.  :)

Paul.
--

diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h 
b/arch/powerpc/include/asm/pgtable-ppc64.h
index d27960c89a71..d0f070a2b395 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -560,9 +560,9 @@ extern void pmdp_invalidate(struct vm_area_struct *vma, 
unsigned long address,
pmd_t *pmdp);
 
 #define pmd_move_must_withdraw pmd_move_must_withdraw
-typedef struct spinlock spinlock_t;
-static inline int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
-spinlock_t *old_pmd_ptl)
+struct spinlock;
+static inline int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl,
+struct spinlock *old_pmd_ptl)
 {
/*
 * Archs like ppc64 use pgtable to store per pmd

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


Re: mpic build failure for 7447_hpc defconfig (bisected)

2014-01-24 Thread Paul Gortmaker
On Wed, Jan 8, 2014 at 5:45 PM, Paul Gortmaker
 wrote:
> Commit 446f6d06fab0b49c61887ecbe8286d6aaa796637 ("powerpc/mpic: Properly
> set default triggers") breaks the mpc7447_hpc_defconfig as follows:
>
>   CC  arch/powerpc/sysdev/mpic.o
> arch/powerpc/sysdev/mpic.c: In function 'mpic_set_irq_type':
> arch/powerpc/sysdev/mpic.c:886:9: error: case label does not reduce to an 
> integer constant
> arch/powerpc/sysdev/mpic.c:890:9: error: case label does not reduce to an 
> integer constant
> arch/powerpc/sysdev/mpic.c:894:9: error: case label does not reduce to an 
> integer constant
> arch/powerpc/sysdev/mpic.c:898:9: error: case label does not reduce to an 
> integer constant
>
> Looking at the cpp output (gcc 4.7.3 from the kernel.org toolchains), I see:
>
>case mpic->hw_set[MPIC_IDX_VECPRI_SENSE_EDGE] |
> mpic->hw_set[MPIC_IDX_VECPRI_POLARITY_POSITIVE]:
>
> The pointer into an array appears because CONFIG_MPIC_WEIRD=y is set for
> this thing.
>
> ---
>   #ifdef CONFIG_MPIC_WEIRD
>   static u32 mpic_infos[][MPIC_IDX_END] = {
> [0] = { /* Original OpenPIC compatible MPIC */
>
>   [...]
>
>   #define MPIC_INFO(name) mpic->hw_set[MPIC_IDX_##name]
>
>   #else /* CONFIG_MPIC_WEIRD */
>
>   #define MPIC_INFO(name) MPIC_##name
>
>   #endif /* CONFIG_MPIC_WEIRD */
> ---
>
>
> Given it has been broken since 3.4-rc5, is it safe to say MPIC_WEIRD is dead
> and unused?  Or should the case be converted to if/else or similar?  Or were
> other versions of gcc actually able to "see" constant numbers?

Ping.  I'll default to conversion to if/else since I don't see any other
solution that will solve thiis easily.  However I am tempted to delete
the abandonware platforms, if given a choice.  The 3.4 was quite some
time ago, and if nobody cared since then, well 

P.
--

>
> Paul.
> --
> ___
> 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


[PATCH] powerpc: don't re-issue spinlock typedef that breaks older gcc

2014-01-28 Thread Paul Gortmaker
Commit b3084f4db3aeb991c507ca774337c7e7893ed04f ("powerpc/thp: Fix
crash on mremap") added a "typedef struct spinlock spinlock_t;"
which on gcc 4.5.2 (and possibly other versions) causes many of:

include/linux/spinlock_types.h:76:3: error: redefinition of typedef 'spinlock_t'
arch/powerpc/include/asm/pgtable-ppc64.h:563:25: note: previous declaration of 
'spinlock_t' was here
In file included from include/linux/mutex.h:15:0,
 from include/linux/notifier.h:13,
 from include/linux/pm_qos.h:8,
 from include/linux/netdevice.h:28,
 from drivers/net/wireless/ath/wil6210/wil6210.h:20,
 from drivers/net/wireless/ath/wil6210/debug.c:17:

It appears that somewhere between gcc 4.5.2 and 4.6.3 this
redefinition restriction was lifted.  Using the proper header
from within !ASSEMBLY seems to fix it up in an acceptable way.

Cc: Aneesh Kumar K.V 
Cc: Kirill A. Shutemov 
Cc: Benjamin Herrenschmidt 
Signed-off-by: Paul Gortmaker 
---

[ Note that b3084f4db3 isn't mainline yet, it is currently in
  benh/powerpc.git #merge -- but is headed there soon via:
 https://lkml.org/lkml/2014/1/27/599   ]

 arch/powerpc/include/asm/pgtable-ppc64.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h 
b/arch/powerpc/include/asm/pgtable-ppc64.h
index d27960c89a71..3b638411646a 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -111,6 +111,8 @@
 
 #ifndef __ASSEMBLY__
 
+#include 
+
 /*
  * This is the default implementation of various PTE accessors, it's
  * used in all cases except Book3S with 64K pages where we have a
@@ -560,7 +562,6 @@ extern void pmdp_invalidate(struct vm_area_struct *vma, 
unsigned long address,
pmd_t *pmdp);
 
 #define pmd_move_must_withdraw pmd_move_must_withdraw
-typedef struct spinlock spinlock_t;
 static inline int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
 spinlock_t *old_pmd_ptl)
 {
-- 
1.8.5.2

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


Re: [PATCH RFC 00/73] tree-wide: clean up some no longer required #include

2014-01-28 Thread Paul Gortmaker
On 14-01-27 10:13 PM, Benjamin Herrenschmidt wrote:
> On Wed, 2014-01-22 at 19:38 -0500, Paul Gortmaker wrote:
> 
>> Thanks, it was a great help as it uncovered a few issues in fringe arch
>> that I didn't have toolchains for, and I've fixed all of those up.
>>
>> I've noticed that powerpc has been un-buildable for a while now; I have
>> used this hack patch locally so I could run the ppc defconfigs to check
>> that I didn't break anything.  Maybe useful for linux-next in the
>> interim?  It is a hack patch -- Not-Signed-off-by: Paul Gortmaker.  :)
> 
> Can you and/or Aneesh submit that as a proper patch (with S-O-B
> etc...) ?

I'd updated toolchains and didn't realize it was still broken.  Patch sent.

http://patchwork.ozlabs.org/patch/314749/

Paul.
--

> 
> Thanks !
> 
> Cheers,
> Ben.
> 
>> Paul.
>> --
>>
>> diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h 
>> b/arch/powerpc/include/asm/pgtable-ppc64.h
>> index d27960c89a71..d0f070a2b395 100644
>> --- a/arch/powerpc/include/asm/pgtable-ppc64.h
>> +++ b/arch/powerpc/include/asm/pgtable-ppc64.h
>> @@ -560,9 +560,9 @@ extern void pmdp_invalidate(struct vm_area_struct *vma, 
>> unsigned long address,
>>  pmd_t *pmdp);
>>  
>>  #define pmd_move_must_withdraw pmd_move_must_withdraw
>> -typedef struct spinlock spinlock_t;
>> -static inline int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
>> - spinlock_t *old_pmd_ptl)
>> +struct spinlock;
>> +static inline int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl,
>> + struct spinlock *old_pmd_ptl)
>>  {
>>  /*
>>   * Archs like ppc64 use pgtable to store per pmd
>>
>> ___
>> 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


Re: [PATCH] powerpc: don't re-issue spinlock typedef that breaks older gcc

2014-01-28 Thread Paul Gortmaker
On 14-01-28 12:28 PM, Aneesh Kumar K.V wrote:
> Paul Gortmaker  writes:
> 
>> Commit b3084f4db3aeb991c507ca774337c7e7893ed04f ("powerpc/thp: Fix
>> crash on mremap") added a "typedef struct spinlock spinlock_t;"
>> which on gcc 4.5.2 (and possibly other versions) causes many of:
>>
>> include/linux/spinlock_types.h:76:3: error: redefinition of typedef 
>> 'spinlock_t'
>> arch/powerpc/include/asm/pgtable-ppc64.h:563:25: note: previous declaration 
>> of 'spinlock_t' was here
>> In file included from include/linux/mutex.h:15:0,
>>  from include/linux/notifier.h:13,
>>  from include/linux/pm_qos.h:8,
>>  from include/linux/netdevice.h:28,
>>  from drivers/net/wireless/ath/wil6210/wil6210.h:20,
>>  from drivers/net/wireless/ath/wil6210/debug.c:17:
>>
>> It appears that somewhere between gcc 4.5.2 and 4.6.3 this
>> redefinition restriction was lifted.  Using the proper header
>> from within !ASSEMBLY seems to fix it up in an acceptable way.
>>
>> Cc: Aneesh Kumar K.V 
>> Cc: Kirill A. Shutemov 
>> Cc: Benjamin Herrenschmidt 
>> Signed-off-by: Paul Gortmaker 
>> ---
>>
> 
> 
> http://mid.gmane.org/1389939036.3000.7.ca...@thinkpad-t5421.cn.ibm.com
> 
> This was posted earlier.

I see.  Well I guess Ben didn't use it since it is the same as the
temporary not-signed-off-by hack patch I posted earlier as well.

https://lkml.org/lkml/2014/1/27/584

I believe what I've posted here below to be the proper fix.

Paul.
--


> 
> 
> 
>> [ Note that b3084f4db3 isn't mainline yet, it is currently in
>>   benh/powerpc.git #merge -- but is headed there soon via:
>>  https://lkml.org/lkml/2014/1/27/599   ]
>>
>>  arch/powerpc/include/asm/pgtable-ppc64.h | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h 
>> b/arch/powerpc/include/asm/pgtable-ppc64.h
>> index d27960c89a71..3b638411646a 100644
>> --- a/arch/powerpc/include/asm/pgtable-ppc64.h
>> +++ b/arch/powerpc/include/asm/pgtable-ppc64.h
>> @@ -111,6 +111,8 @@
>>
>>  #ifndef __ASSEMBLY__
>>
>> +#include 
>> +
>>  /*
>>   * This is the default implementation of various PTE accessors, it's
>>   * used in all cases except Book3S with 64K pages where we have a
>> @@ -560,7 +562,6 @@ extern void pmdp_invalidate(struct vm_area_struct *vma, 
>> unsigned long address,
>>  pmd_t *pmdp);
>>
>>  #define pmd_move_must_withdraw pmd_move_must_withdraw
>> -typedef struct spinlock spinlock_t;
>>  static inline int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
>>   spinlock_t *old_pmd_ptl)
>>  {
>> -- 
>> 1.8.5.2
> 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] powerpc: don't re-issue spinlock typedef that breaks older gcc

2014-01-28 Thread Paul Gortmaker
On 14-01-28 01:49 PM, Aneesh Kumar K.V wrote:
> Paul Gortmaker  writes:
> 
>> On 14-01-28 12:28 PM, Aneesh Kumar K.V wrote:
>>> Paul Gortmaker  writes:
>>>
>>>> Commit b3084f4db3aeb991c507ca774337c7e7893ed04f ("powerpc/thp: Fix
>>>> crash on mremap") added a "typedef struct spinlock spinlock_t;"
>>>> which on gcc 4.5.2 (and possibly other versions) causes many of:
>>>>
>>>> include/linux/spinlock_types.h:76:3: error: redefinition of typedef 
>>>> 'spinlock_t'
>>>> arch/powerpc/include/asm/pgtable-ppc64.h:563:25: note: previous 
>>>> declaration of 'spinlock_t' was here
>>>> In file included from include/linux/mutex.h:15:0,
>>>>  from include/linux/notifier.h:13,
>>>>  from include/linux/pm_qos.h:8,
>>>>  from include/linux/netdevice.h:28,
>>>>  from drivers/net/wireless/ath/wil6210/wil6210.h:20,
>>>>  from drivers/net/wireless/ath/wil6210/debug.c:17:
>>>>
>>>> It appears that somewhere between gcc 4.5.2 and 4.6.3 this
>>>> redefinition restriction was lifted.  Using the proper header
>>>> from within !ASSEMBLY seems to fix it up in an acceptable way.
>>>>
>>>> Cc: Aneesh Kumar K.V 
>>>> Cc: Kirill A. Shutemov 
>>>> Cc: Benjamin Herrenschmidt 
>>>> Signed-off-by: Paul Gortmaker 
>>>> ---
>>>>
>>>
>>>
>>> http://mid.gmane.org/1389939036.3000.7.ca...@thinkpad-t5421.cn.ibm.com
>>>
>>> This was posted earlier.
>>
>> I see.  Well I guess Ben didn't use it since it is the same as the
>> temporary not-signed-off-by hack patch I posted earlier as well.
>>
>> https://lkml.org/lkml/2014/1/27/584
>>
>> I believe what I've posted here below to be the proper fix.
> 
> I had another variant which needed this
> 
> http://mid.gmane.org/1388999012-14424-1-git-send-email-aneesh.ku...@linux.vnet.ibm.com

What config did you use to trigger that?  I've not seen it in
allyes/allmodconfig.  I'd like us to try and fix it an alternate
way, vs. fragmenting the header into smaller and smaller
specialized chunks, if possible.

> 
> BTW I had added the above struct spinlock; patch as the backport to
> stable 3.13 series. So if we are picking another one, we may need to
> update stable also

The stable tree is self-correcting ; it won't take any patches that
don't have the same commit present in mainline.  But yes, someone
will still have to _nominate_ one for stable tree consideration.

Paul.
--

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


[GIT PULL] tree-wide: clean up no longer required #include

2014-02-04 Thread Paul Gortmaker
 breakage on the build coverage of this series, so we'll have to
find those independently later.  It looks like there may be quite a
few that are invisibly created via module_platform_driver -- a macro
that creates module_init and module_exit automatically.  We may want
to consider relocating module_platform_driver into module.h later...


cpuinit
---
To finalize the removal of cpuinit, which was done several releases
ago, we remove the remaining stub functions from init.h in this
series.  We've seen one or two "users" try to creep back in, so this
will close the door on that chapter and prevent creep.

   8<-

Thanks,
Paul.
---

Cc: linux-al...@vger.kernel.org
Cc: linux-a...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-i...@vger.kernel.org
Cc: linux-m...@lists.linux-m68k.org
Cc: linux-m...@linux-mips.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-s...@vger.kernel.org
Cc: sparcli...@vger.kernel.org
Cc: x...@kernel.org
Cc: net...@vger.kernel.org
Cc: k...@vger.kernel.org
Cc: s...@canb.auug.org.au
Cc: ru...@rustcorp.com.au
Cc: gre...@linuxfoundation.org
Cc: a...@linux-foundation.org
Cc: torva...@linux-foundation.org


The following changes since commit 38dbfb59d1175ef458d006556061adeaa8751b72:

  Linus 3.14-rc1 (2014-02-02 16:42:13 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux.git 
tags/init-cleanup

for you to fetch changes up to a830e2e2777c893e5bfdaa370d6375023e8cd2a5:

  include: remove needless instances of  (2014-02-03 16:39:14 
-0500)

----
Cleanup of  for 3.14-rc1


Paul Gortmaker (77):
  init: delete the __cpuinit related stubs
  kernel: audit/fix non-modular users of module_init in core code
  mm: replace module_init usages with subsys_initcall in nommu.c
  fs/notify: don't use module_init for non-modular inotify_user code
  netfilter: don't use module_init/exit in core IPV4 code
  x86: don't use module_init in non-modular intel_mid_vrtc.c
  x86: don't use module_init for non-modular core bootflag code
  x86: replace __init_or_module with __init in non-modular vsmp_64.c
  x86: don't use module_init in non-modular devicetree.c code
  drivers/tty/hvc: don't use module_init in non-modular hyp. console code
  staging: don't use module_init in non-modular ion_dummy_driver.c
  powerpc: use device_initcall for registering rtc devices
  powerpc: use subsys_initcall for Freescale Local Bus
  powerpc: don't use module_init for non-modular core hugetlb code
  powerpc: don't use module_init in non-modular 83xx suspend code
  arm: include module.h in drivers/bus/omap_l3_smx.c
  arm: fix implicit module.h use in mach-at91 gpio.h
  arm: fix implicit #include  in entry asm.
  arm: mach-s3c64xx mach-crag6410-module.c is not modular
  arm: use subsys_initcall in non-modular pl320 IPC code
  arm: don't use module_init in non-modular mach-vexpress/spc.c code
  alpha: don't use module_init for non-modular core code
  m68k: don't use module_init in non-modular mvme16x/rtc.c code
  ia64: don't use module_init for non-modular core kernel/mca.c code
  ia64: don't use module_init in non-modular sim/simscsi.c code
  mips: make loongsoon serial driver explicitly modular
  mips: don't use module_init in non-modular sead3-mtd.c code
  cris: don't use module_init for non-modular core intmem.c code
  parisc: don't use module_init for non-modular core pdc_cons code
  parisc64: don't use module_init for non-modular core perf code
  mn10300: don't use module_init in non-modular flash.c code
  sh: don't use module_init in non-modular psw.c code
  sh: mach-highlander/psw.c is tristate and should use module.h
  xtensa: don't use module_init for non-modular core network.c code
  drivers/clk: don't use module_init in clk-nomadik.c which is non-modular
  cpuidle: don't use modular platform register in non-modular ARM drivers
  drivers/platform: don't use modular register in non-modular pdev_bus.c
  module: relocate module_init from init.h to module.h
  logo: emit "#include  in autogenerated C file
  arm: delete non-required instances of include 
  mips: restore init.h usage to arch/mips/ar7/time.c
  s390: delete non-required instances of include 
  alpha: delete non-required instances of 
  powerpc: delete another unrequired instance of 
  arm64: delete non-required instances of 
  watchdog: delete non-required instances of include 
  video: delete non-required instances of include 
  rtc: delete non-required instances of include 

Re: [GIT PULL] tree-wide: clean up no longer required #include

2014-02-04 Thread Paul Gortmaker
On Feb 4, 2014 3:52 PM, "Paul Gortmaker" 
wrote:
>
> We've had this in linux-next for 2+ weeks (thanks Stephen!) as a
> linux-stable like queue of patches, and as can be seen here:
>
>   https://git.kernel.org/pub/scm/linux/kernel/git/paulg/init.git

Argh, above link is meant for cloning, not viewing.

This should be better...

https://git.kernel.org/cgit/linux/kernel/git/paulg/init.git/

Thanks,
Paul.
--

> most of the changes in the last week have been trivial adding acks
> or dropping patches that maintainers decided to take themselves.
>
> With -rc1 now containing what was in linux-next, the queue applies
> to that baseline w/o issue, and I've redone comprehensive multi
> arch build testing on the -rc1 baseline as a final sanity check.
>
> Original RFC discussion and patch posting is here, if needed:
>
>   https://lkml.org/lkml/2014/1/21/434
>
> Suggested merge text follows:
>
>8<-
> Summary - We removed cpuinit and devinit, which left ~2000 instances
> of include  that were no longer needed.  To fully enable
> this removal/cleanup, we relocate module_init() from init.h into
> module.h.  Multi arch/multi config build testing on linux-next has
> been used to find and fix any implicit header dependencies prior to
> deploying the actual init.h --> module.h move, to preserve bisection.
>
> Additional details:
>
> module_init/module_exit and friends moved to module.h
> -
> Aside from enabling this init.h cleanup to extend into modular files,
> it actually does make sense.  For all modules will use some form of
> our initfunc processing/categorization, but not all initfunc users
> will be necessarily using modular functionality.  So we move these
> module related macros to module.h and ensure module.h sources init.h
>
>
> module_init in non modular code:
> 
> This series uncovered that we are enabling people to use module_init
> in non-modular code.  While that works fine, there are at least three
> reasons why it probably should not be encouraged:
>
>  1) it makes a casual reader of the code assume the code is modular
> even though it is obj-y (builtin) or controlled by a bool Kconfig.
>
>  2) it makes it too easy to add dead code in a function that is handed
> to module_exit() -- [more on that below]
>
>  3) it breaks our ability to use priority sorted initcalls properly
> [more on that below.]
>
>  4) on some files, the use of module.h vs. init.h can cost a ~10%
> increase in the number of lines output from CPP.
>
> After this change, a new coder who tries to make use of module_init in
> non modular code would find themselves also needing to include the
> module.h header.  At which point the odds are greater that they would
> ask themselves "Am I doing this right?  I shouldn't need this."
>
> Note that existing non-modular code that already includes module.h and
> uses module_init doesn't get fixed here, since they already build w/o
> errors triggered by this change; we'll have to hunt them down later.
>
>
> module_init and initcall ordering:
> --
> We have a group of about ten priority sorted initcalls, that are
> called in init/main.c after most of the hard coded/direct calls
> have been processed.  These serve the purpose of avoiding everyone
> poking at init/main.c to hook in their init sequence.  The bins are:
>
> pure_initcall   0
> core_initcall   1
> postcore_initcall   2
> arch_initcall   3
> subsys_initcall 4
> fs_initcall 5
> device_initcall 6
> late_initcall   7
>
> These are meant to eventually replace users of the non specific
> priority "__initcall" which currently maps onto device_initcall.
> This is of interest, because in non-modular code, cpp does this:
>
> module_init -->  __initcall --> device_initcall
>
> So all module_init() land in the device_initcall bucket, rather late
> in the sequence.  That makes sense, since if it was a module, the init
> could be real late (days, weeks after boot).  But now imagine you add
> support for some non-modular bus/arch/infrastructure (say for e.g. PCI)
> and you use module_init for it.  That means anybody else who wants
> to use your subsystem can't do so if they use an initcall of 0 --> 5
> priority.  For a real world example of this, see patch #1 in this series:
>
> https://lkml.org/lkml/2014/1/14/809
>
> We don't want

Re: [GIT PULL] tree-wide: clean up no longer required #include

2014-02-05 Thread Paul Gortmaker
[Re: [GIT PULL] tree-wide: clean up no longer required #include ] 
On 05/02/2014 (Wed 07:41) Ingo Molnar wrote:

> 
> * Stephen Rothwell  wrote:
> 
> > Hi Ingo,
> > 
> > On Wed, 5 Feb 2014 07:06:33 +0100 Ingo Molnar  wrote:
> > > 
> > > So, if you meant Linus to pull it, you probably want to cite a real 
> > > Git URI along the lines of:
> > > 
> > >git://git.kernel.org/pub/scm/linux/kernel/git/paulg/init.git
> > 
> > Paul provided the proper git url further down in the mail along with the
> > usual pull request message (I guess he should have put that bit at the
> > top).
> 
> Yeah, indeed, and it even comes with a signed tag, which is an extra 
> nice touch:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux.git 
> tags/init-cleanup
> 
> (I guess the https was mentioned first to lower expectations.)

Just to clarify, the init.git was the repo of raw commits+series file
that was used for testing on linux next; now useless, except for showing
the last several weeks of history (hence the visual http link).  The
signed tag [separate repo] is the application of those commits against
the 3.14-rc1 tag, which was the end goal from the beginning.

Does history matter?  In the case of a cleanup like this, it does only
in the immediate context of this pull request; to help distinguish this
work from some short lived half baked idea that also had its testing
invalidated by arbitrarily rebasing onto the latest shiny tag.

I wouldn't have even mentioned the patch repo, except for the fact that
I know how Linus loves arbitrary rebases [and malformed pull requests]  :)

Thanks,
Paul.
--

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


[PATCH-next] powerpc: delete old PrPMC 280/2800 support

2014-02-05 Thread Paul Gortmaker
This processor/memory module was mostly used on ATCA blades and
before that, on cPCI blades.  It wasn't really user friendly, with
custom non u-boot bootloaders (powerboot/motload) and no real way
to recover corrupted boot flash (which was a common problem).

As such, it had its day back before the big ppc --> powerpc move
to device trees, and that was largely through commercial BSPs that
started to dry up around 2007.

Systems using one were largely in a "deploy and sustain" mode,
so interest in upgrading to new kernels in the field was nil.
Also, requiring 50A, 48V power supplies and a 2'x2'x2' ATCA
chassis largely rules out any hobbyist/enthusiast interest.

The point of all this, is that we might as well delete the in
kernel files relating to this platform.  No point in continuing
to build it via walking the defconfigs or via linux-next testing.

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---

[The above description is not idle speculation based on 2nd hand
info -- I personally suffered with these platforms, and when faced
with a chance to take some for free vs. letting them go to e-waste,
I happily chose the latter option.   So lets get this out early in
the 3.15 cycle so any objections have a full window to appear.  ]

 arch/powerpc/boot/Makefile |   5 +-
 arch/powerpc/configs/prpmc2800_defconfig   | 108 -
 arch/powerpc/platforms/embedded6xx/Kconfig |   8 --
 arch/powerpc/platforms/embedded6xx/Makefile|   1 -
 arch/powerpc/platforms/embedded6xx/prpmc2800.c | 156 -
 5 files changed, 2 insertions(+), 276 deletions(-)
 delete mode 100644 arch/powerpc/configs/prpmc2800_defconfig
 delete mode 100644 arch/powerpc/platforms/embedded6xx/prpmc2800.c

diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 90e9d9548660..a1f8c7f1ec60 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -54,7 +54,7 @@ zlib   := inffast.c inflate.c inftrees.c
 zlibheader := inffast.h inffixed.h inflate.h inftrees.h infutil.h
 zliblinuxheader := zlib.h zconf.h zutil.h
 
-$(addprefix $(obj)/,$(zlib) cuboot-c2k.o gunzip_util.o main.o prpmc2800.o): \
+$(addprefix $(obj)/,$(zlib) cuboot-c2k.o gunzip_util.o main.o): \
$(addprefix $(obj)/,$(zliblinuxheader)) $(addprefix 
$(obj)/,$(zlibheader))
 
 libfdt   := fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c
@@ -95,7 +95,7 @@ src-plat-$(CONFIG_FSL_SOC_BOOKE) += cuboot-85xx.c 
cuboot-85xx-cpm2.c
 src-plat-$(CONFIG_EMBEDDED6xx) += cuboot-pq2.c cuboot-mpc7448hpc2.c \
cuboot-c2k.c gamecube-head.S \
gamecube.c wii-head.S wii.c holly.c \
-   prpmc2800.c fixed-head.S mvme5100.c
+   fixed-head.S mvme5100.c
 src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c
 src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c
 src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c
@@ -204,7 +204,6 @@ image-$(CONFIG_PPC_CHRP)+= zImage.chrp
 image-$(CONFIG_PPC_EFIKA)  += zImage.chrp
 image-$(CONFIG_PPC_PMAC)   += zImage.pmac
 image-$(CONFIG_PPC_HOLLY)  += dtbImage.holly
-image-$(CONFIG_PPC_PRPMC2800)  += dtbImage.prpmc2800
 image-$(CONFIG_DEFAULT_UIMAGE) += uImage
 image-$(CONFIG_EPAPR_BOOT) += zImage.epapr
 
diff --git a/arch/powerpc/configs/prpmc2800_defconfig 
b/arch/powerpc/configs/prpmc2800_defconfig
deleted file mode 100644
index cd80fb615d34..
--- a/arch/powerpc/configs/prpmc2800_defconfig
+++ /dev/null
@@ -1,108 +0,0 @@
-CONFIG_ALTIVEC=y
-CONFIG_EXPERIMENTAL=y
-CONFIG_SYSVIPC=y
-CONFIG_POSIX_MQUEUE=y
-CONFIG_LOG_BUF_SHIFT=14
-CONFIG_BLK_DEV_INITRD=y
-# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
-# CONFIG_BLK_DEV_BSG is not set
-# CONFIG_IOSCHED_DEADLINE is not set
-# CONFIG_IOSCHED_CFQ is not set
-# CONFIG_PPC_CHRP is not set
-# CONFIG_PPC_PMAC is not set
-CONFIG_EMBEDDED6xx=y
-CONFIG_PPC_PRPMC2800=y
-CONFIG_HIGHMEM=y
-CONFIG_NO_HZ=y
-CONFIG_HIGH_RES_TIMERS=y
-CONFIG_BINFMT_MISC=y
-CONFIG_SPARSE_IRQ=y
-# CONFIG_SECCOMP is not set
-CONFIG_NET=y
-CONFIG_PACKET=y
-CONFIG_UNIX=y
-CONFIG_XFRM_USER=y
-CONFIG_INET=y
-CONFIG_IP_MULTICAST=y
-CONFIG_IP_PNP=y
-CONFIG_IP_PNP_DHCP=y
-CONFIG_IP_PNP_BOOTP=y
-CONFIG_SYN_COOKIES=y
-# CONFIG_IPV6 is not set
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
-CONFIG_MTD=y
-CONFIG_MTD_CONCAT=y
-CONFIG_MTD_PARTITIONS=y
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLOCK=y
-CONFIG_MTD_CFI=y
-CONFIG_MTD_JEDECPROBE=y
-CONFIG_MTD_CFI_INTELEXT=y
-CONFIG_MTD_PHYSMAP_OF=y
-CONFIG_PROC_DEVICETREE=y
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_DEV_RAM=y
-CONFIG_BLK_DEV_RAM_SIZE=131072
-CONFIG_IDE=y
-CONFIG_BLK_DEV_GENERIC=y
-CONFIG_BLK_DEV_PDC202XX_NEW=y
-CONFIG_BLK_DEV_SD=y
-CONFIG_ATA=y
-CONFIG_SATA_MV=y
-CONF

[PATCH] powerpc: fix build failure in sysdev/mpic.c for MPIC_WEIRD=y

2014-02-07 Thread Paul Gortmaker
Commit 446f6d06fab0b49c61887ecbe8286d6aaa796637 ("powerpc/mpic: Properly
set default triggers") breaks the mpc7447_hpc_defconfig as follows:

  CC  arch/powerpc/sysdev/mpic.o
arch/powerpc/sysdev/mpic.c: In function 'mpic_set_irq_type':
arch/powerpc/sysdev/mpic.c:886:9: error: case label does not reduce to an 
integer constant
arch/powerpc/sysdev/mpic.c:890:9: error: case label does not reduce to an 
integer constant
arch/powerpc/sysdev/mpic.c:894:9: error: case label does not reduce to an 
integer constant
arch/powerpc/sysdev/mpic.c:898:9: error: case label does not reduce to an 
integer constant

Looking at the cpp output (gcc 4.7.3), I see:

   case mpic->hw_set[MPIC_IDX_VECPRI_SENSE_EDGE] |
mpic->hw_set[MPIC_IDX_VECPRI_POLARITY_POSITIVE]:

The pointer into an array appears because CONFIG_MPIC_WEIRD=y is set
for this platform, thus enabling the following:

  ---
  #ifdef CONFIG_MPIC_WEIRD
  static u32 mpic_infos[][MPIC_IDX_END] = {
[0] = { /* Original OpenPIC compatible MPIC */

  [...]

  #define MPIC_INFO(name) mpic->hw_set[MPIC_IDX_##name]

  #else /* CONFIG_MPIC_WEIRD */

  #define MPIC_INFO(name) MPIC_##name

  #endif /* CONFIG_MPIC_WEIRD */
  ---

Here we convert the case section to if/else if, and also add
the equivalent of a default case to warn about unknown types.
Boot tested on sbc8548, build tested on all defconfigs.

Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/sysdev/mpic.c | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 0e166ed4cd16..8209744b2829 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -886,25 +886,25 @@ int mpic_set_irq_type(struct irq_data *d, unsigned int 
flow_type)
 
/* Default: read HW settings */
if (flow_type == IRQ_TYPE_DEFAULT) {
-   switch(vold & (MPIC_INFO(VECPRI_POLARITY_MASK) |
-  MPIC_INFO(VECPRI_SENSE_MASK))) {
-   case MPIC_INFO(VECPRI_SENSE_EDGE) |
-MPIC_INFO(VECPRI_POLARITY_POSITIVE):
-   flow_type = IRQ_TYPE_EDGE_RISING;
-   break;
-   case MPIC_INFO(VECPRI_SENSE_EDGE) |
-MPIC_INFO(VECPRI_POLARITY_NEGATIVE):
-   flow_type = IRQ_TYPE_EDGE_FALLING;
-   break;
-   case MPIC_INFO(VECPRI_SENSE_LEVEL) |
-MPIC_INFO(VECPRI_POLARITY_POSITIVE):
-   flow_type = IRQ_TYPE_LEVEL_HIGH;
-   break;
-   case MPIC_INFO(VECPRI_SENSE_LEVEL) |
-MPIC_INFO(VECPRI_POLARITY_NEGATIVE):
-   flow_type = IRQ_TYPE_LEVEL_LOW;
-   break;
-   }
+   int vold_ps;
+
+   vold_ps = vold & (MPIC_INFO(VECPRI_POLARITY_MASK) |
+ MPIC_INFO(VECPRI_SENSE_MASK));
+
+   if (vold_ps == (MPIC_INFO(VECPRI_SENSE_EDGE) |
+   MPIC_INFO(VECPRI_POLARITY_POSITIVE)))
+   flow_type = IRQ_TYPE_EDGE_RISING;
+   else if (vold_ps == (MPIC_INFO(VECPRI_SENSE_EDGE) |
+MPIC_INFO(VECPRI_POLARITY_NEGATIVE)))
+   flow_type = IRQ_TYPE_EDGE_FALLING;
+   else if (vold_ps == (MPIC_INFO(VECPRI_SENSE_LEVEL) |
+MPIC_INFO(VECPRI_POLARITY_POSITIVE)))
+   flow_type = IRQ_TYPE_LEVEL_HIGH;
+   else if (vold_ps == (MPIC_INFO(VECPRI_SENSE_LEVEL) |
+MPIC_INFO(VECPRI_POLARITY_NEGATIVE)))
+   flow_type = IRQ_TYPE_LEVEL_LOW;
+   else
+   WARN_ONCE(1, "mpic: unknown IRQ type %d\n", vold);
}
 
/* Apply to irq desc */
-- 
1.8.5.2

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


Re: Anyone using SysRQ key sequences on console serial port ?

2014-02-16 Thread Paul Gortmaker
On Fri, Feb 14, 2014 at 3:42 PM, John Donnelly  wrote:
> Hi,
>
>  I tried using the SysRq hotkey sequence on a serial console -
> 3.11.0-5-powerpc-e500mc system, by issuing a " break " and the system
> immediately wedges after displaying "SysRQ : HELP : " using both "Putty" and
> "Teraterm"  terminal emulators. I know the system is dead because my ssh
> sessions stopped too.

Yes it does work -- or at least it _did_ work.  Make sure your dts has an entry

compatible = "fsl,ns16550", "ns16550";

since that enables a workaround I'd added for a hardware errata relating
to sending breaks over the serial console.   What you describe above
makes me think you aren't getting the workaround enabled.

Paul.
--

>
> http://en.wikipedia.org/wiki/Magic_SysRq_key .
>
>
>
>
> --
>
> Regards,
>  John.
>
> --
>
> o Energy-efficiency is #1 reason data centers look to expand.  -- Digital
> Realty Trust
> o Green Data Centers spending to increase 300% worldwide by 2016.  -- Pike
> Research
> o Data Centers have become as vital to the functioni
> ng of society as power stations.  -- The Economist
>
>
> ___
> 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


Re: [PATCH] of: give priority to the compatible match in __of_match_node()

2014-02-19 Thread Paul Gortmaker
On Thu, Feb 13, 2014 at 2:01 PM, Rob Herring  wrote:
> On Wed, Feb 12, 2014 at 5:38 AM, Kevin Hao  wrote:
>> When the device node do have a compatible property, we definitely
>> prefer the compatible match besides the type and name. Only if
>> there is no such a match, we then consider the candidate which
>> doesn't have compatible entry but do match the type or name with
>> the device node.
>>
>> This is based on a patch from Sebastian Hesselbarth.
>>   http://patchwork.ozlabs.org/patch/319434/
>>
>> I did some code refactoring and also fixed a bug in the original patch.
>
> I'm inclined to just revert this once again and avoid possibly
> breaking yet another platform.

Well, for what it is worth, today's (Feb19th) linux-next tree fails to boot
on my sbc8548.   It fails with:
---
libphy: Freescale PowerQUICC MII Bus: probed
mdio_bus ethernet@e002400: /soc8548@e000/ethernet@24000/mdio@520
PHY address 1312 is too large
libphy: Freescale PowerQUICC MII Bus: probed
libphy: Freescale PowerQUICC MII Bus: probed
mdio_bus ethernet@e002500: /soc8548@e000/ethernet@25000/mdio@520
PHY address 1312 is too large
libphy: Freescale PowerQUICC MII Bus: probed
TCP: cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 17

---

On a normal boot, we should see this:
---
libphy: Freescale PowerQUICC MII Bus: probed
libphy: Freescale PowerQUICC MII Bus: probed
fsl-gianfar e0024000.ethernet: enabled errata workarounds, flags: 0x4
fsl-gianfar e0024000.ethernet eth0: mac: 02:e0:0c:00:05:fd
fsl-gianfar e0024000.ethernet eth0: Running with NAPI enabled
fsl-gianfar e0024000.ethernet eth0: RX BD ring size for Q[0]: 256
fsl-gianfar e0024000.ethernet eth0: TX BD ring size for Q[0]: 256
fsl-gianfar e0025000.ethernet: enabled errata workarounds, flags: 0x4
fsl-gianfar e0025000.ethernet eth1: mac: 02:e0:0c:00:06:fd
fsl-gianfar e0025000.ethernet eth1: Running with NAPI enabled
fsl-gianfar e0025000.ethernet eth1: RX BD ring size for Q[0]: 256
fsl-gianfar e0025000.ethernet eth1: TX BD ring size for Q[0]: 256
TCP: cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 17
---


Git bisect says:

ee8b26ad943aa34acc03ae6cde2b81d8d3d483d4 is the first bad commit
commit ee8b26ad943aa34acc03ae6cde2b81d8d3d483d4
Author: Kevin Hao 
Date:   Tue Feb 18 15:57:30 2014 +0800

of: reimplement the matching method for __of_match_node()

In the current implementation of __of_match_node(), it will compare
each given match entry against all the node's compatible strings
with of_device_is_compatible().

To achieve multiple compatible strings per node with ordering from
specific to generic, this requires given matches to be ordered from
specific to generic. For most of the drivers this is not true and
also an alphabetical ordering is more sane there.

Therefore, we define a following priority order for the match, and
then scan all the entries to find the best match.
  1. specific compatible && type && name
  2. specific compatible && type
  3. specific compatible && name
  4. specific compatible
  5. general compatible && type && name
  6. general compatible && type
  7. general compatible && name
  8. general compatible
  9. type && name
  10. type
  11. name

This is based on some pseudo-codes provided by Grant Likely.

Signed-off-by: Kevin Hao 
[grant.likely: Changed multiplier to 4 which makes more sense]
Signed-off-by: Grant Likely 

:04 04 8f5dd19174417aece63b308ff299a5dbe2efa5a0
8401b0e3903e23e973845ee75b26b04345d803d2 M  drivers

As a double check, I checked out the head of linux-next, and did a
revert of the above commit, and my sbc8548 can then boot properly.

Not doing anything fancy ; using the defconfig exactly as-is, and
ensuring the dtb is fresh from linux-next HEAD of today.

Thanks,
Paul.
--

>
> However, I think I would like to see this structured differently. We
> basically have 2 ways of matching: the existing pre-3.14 way and the
> desired match on best compatible only. All new bindings should match
> with the new way and the old way needs to be kept for compatibility.
> So lets structure the code that way. Search the match table first for
> best compatible with name and type NULL, then search the table the old
> way. I realize it appears you are doing this, but it is not clear this
> is the intent of the code. I would like to see this written as a patch
> with commit 105353145eafb3ea919 reverted first and you add a new match
> function to call first and then fallback to the existing function.
>
> Rob
>
>>
>> Cc: Sebastian Hesselbarth 
>> Signed-off-by: Kevin Hao 
>> ---
>>  drivers/of/base.c | 55 
>> +--
>>  1 file changed, 37 insertions(+), 18 d

Re: Anyone using SysRQ key sequences on console serial port ?

2014-02-19 Thread Paul Gortmaker
[BTW, your html mail may be ignored by most people ; for example most of
 the linux lists on vger.kernel.org actively reject it; top posting isn't
 going to help either... ]

On 14-02-18 02:47 PM, John Donnelly wrote:
> I am enable to get one keyboard sequence responded to with the noted change
> in the dts .
> 
>  for instance:
> 
>SysRQ ( Break)   c
> 
>   Panics .. Which is a good response, and since it doesn't require a return
> to user mode ( I suspect )  it appears to work.
> 
> Any other requests fail to report any information :
> 
>  SysRQ (break )  l - list active processes
>  m - list memory
> 
>   Any additional SysRQ are ignored., and the system appears hung.

It must be something specific about your particular platform, or the
custom patches you have applied then.  I just tested today's linux-next
tree (i.e. the latest bleeding edge stuff) and it still works for the
sbc8548 (defconfig + enable magic SYSRQ option).  I did "s" (sync) multiple
times and "?" then "m" for memory dump (obviously those chars don't get
echo'd to the console

 ---
root@sbc8548:~# cat /proc/cpuinfo |grep cpu
cpu : e500v2
root@sbc8548:~# SysRq : Emergency Sync
Emergency Sync complete
SysRq : Emergency Sync
Emergency Sync complete
SysRq : HELP : loglevel(0-9) reboot(b) crash(c) terminate-all-tasks(e) 
memory-full-oom-kill(f) kill-all-tasks(i) thaw-filesystems(j) 
show-memory-usage(m) nice-all-RT-tasks(n) poweroff(o) show-registers(p) 
show-all-timers(q) sync(s) show-task-states(t) unmount(u) show-blocked-tasks(w)
SysRq : Show Memory
Mem-Info:
DMA per-cpu:
CPU0: hi:  186, btch:  31 usd: 132
active_anon:738 inactive_anon:29 isolated_anon:0
 active_file:915 inactive_file:2219 isolated_file:0
 unevictable:0 dirty:0 writeback:0 unstable:0
 free:188325 slab_reclaimable:488 slab_unreclaimable:778
 mapped:1006 shmem:44 pagetables:83 bounce:0
 free_cma:0
DMA free:753300kB min:3520kB low:4400kB high:5280kB active_anon:2952kB 
inactive_anon:116kB active_file:3660kB inactive_file:8876kB unevictable:0kB 
isolated(anon):0kB isolated(file):0kB 
present:786432kB managed:775916kB mlocked:0kB dirty:0kB writeback:0kB 
mapped:4024kB shmem:176kB slab_reclaimable:1952kB slab_unreclaimable:3112kB 
kernel_stack:264kB pagetables:332kB uns
table:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 
all_unreclaimable? no
lowmem_reserve[]: 0 0 0
DMA: 403*4kB (UEM) 271*8kB (UEM) 131*16kB (UM) 35*32kB (UM) 15*64kB (UEM) 
1*128kB (M) 1*256kB (M) 1*512kB (U) 1*1024kB (U) 3*2048kB (UEM) 180*4096kB (MR) 
= 753300kB
3178 total pagecache pages
0 pages in swap cache
Swap cache stats: add 0, delete 0, find 0/0
Free swap  = 0kB
Total swap = 0kB
196608 pages RAM
0 pages HighMem/MovableOnly
2629 pages reserved
 ---


Paul.
--

> 
>  On an reference Intel platform, multiple SyqRQ can be issued and the
> system remains healthy .
> 
> 
> 
> 
> 
> 
> 
> 
> 
> On Mon, Feb 17, 2014 at 1:37 PM, Scott Wood  wrote:
> 
>> On Sun, 2014-02-16 at 10:56 -0500, Paul Gortmaker wrote:
>>> On Fri, Feb 14, 2014 at 3:42 PM, John Donnelly 
>> wrote:
>>>> Hi,
>>>>
>>>>  I tried using the SysRq hotkey sequence on a serial console -
>>>> 3.11.0-5-powerpc-e500mc system, by issuing a " break " and the system
>>>> immediately wedges after displaying "SysRQ : HELP : " using both
>> "Putty" and
>>>> "Teraterm"  terminal emulators. I know the system is dead because my
>> ssh
>>>> sessions stopped too.
>>>
>>> Yes it does work -- or at least it _did_ work.  Make sure your dts has
>> an entry
>>>
>>> compatible = "fsl,ns16550", "ns16550";
>>>
>>> since that enables a workaround I'd added for a hardware errata relating
>>> to sending breaks over the serial console.   What you describe above
>>> makes me think you aren't getting the workaround enabled.
>>
>> Also make sure CONFIG_SERIAL_8250_FSL is enabled.
>>
>> -Scott
>>
>>
>>
> 
> 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] of: give priority to the compatible match in __of_match_node()

2014-02-19 Thread Paul Gortmaker
On 14-02-19 03:41 PM, Grant Likely wrote:
> On Wed, 19 Feb 2014 13:25:54 -0500, Paul Gortmaker 
>  wrote:
>> On Thu, Feb 13, 2014 at 2:01 PM, Rob Herring  wrote:
>>> On Wed, Feb 12, 2014 at 5:38 AM, Kevin Hao  wrote:
>>>> When the device node do have a compatible property, we definitely
>>>> prefer the compatible match besides the type and name. Only if
>>>> there is no such a match, we then consider the candidate which
>>>> doesn't have compatible entry but do match the type or name with
>>>> the device node.
>>>>
>>>> This is based on a patch from Sebastian Hesselbarth.
>>>>   http://patchwork.ozlabs.org/patch/319434/
>>>>
>>>> I did some code refactoring and also fixed a bug in the original patch.
>>>
>>> I'm inclined to just revert this once again and avoid possibly
>>> breaking yet another platform.
>>
>> Well, for what it is worth, today's (Feb19th) linux-next tree fails to boot
>> on my sbc8548.   It fails with:
> 
> I think I've got it fixed now with the latest series. Please try the
> devicetree/merge branch on git://git.secretlab.ca/git/linux

That seems to work.

libphy: Freescale PowerQUICC MII Bus: probed
libphy: Freescale PowerQUICC MII Bus: probed
fsl-gianfar e0024000.ethernet: enabled errata workarounds, flags: 0x4
fsl-gianfar e0024000.ethernet eth0: mac: 02:e0:0c:00:05:fd
fsl-gianfar e0024000.ethernet eth0: Running with NAPI enabled
fsl-gianfar e0024000.ethernet eth0: RX BD ring size for Q[0]: 256
fsl-gianfar e0024000.ethernet eth0: TX BD ring size for Q[0]: 256
fsl-gianfar e0025000.ethernet: enabled errata workarounds, flags: 0x4
fsl-gianfar e0025000.ethernet eth1: mac: 02:e0:0c:00:06:fd
fsl-gianfar e0025000.ethernet eth1: Running with NAPI enabled
fsl-gianfar e0025000.ethernet eth1: RX BD ring size for Q[0]: 256
fsl-gianfar e0025000.ethernet eth1: TX BD ring size for Q[0]: 256
TCP: cubic registered
Initializing XFRM netlink socket
NET: Registered protocol family 17

...

root@sbc8548:~# cat /proc/version 
Linux version 3.14.0-rc3-00024-g7119f42057c6 (paul@yow-lpgnfs-02) (gcc version 
4.5.2 (GCC) ) #1 Wed Feb 19 16:08:17 EST 2014
root@sbc8548:~#

Paul.
--

> 
> g.
> 
>> ---
>> libphy: Freescale PowerQUICC MII Bus: probed
>> mdio_bus ethernet@e002400: /soc8548@e000/ethernet@24000/mdio@520
>> PHY address 1312 is too large
>> libphy: Freescale PowerQUICC MII Bus: probed
>> libphy: Freescale PowerQUICC MII Bus: probed
>> mdio_bus ethernet@e002500: /soc8548@e000/ethernet@25000/mdio@520
>> PHY address 1312 is too large
>> libphy: Freescale PowerQUICC MII Bus: probed
>> TCP: cubic registered
>> Initializing XFRM netlink socket
>> NET: Registered protocol family 17
>> 
>> ---
>>
>> On a normal boot, we should see this:
>> ---
>> libphy: Freescale PowerQUICC MII Bus: probed
>> libphy: Freescale PowerQUICC MII Bus: probed
>> fsl-gianfar e0024000.ethernet: enabled errata workarounds, flags: 0x4
>> fsl-gianfar e0024000.ethernet eth0: mac: 02:e0:0c:00:05:fd
>> fsl-gianfar e0024000.ethernet eth0: Running with NAPI enabled
>> fsl-gianfar e0024000.ethernet eth0: RX BD ring size for Q[0]: 256
>> fsl-gianfar e0024000.ethernet eth0: TX BD ring size for Q[0]: 256
>> fsl-gianfar e0025000.ethernet: enabled errata workarounds, flags: 0x4
>> fsl-gianfar e0025000.ethernet eth1: mac: 02:e0:0c:00:06:fd
>> fsl-gianfar e0025000.ethernet eth1: Running with NAPI enabled
>> fsl-gianfar e0025000.ethernet eth1: RX BD ring size for Q[0]: 256
>> fsl-gianfar e0025000.ethernet eth1: TX BD ring size for Q[0]: 256
>> TCP: cubic registered
>> Initializing XFRM netlink socket
>> NET: Registered protocol family 17
>> ---
>>
>>
>> Git bisect says:
>>
>> ee8b26ad943aa34acc03ae6cde2b81d8d3d483d4 is the first bad commit
>> commit ee8b26ad943aa34acc03ae6cde2b81d8d3d483d4
>> Author: Kevin Hao 
>> Date:   Tue Feb 18 15:57:30 2014 +0800
>>
>> of: reimplement the matching method for __of_match_node()
>>
>> In the current implementation of __of_match_node(), it will compare
>> each given match entry against all the node's compatible strings
>> with of_device_is_compatible().
>>
>> To achieve multiple compatible strings per node with ordering from
>> specific to generic, this requires given matches to be ordered from
>> specific to generic. For most of the drivers this is not true and
>> a

[PATCH] powerpc: select MEMORY for FSL_IFC to not break existing .config files

2014-02-19 Thread Paul Gortmaker
commit d2ae2e20fbdde5a65f3a5a153044ab1e5c53f7cc ("driver/memory:Move
Freescale IFC driver to a common driver") introduces this build
regression into the mpc85xx_defconfig:

 drivers/built-in.o: In function `fsl_ifc_nand_remove':
 drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/built-in.o: In function `fsl_ifc_nand_probe':
 drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/built-in.o: In function `match_bank':
 drivers/mtd/nand/fsl_ifc_nand.c:1013: undefined reference to 
`convert_ifc_address'
 drivers/built-in.o: In function `fsl_ifc_nand_probe':
 drivers/mtd/nand/fsl_ifc_nand.c:1059: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/mtd/nand/fsl_ifc_nand.c:1080: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to `fsl_ifc_ctrl_dev'
 make: *** [vmlinux] Error 1

This happens because there is nothing to descend us into the
drivers/memory directory in the mpc85xx_defconfig.  It wasn't
selecting CONFIG_MEMORY.  So we never built drivers/memory/fsl_ifc.o
even with CONFIG_FSL_IFC=y, and so we have nothing to link against.

In order to remain compatible with old config files and to avoid
such build failures, make CONFIG_FSL_IFC select CONFIG_MEMORY.
Also fix the whitespace issue (spaces vs. a tab) in the Kconfig.

Cc: Prabhakar Kushwaha 
Cc: Arnd Bergmann 
Cc: Greg Kroah-Hartman 
Signed-off-by: Paul Gortmaker 
---

[This probably makes sense to go in via Greg's char-misc/char-misc-next
 (vs. powerpc-next) since that is where the regression was introduced.]

 arch/powerpc/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 957bf344c0f5..d2d8d8f50610 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -738,7 +738,8 @@ config FSL_LBC
 
 config FSL_IFC
bool
-depends on FSL_SOC
+   depends on FSL_SOC
+   select MEMORY
 
 config FSL_GTM
bool
-- 
1.8.5.2

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


Re: [PATCH] powerpc: select MEMORY for FSL_IFC to not break existing .config files

2014-02-19 Thread Paul Gortmaker
On 14-02-19 05:19 PM, Scott Wood wrote:
> On Wed, 2014-02-19 at 17:07 -0500, Paul Gortmaker wrote:
>> commit d2ae2e20fbdde5a65f3a5a153044ab1e5c53f7cc ("driver/memory:Move
>> Freescale IFC driver to a common driver") introduces this build
>> regression into the mpc85xx_defconfig:
>>
>>  drivers/built-in.o: In function `fsl_ifc_nand_remove':
>>  drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>  drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>  drivers/built-in.o: In function `fsl_ifc_nand_probe':
>>  drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>  drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>  drivers/built-in.o: In function `match_bank':
>>  drivers/mtd/nand/fsl_ifc_nand.c:1013: undefined reference to 
>> `convert_ifc_address'
>>  drivers/built-in.o: In function `fsl_ifc_nand_probe':
>>  drivers/mtd/nand/fsl_ifc_nand.c:1059: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>  drivers/mtd/nand/fsl_ifc_nand.c:1080: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>  drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>  drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>  make: *** [vmlinux] Error 1
>>
>> This happens because there is nothing to descend us into the
>> drivers/memory directory in the mpc85xx_defconfig.  It wasn't
>> selecting CONFIG_MEMORY.  So we never built drivers/memory/fsl_ifc.o
>> even with CONFIG_FSL_IFC=y, and so we have nothing to link against.
>>
>> In order to remain compatible with old config files and to avoid
>> such build failures, make CONFIG_FSL_IFC select CONFIG_MEMORY.
>> Also fix the whitespace issue (spaces vs. a tab) in the Kconfig.
>>
>> Cc: Prabhakar Kushwaha 
>> Cc: Arnd Bergmann 
>> Cc: Greg Kroah-Hartman 
>> Signed-off-by: Paul Gortmaker 
>> ---
>>
>> [This probably makes sense to go in via Greg's char-misc/char-misc-next
>>  (vs. powerpc-next) since that is where the regression was introduced.]
>>
>>  arch/powerpc/Kconfig | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index 957bf344c0f5..d2d8d8f50610 100644
>> --- a/arch/powerpc/Kconfig
>> +++ b/arch/powerpc/Kconfig
>> @@ -738,7 +738,8 @@ config FSL_LBC
>>  
>>  config FSL_IFC
>>  bool
>> -depends on FSL_SOC
>> +depends on FSL_SOC
>> +select MEMORY
> 
> Why do we still have FSL_IFC in arch/powerpc/Kconfig if the driver has
> been moved?  The NAND driver and other selectors of FSL_IFC can select
> MEMORY.

At the risk of a slightly larger footprint to the regression fix,
I'd agree that is a better overall solution.  I'll code that up.

Unless folks want the regression fix as-is, and then the move?

Paul.
--

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


Re: [PATCH] of: give priority to the compatible match in __of_match_node()

2014-02-19 Thread Paul Gortmaker
On 14-02-19 05:40 PM, Grant Likely wrote:
> On Wed, 19 Feb 2014 16:23:02 -0500, Paul Gortmaker 
>  wrote:
>> On 14-02-19 03:41 PM, Grant Likely wrote:
>>> On Wed, 19 Feb 2014 13:25:54 -0500, Paul Gortmaker 
>>>  wrote:
>>>> On Thu, Feb 13, 2014 at 2:01 PM, Rob Herring  wrote:
>>>>> On Wed, Feb 12, 2014 at 5:38 AM, Kevin Hao  wrote:
>>>>>> When the device node do have a compatible property, we definitely
>>>>>> prefer the compatible match besides the type and name. Only if
>>>>>> there is no such a match, we then consider the candidate which
>>>>>> doesn't have compatible entry but do match the type or name with
>>>>>> the device node.
>>>>>>
>>>>>> This is based on a patch from Sebastian Hesselbarth.
>>>>>>   http://patchwork.ozlabs.org/patch/319434/
>>>>>>
>>>>>> I did some code refactoring and also fixed a bug in the original patch.
>>>>>
>>>>> I'm inclined to just revert this once again and avoid possibly
>>>>> breaking yet another platform.
>>>>
>>>> Well, for what it is worth, today's (Feb19th) linux-next tree fails to boot
>>>> on my sbc8548.   It fails with:
>>>
>>> I think I've got it fixed now with the latest series. Please try the
>>> devicetree/merge branch on git://git.secretlab.ca/git/linux
>>
>> That seems to work.
> 
> Great, thanks for the testing. Can I add a Tested-by line for you?

Absolutely; sorry for not thinking to explicitly indicate that.

P.
--

> 
> g.
> 
>>
>> libphy: Freescale PowerQUICC MII Bus: probed
>> libphy: Freescale PowerQUICC MII Bus: probed
>> fsl-gianfar e0024000.ethernet: enabled errata workarounds, flags: 0x4
>> fsl-gianfar e0024000.ethernet eth0: mac: 02:e0:0c:00:05:fd
>> fsl-gianfar e0024000.ethernet eth0: Running with NAPI enabled
>> fsl-gianfar e0024000.ethernet eth0: RX BD ring size for Q[0]: 256
>> fsl-gianfar e0024000.ethernet eth0: TX BD ring size for Q[0]: 256
>> fsl-gianfar e0025000.ethernet: enabled errata workarounds, flags: 0x4
>> fsl-gianfar e0025000.ethernet eth1: mac: 02:e0:0c:00:06:fd
>> fsl-gianfar e0025000.ethernet eth1: Running with NAPI enabled
>> fsl-gianfar e0025000.ethernet eth1: RX BD ring size for Q[0]: 256
>> fsl-gianfar e0025000.ethernet eth1: TX BD ring size for Q[0]: 256
>> TCP: cubic registered
>> Initializing XFRM netlink socket
>> NET: Registered protocol family 17
>>
>> ...
>>
>> root@sbc8548:~# cat /proc/version 
>> Linux version 3.14.0-rc3-00024-g7119f42057c6 (paul@yow-lpgnfs-02) (gcc 
>> version 4.5.2 (GCC) ) #1 Wed Feb 19 16:08:17 EST 2014
>> root@sbc8548:~#
>>
>> Paul.
>> --
>>
>>>
>>> g.
>>>
>>>> ---
>>>> libphy: Freescale PowerQUICC MII Bus: probed
>>>> mdio_bus ethernet@e002400: /soc8548@e000/ethernet@24000/mdio@520
>>>> PHY address 1312 is too large
>>>> libphy: Freescale PowerQUICC MII Bus: probed
>>>> libphy: Freescale PowerQUICC MII Bus: probed
>>>> mdio_bus ethernet@e002500: /soc8548@e000/ethernet@25000/mdio@520
>>>> PHY address 1312 is too large
>>>> libphy: Freescale PowerQUICC MII Bus: probed
>>>> TCP: cubic registered
>>>> Initializing XFRM netlink socket
>>>> NET: Registered protocol family 17
>>>> 
>>>> ---
>>>>
>>>> On a normal boot, we should see this:
>>>> ---
>>>> libphy: Freescale PowerQUICC MII Bus: probed
>>>> libphy: Freescale PowerQUICC MII Bus: probed
>>>> fsl-gianfar e0024000.ethernet: enabled errata workarounds, flags: 0x4
>>>> fsl-gianfar e0024000.ethernet eth0: mac: 02:e0:0c:00:05:fd
>>>> fsl-gianfar e0024000.ethernet eth0: Running with NAPI enabled
>>>> fsl-gianfar e0024000.ethernet eth0: RX BD ring size for Q[0]: 256
>>>> fsl-gianfar e0024000.ethernet eth0: TX BD ring size for Q[0]: 256
>>>> fsl-gianfar e0025000.ethernet: enabled errata workarounds, flags: 0x4
>>>> fsl-gianfar e0025000.ethernet eth1: mac: 02:e0:0c:00:06:fd
>>>> fsl-gianfar e0025000.ethernet eth1: Running with NAPI enabled
>>>> fsl-gianfar e0025000.ethernet eth1: RX BD ring size for Q[0]: 256
>>>> fsl-gianfar e0025000.ethernet eth1: TX BD ring size for Q[0]: 256
>>>>

[PATCH v2] powerpc: select MEMORY for FSL_IFC to not break existing .config files

2014-02-19 Thread Paul Gortmaker
commit d2ae2e20fbdde5a65f3a5a153044ab1e5c53f7cc ("driver/memory:Move
Freescale IFC driver to a common driver") introduces this build
regression into the mpc85xx_defconfig:

 drivers/built-in.o: In function `fsl_ifc_nand_remove':
 drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/built-in.o: In function `fsl_ifc_nand_probe':
 drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/built-in.o: In function `match_bank':
 drivers/mtd/nand/fsl_ifc_nand.c:1013: undefined reference to 
`convert_ifc_address'
 drivers/built-in.o: In function `fsl_ifc_nand_probe':
 drivers/mtd/nand/fsl_ifc_nand.c:1059: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/mtd/nand/fsl_ifc_nand.c:1080: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to `fsl_ifc_ctrl_dev'
 drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to `fsl_ifc_ctrl_dev'
 make: *** [vmlinux] Error 1

This happens because there is nothing to descend us into the
drivers/memory directory in the mpc85xx_defconfig.  It wasn't
selecting CONFIG_MEMORY.  So we never built drivers/memory/fsl_ifc.o
and so we have nothing to link the above symbols against.

Since the goal of the original commit was to relocate the driver to
an arch independent location, it only makes sense to relocate the
Kconfig setting there as well.  But that alone won't fix the build
failure; for that we ensure whoever selects FSL_IFC also selects MEMORY.

Cc: Prabhakar Kushwaha 
Cc: Scott Wood 
Cc: Arnd Bergmann 
Cc: David Woodhouse 
Cc: Greg Kroah-Hartman 
Signed-off-by: Paul Gortmaker 
---

[v2: fix the mislocated FSL_IFC as per Scott's comment.  It still
 probably makes sense to go in via Greg's char-misc/char-misc-next
 (vs. powerpc-next) since that is where the regression was introduced.]

 arch/powerpc/Kconfig | 4 
 drivers/memory/Kconfig   | 4 
 drivers/mtd/nand/Kconfig | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 957bf344c0f5..b9fcecc706ab 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -736,10 +736,6 @@ config FSL_LBC
  controller.  Also contains some common code used by
  drivers for specific local bus peripherals.
 
-config FSL_IFC
-   bool
-depends on FSL_SOC
-
 config FSL_GTM
bool
depends on PPC_83xx || QUICC_ENGINE || CPM2
diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
index 29a11db365bc..a3640fe9852f 100644
--- a/drivers/memory/Kconfig
+++ b/drivers/memory/Kconfig
@@ -50,4 +50,8 @@ config TEGRA30_MC
  analysis, especially for IOMMU/SMMU(System Memory Management
  Unit) module.
 
+config FSL_IFC
+   bool
+   depends on FSL_SOC
+
 endif
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index 90ff447bf043..a4bee41ad5cb 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -428,6 +428,7 @@ config MTD_NAND_FSL_IFC
tristate "NAND support for Freescale IFC controller"
depends on MTD_NAND && FSL_SOC
select FSL_IFC
+   select MEMORY
help
  Various Freescale chips e.g P1010, include a NAND Flash machine
  with built-in hardware ECC capabilities.
-- 
1.8.5.2

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


Re: [PATCH v2] powerpc: select MEMORY for FSL_IFC to not break existing .config files

2014-02-20 Thread Paul Gortmaker
On 14-02-20 01:05 AM, Prabhakar Kushwaha wrote:
> 
> On 2/20/2014 4:16 AM, Paul Gortmaker wrote:
>> commit d2ae2e20fbdde5a65f3a5a153044ab1e5c53f7cc ("driver/memory:Move
>> Freescale IFC driver to a common driver") introduces this build
>> regression into the mpc85xx_defconfig:
>>
>>   drivers/built-in.o: In function `fsl_ifc_nand_remove':
>>   drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>   drivers/mtd/nand/fsl_ifc_nand.c:1147: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>   drivers/built-in.o: In function `fsl_ifc_nand_probe':
>>   drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>   drivers/mtd/nand/fsl_ifc_nand.c:1031: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>   drivers/built-in.o: In function `match_bank':
>>   drivers/mtd/nand/fsl_ifc_nand.c:1013: undefined reference to 
>> `convert_ifc_address'
>>   drivers/built-in.o: In function `fsl_ifc_nand_probe':
>>   drivers/mtd/nand/fsl_ifc_nand.c:1059: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>   drivers/mtd/nand/fsl_ifc_nand.c:1080: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>   drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>   drivers/mtd/nand/fsl_ifc_nand.c:1069: undefined reference to 
>> `fsl_ifc_ctrl_dev'
>>   make: *** [vmlinux] Error 1
>>
>> This happens because there is nothing to descend us into the
>> drivers/memory directory in the mpc85xx_defconfig.  It wasn't
>> selecting CONFIG_MEMORY.  So we never built drivers/memory/fsl_ifc.o
>> and so we have nothing to link the above symbols against.
>>
>> Since the goal of the original commit was to relocate the driver to
>> an arch independent location, it only makes sense to relocate the
>> Kconfig setting there as well.  But that alone won't fix the build
>> failure; for that we ensure whoever selects FSL_IFC also selects MEMORY.
>>
>> Cc: Prabhakar Kushwaha 
>> Cc: Scott Wood 
>> Cc: Arnd Bergmann 
>> Cc: David Woodhouse 
>> Cc: Greg Kroah-Hartman 
>> Signed-off-by: Paul Gortmaker 
>> ---
>>
>> [v2: fix the mislocated FSL_IFC as per Scott's comment.  It still
>>   probably makes sense to go in via Greg's char-misc/char-misc-next
>>   (vs. powerpc-next) since that is where the regression was introduced.]
>>
>>   arch/powerpc/Kconfig | 4 
>>   drivers/memory/Kconfig   | 4 
>>   drivers/mtd/nand/Kconfig | 1 +
>>   3 files changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
>> index 957bf344c0f5..b9fcecc706ab 100644
>> --- a/arch/powerpc/Kconfig
>> +++ b/arch/powerpc/Kconfig
>> @@ -736,10 +736,6 @@ config FSL_LBC
>>controller.  Also contains some common code used by
>>drivers for specific local bus peripherals.
>>   
>> -config FSL_IFC
>> -bool
>> -depends on FSL_SOC
>> -
>>   config FSL_GTM
>>  bool
>>  depends on PPC_83xx || QUICC_ENGINE || CPM2
>> diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
>> index 29a11db365bc..a3640fe9852f 100644
>> --- a/drivers/memory/Kconfig
>> +++ b/drivers/memory/Kconfig
>> @@ -50,4 +50,8 @@ config TEGRA30_MC
>>analysis, especially for IOMMU/SMMU(System Memory Management
>>Unit) module.
>>   
>> +config FSL_IFC
>> +bool
>> +depends on FSL_SOC
>> +
>>   endif
>> diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
>> index 90ff447bf043..a4bee41ad5cb 100644
>> --- a/drivers/mtd/nand/Kconfig
>> +++ b/drivers/mtd/nand/Kconfig
>> @@ -428,6 +428,7 @@ config MTD_NAND_FSL_IFC
>>  tristate "NAND support for Freescale IFC controller"
>>  depends on MTD_NAND && FSL_SOC
>>  select FSL_IFC
>> +select MEMORY
>>  help
>>Various Freescale chips e.g P1010, include a NAND Flash machine
>>with built-in hardware ECC capabilities.
> 
> Hi All,
> 
> I am not sure which version of patch is being picked here.
> 
> Latest version is v8 and it is a "patch set" and it do enable 
> CONFIG_MEMORY in powerpc/configs

It really doesn't matter what the latest version is, if the
maintainer has already taken an earlier version and merged it.
In that case one needs to work with the maintainer to determine
whether they want a new version, or a delta/fixup commit on the
old 

Re: [PATCH 1/2] powerpc/powernv: Enable fetching of platform sensor data

2014-03-28 Thread Paul Gortmaker
On Fri, Mar 7, 2014 at 12:33 AM, Neelesh Gupta
 wrote:
> This patch enables fetching of various platform sensor data through
> OPAL and expects a sensor handle from the driver to pass to OPAL.

Looks like a missing header, causing build failures on celleb_defconfig

cc1: warnings being treated as errors
In file included from arch/powerpc/platforms/powernv/opal-sensor.c:23:0:
/home/paul/git/linux-head/arch/powerpc/include/asm/opal.h:893:42:
error: 'struct notifier_block' declared inside parameter list
/home/paul/git/linux-head/arch/powerpc/include/asm/opal.h:893:42:
error: its scope is only this definition or declaration, which is
probably not what you want
/home/paul/git/linux-head/arch/powerpc/include/asm/opal.h:895:14:
error: 'struct notifier_block' declared inside parameter list
make[2]: *** [arch/powerpc/platforms/powernv/opal-sensor.o] Error 1
make[1]: *** [arch/powerpc/platforms/powernv] Error 2
make[1]: *** Waiting for unfinished jobs
make: *** [arch/powerpc/platforms] Error 2
make: *** Waiting for unfinished jobs
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[4029cd66545f0a45258eda5313b7559bfee4] powerpc/powernv: Enable
reading and updating of system parameters
running ./x
#
# configuration written to .config
#
7224adbbb80329d1a3ec5aa98213b50365fcd246 is the first bad commit
commit 7224adbbb80329d1a3ec5aa98213b50365fcd246
Author: Neelesh Gupta 
Date:   Fri Mar 7 11:03:27 2014 +0530

powerpc/powernv: Enable fetching of platform sensor data

This patch enables fetching of various platform sensor data through
OPAL and expects a sensor handle from the driver to pass to OPAL.

Signed-off-by: Neelesh Gupta 
Signed-off-by: Benjamin Herrenschmidt 

:04 04 ee7c8dec121a0da53be09da0e1449d8b885ef8a1
b8c4906de326638be77387c78173f7148369d6ff March
bisect run success

http://kisskb.ellerman.id.au/kisskb/buildresult/10844143/

Paul.
---

>
> Signed-off-by: Neelesh Gupta 
> Signed-off-by: Benjamin Herrenschmidt 
> ---
>  arch/powerpc/include/asm/opal.h|4 ++
>  arch/powerpc/platforms/powernv/Makefile|2 -
>  arch/powerpc/platforms/powernv/opal-sensor.c   |   64 
> 
>  arch/powerpc/platforms/powernv/opal-wrappers.S |1
>  4 files changed, 70 insertions(+), 1 deletion(-)
>  create mode 100644 arch/powerpc/platforms/powernv/opal-sensor.c
>
> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
> index 60b3edc..a1cc4dd 100644
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -159,6 +159,7 @@ extern int opal_enter_rtas(struct rtas_args *args,
>  #define OPAL_GET_MSG   85
>  #define OPAL_CHECK_ASYNC_COMPLETION86
>  #define OPAL_SYNC_HOST_REBOOT  87
> +#define OPAL_SENSOR_READ   88
>  #define OPAL_GET_PARAM 89
>  #define OPAL_SET_PARAM 90
>
> @@ -847,6 +848,8 @@ int64_t opal_get_param(uint64_t token, uint32_t param_id, 
> uint64_t buffer,
> size_t length);
>  int64_t opal_set_param(uint64_t token, uint32_t param_id, uint64_t buffer,
> size_t length);
> +int64_t opal_sensor_read(uint32_t sensor_hndl, int token,
> +   uint32_t *sensor_data);
>
>  /* Internal functions */
>  extern int early_init_dt_scan_opal(unsigned long node, const char *uname, 
> int depth, void *data);
> @@ -875,6 +878,7 @@ extern int opal_async_get_token_interruptible(void);
>  extern int __opal_async_release_token(int token);
>  extern int opal_async_release_token(int token);
>  extern int opal_async_wait_response(uint64_t token, struct opal_msg *msg);
> +extern int opal_get_sensor_data(u32 sensor_hndl, u32 *sensor_data);
>
>  extern void hvc_opal_init_early(void);
>
> diff --git a/arch/powerpc/platforms/powernv/Makefile 
> b/arch/powerpc/platforms/powernv/Makefile
> index e6166d3..00ae938 100644
> --- a/arch/powerpc/platforms/powernv/Makefile
> +++ b/arch/powerpc/platforms/powernv/Makefile
> @@ -1,6 +1,6 @@
>  obj-y  += setup.o opal-takeover.o opal-wrappers.o opal.o 
> opal-async.o
>  obj-y  += opal-rtc.o opal-nvram.o opal-lpc.o opal-flash.o 
> opal-sysparam.o
> -obj-y  += rng.o
> +obj-y  += rng.o opal-sensor.o
>
>  obj-$(CONFIG_SMP)  += smp.o
>  obj-$(CONFIG_PCI)  += pci.o pci-p5ioc2.o pci-ioda.o
> diff --git a/arch/powerpc/platforms/powernv/opal-sensor.c 
> b/arch/powerpc/platforms/powernv/opal-sensor.c
> new file mode 100644
> index 000..663cc9c
> --- /dev/null
> +++ b/arch/powerpc/platforms/powernv/opal-sensor.c
> @@ -0,0 +1,64 @@
> +/*
> + * PowerNV sensor code
> + *
> + * Copyright (C) 2013 IBM
> + *
> + * 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 you

[PATCH 1/3] powerpc: make cell/spu_base.c explicitly non-modular

2016-03-27 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

arch/powerpc/platforms/cell/Kconfig:config SPU_BASE
arch/powerpc/platforms/cell/Kconfig:bool

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Arnd Bergmann 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Michael Ellerman 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/platforms/cell/spu_base.c | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spu_base.c 
b/arch/powerpc/platforms/cell/spu_base.c
index f7af74f83693..3ede04ffdeea 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -24,7 +24,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -805,7 +805,4 @@ static int __init init_spu_base(void)
  out:
return ret;
 }
-module_init(init_spu_base);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Arnd Bergmann ");
+device_initcall(init_spu_base);
-- 
2.6.1

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

[PATCH 3/3] drivers/cpufreq: make ppc_cbe_cpufreq_pmi driver explicitly non-modular

2016-03-27 Thread Paul Gortmaker
The Kconfig for this driver is currently:

config CPU_FREQ_CBE_PMI
bool "CBE frequency scaling using PMI interface"

...meaning that it currently is not being built as a module by
anyone.  Lets remove the modular and unused code here, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: "Rafael J. Wysocki" 
Cc: Viresh Kumar 
Cc: Christian Krafft 
Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Michael Ellerman 
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux...@vger.kernel.org
Signed-off-by: Paul Gortmaker 
---
 drivers/cpufreq/ppc_cbe_cpufreq_pmi.c | 15 ++-
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/cpufreq/ppc_cbe_cpufreq_pmi.c 
b/drivers/cpufreq/ppc_cbe_cpufreq_pmi.c
index 7969f7690498..7c4cd5c634f2 100644
--- a/drivers/cpufreq/ppc_cbe_cpufreq_pmi.c
+++ b/drivers/cpufreq/ppc_cbe_cpufreq_pmi.c
@@ -23,7 +23,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
@@ -142,15 +142,4 @@ static int __init cbe_cpufreq_pmi_init(void)
 
return 0;
 }
-
-static void __exit cbe_cpufreq_pmi_exit(void)
-{
-   cpufreq_unregister_notifier(&pmi_notifier_block, 
CPUFREQ_POLICY_NOTIFIER);
-   pmi_unregister_handler(&cbe_pmi_handler);
-}
-
-module_init(cbe_cpufreq_pmi_init);
-module_exit(cbe_cpufreq_pmi_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Christian Krafft ");
+device_initcall(cbe_cpufreq_pmi_init);
-- 
2.6.1

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

[PATCH 0/3] powerpc: remove unused modular code from non-modular drivers

2016-03-27 Thread Paul Gortmaker
My ongoing audit looking for non-modular code that needlessly uses
modular macros (vs. built-in equivalents) and/or has dead code
relating to module unloading that can never be executed led to the
creation of these three powerpc related commits.

One is of the trivial kind, where we substitute in the non-modular
versions that CPP would have put in place anyway, resulting in no
actual changes, even at the binary output level.

The other two are almost as trivial.  In addition to the above, we
toss out the __exit function registered by module_exit, since that
will never get called for non modular code/drivers.

For anyone new to the underlying goal of this cleanup, we are trying to
not use module support for code that can never be built as a module since:

 (1) it is easy to accidentally write unused module_exit and remove code
 (2) it can be misleading when reading the source, thinking it can be
 modular when the Makefile and/or Kconfig prohibit it
 (3) it requires the include of the module.h header file which in turn
 includes nearly everything else, thus adding to CPP overhead.
 (4) it gets copied/replicated into other code and spreads like weeds.

Build tested on v4.6-rc1 to ensure no silly typos that would break
compilation crept in.

---
Cc: Andrzej Hajda 
Cc: Anton Blanchard 
Cc: Arnd Bergmann 
Cc: Benjamin Herrenschmidt 
Cc: Christian Krafft 
Cc: Hari Bathini 
Cc: Michael Ellerman 
Cc: Nathan Fontenot 
Cc: Paul Mackerras 
Cc: "Rafael J. Wysocki" 
Cc: Viresh Kumar 
Cc: linux...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org

Paul Gortmaker (3):
  powerpc: make cell/spu_base.c explicitly non-modular
  powerpc: make kernel/nvram_64.c explicitly non-modular
  drivers/cpufreq: make ppc_cbe_cpufreq_pmi driver explicitly
non-modular

 arch/powerpc/kernel/nvram_64.c | 12 +---
 arch/powerpc/platforms/cell/spu_base.c |  7 ++-
 drivers/cpufreq/ppc_cbe_cpufreq_pmi.c  | 15 ++-
 3 files changed, 5 insertions(+), 29 deletions(-)

-- 
2.6.1

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

[PATCH 2/3] powerpc: make kernel/nvram_64.c explicitly non-modular

2016-03-27 Thread Paul Gortmaker
The Makefile/Kconfig currently controlling compilation of this code is:

obj-$(CONFIG_PPC64) += setup_64.o sys_ppc32.o \
   signal_64.o ptrace32.o \
   paca.o nvram_64.o firmware.o

arch/powerpc/platforms/Kconfig.cputype:config PPC64
arch/powerpc/platforms/Kconfig.cputype: bool "64-bit kernel"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We don't replace module.h with init.h since the file already has that.

We delete the MODULE_LICENSE tag since that information is already
contained at the top of the file in the comments.

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Michael Ellerman 
Cc: Hari Bathini 
Cc: Nathan Fontenot 
Cc: Andrzej Hajda 
Cc: Anton Blanchard 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/kernel/nvram_64.c | 12 +---
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c
index 0cab9e8c3794..856f9a7944cd 100644
--- a/arch/powerpc/kernel/nvram_64.c
+++ b/arch/powerpc/kernel/nvram_64.c
@@ -15,8 +15,6 @@
  *   parsing code.
  */
 
-#include 
-
 #include 
 #include 
 #include 
@@ -1231,12 +1229,4 @@ static int __init nvram_init(void)

return rc;
 }
-
-static void __exit nvram_cleanup(void)
-{
-misc_deregister( &nvram_dev );
-}
-
-module_init(nvram_init);
-module_exit(nvram_cleanup);
-MODULE_LICENSE("GPL");
+device_initcall(nvram_init);
-- 
2.6.1

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

Re: [PATCH v2 0/5] drivers/tty: make more bool drivers explicitly non-modular

2015-09-26 Thread Paul Gortmaker
[[PATCH v2 0/5] drivers/tty: make more bool drivers explicitly non-modular] On 
19/08/2015 (Wed 17:48) Paul Gortmaker wrote:

> [v2: drop dead module code removal from 8250_lpc18xx.c ; instead convert it
>  from bool to tristate ; also add ack to hvc_console commit.]
> 
> This second set of patches to drivers/tty steps outside of the serial
> dir, and an improved auditing finds two more serial drivers pretending
> to be modular that really are not.

Hi Greg -- wondering if this is still in your to-do queue.  I see the
patches to drivers/char that I sent about the same time made it onto
your char-testing branch but not these onto tty-testing.

The reason I ask is that I've about a 1/2 dozen more similar patches
that showed up once I started auditing non-x86 code.  I don't want to
re-spam you with these along with the new ones, if these are still in
your backlog for processing.

Thanks,
Paul.
--

> 
> The reasoning for doing this is the same as the first set[1] of patches
> and is largely copied below:
> 
>   In the previous merge window, we made changes to allow better
>   delineation between modular and non-modular code in commit
>   0fd972a7d91d6e15393c449492a04d94c0b89351 ("module: relocate module_init
>   from init.h to module.h").  This allows us to now ensure module code
>   looks modular and non-modular code does not accidentally look modular
>   without suffering build breakage.
>   
>   Here we target code that is, by nature of their Kconfig settings, only
>   available to be built-in, but implicitly presenting itself as being
>   possibly modular by way of using modular headers, macros, and functions.
>   
>   The goal here is to remove that illusion of modularity from these
>   drivers, but in a way that leaves the actual runtime unchanged.
>   In doing so, we remove code that has never been tested and adds
>   no value to the tree.  And we begin the process of expecting a
>   level of consistency between the Kconfig of a driver and the code
>   that the driver uses.
>   
> Build tested for allyesconfig on x86_64, and ARM for lpc81xx, and powerpc
> for hvc_console and mpsc, layered onto tty/tty-next as a baseline.
> 
> Paul.
> 
> [1] 
> https://lkml.kernel.org/r/1437530538-5078-1-git-send-email-paul.gortma...@windriver.com
> --
> 
> Cc: Greg Kroah-Hartman 
> Cc: Jiri Slaby 
> Cc: Joachim Eastwood 
> Cc: linux-arm-ker...@lists.infradead.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-ser...@vger.kernel.org
> 
> Paul Gortmaker (5):
>   drivers/tty: make pty.c slightly more explicitly non-modular
>   drivers/tty: make sysrq.c slightly more explicitly non-modular
>   drivers/tty: make hvc_console.c explicitly non-modular
>   drivers/tty: make serial/mpsc.c driver explicitly non-modular
>   drivers/tty: make serial 8250_lpc18xx.c Kconfig a tristate
> 
>  drivers/tty/hvc/hvc_console.c   | 18 +-
>  drivers/tty/pty.c   |  7 +--
>  drivers/tty/serial/8250/Kconfig |  2 +-
>  drivers/tty/serial/mpsc.c   | 36 +++-
>  drivers/tty/sysrq.c |  6 +-
>  5 files changed, 15 insertions(+), 54 deletions(-)
> 
> -- 
> 2.5.0
> 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] tty: disable unbind for old 74xx based serial/mpsc console port

2015-10-13 Thread Paul Gortmaker
We recently got rid of some modular code in this driver and also
got rid of the unused ".remove" function at the same time.  Thierry
noted that it was however possible to force the remove through the
bind/unbind interface.

Since this is a console device used on 2005 vintage 74xx based
powerpc embedded targets, and is essentially always used in
conjunction with SERIAL_MPSC_CONSOLE=y -- there is no sane reason
anyone would ever want to unbind the builtin driver and lose the
console.  So we just explicitly block bind/unbind operations and
prevent root from shooting themselves in the foot.

Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: Thierry Reding 
Cc: linux-ser...@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 drivers/tty/serial/mpsc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c
index 2f43a58cb392..cadfd1cfae2b 100644
--- a/drivers/tty/serial/mpsc.c
+++ b/drivers/tty/serial/mpsc.c
@@ -2109,7 +2109,8 @@ static int mpsc_drv_probe(struct platform_device *dev)
 static struct platform_driver mpsc_driver = {
.probe  = mpsc_drv_probe,
.driver = {
-   .name   = MPSC_CTLR_NAME,
+   .name   = MPSC_CTLR_NAME,
+   .suppress_bind_attrs= true,
},
 };
 
-- 
2.6.1

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

[PATCH] powerpc: Delete old orphaned PrPMC 280/2800 DTS and boot file.

2015-10-13 Thread Paul Gortmaker
In commit 3c8464a9b12bf83807b6e2c896d7e7b633e1cae7 ("powerpc:
Delete old PrPMC 280/2800 support") we got rid of most of the C
code, and the Makefile/Kconfig hooks, but it seems I left the
platform's DTS file orphaned in the tree as well as the boot code.
Here we get rid of them both.

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Michael Ellerman 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/boot/dts/prpmc2800.dts | 297 ---
 arch/powerpc/boot/prpmc2800.c   | 571 
 2 files changed, 868 deletions(-)
 delete mode 100644 arch/powerpc/boot/dts/prpmc2800.dts
 delete mode 100644 arch/powerpc/boot/prpmc2800.c

diff --git a/arch/powerpc/boot/dts/prpmc2800.dts 
b/arch/powerpc/boot/dts/prpmc2800.dts
deleted file mode 100644
index 00afaacf8c8c..
--- a/arch/powerpc/boot/dts/prpmc2800.dts
+++ /dev/null
@@ -1,297 +0,0 @@
-/* Device Tree Source for Motorola PrPMC2800
- *
- * Author: Mark A. Greer 
- *
- * 2007 (c) MontaVista, Software, Inc.  This file is licensed under
- * the terms of the GNU General Public License version 2.  This program
- * is licensed "as is" without any warranty of any kind, whether express
- * or implied.
- *
- * Property values that are labeled as "Default" will be updated by bootwrapper
- * if it can determine the exact PrPMC type.
- */
-
-/dts-v1/;
-
-/ {
-   #address-cells = <1>;
-   #size-cells = <1>;
-   model = "PrPMC280/PrPMC2800"; /* Default */
-   compatible = "motorola,PrPMC2800";
-   coherency-off;
-
-   cpus {
-   #address-cells = <1>;
-   #size-cells = <0>;
-
-   PowerPC,7447 {
-   device_type = "cpu";
-   reg = <0>;
-   clock-frequency = <7>;  /* Default */
-   bus-frequency = <1>;
-   timebase-frequency = <>;
-   i-cache-line-size = <32>;
-   d-cache-line-size = <32>;
-   i-cache-size = <32768>;
-   d-cache-size = <32768>;
-   };
-   };
-
-   memory {
-   device_type = "memory";
-   reg = <0x0 0x2000>; /* Default (512MB) */
-   };
-
-   system-controller@f100 { /* Marvell Discovery mv64360 */
-   #address-cells = <1>;
-   #size-cells = <1>;
-   model = "mv64360";  /* Default */
-   compatible = "marvell,mv64360";
-   clock-frequency = <1>;
-   reg = <0xf100 0x1>;
-   virtual-reg = <0xf100>;
-   ranges = <0x8800 0x8800 0x100 /* PCI 0 I/O Space */
- 0x8000 0x8000 0x800 /* PCI 0 MEM Space */
- 0xa000 0xa000 0x400 /* User FLASH */
- 0x 0xf100 0x001 /* Bridge's regs */
- 0xf200 0xf200 0x004>;/* Integrated SRAM */
-
-   flash@a000 {
-   device_type = "rom";
-   compatible = "direct-mapped";
-   reg = <0xa000 0x400>; /* Default (64MB) */
-   probe-type = "CFI";
-   bank-width = <4>;
-   partitions = <0x 0x0010 /* RO */
- 0x0010 0x00040001 /* RW */
- 0x0014 0x0040 /* RO */
- 0x0054 0x039c /* RO */
- 0x03f0 0x0010>; /* RO */
-   partition-names = "FW Image A", "FW Config Data", 
"Kernel Image", "Filesystem", "FW Image B";
-   };
-
-   mdio {
-   #address-cells = <1>;
-   #size-cells = <0>;
-   compatible = "marvell,mv64360-mdio";
-   PHY0: ethernet-phy@1 {
-   compatible = "broadcom,bcm5421";
-   interrupts = <76>;  /* GPP 12 */
-   interrupt-parent = <&PIC>;
-   reg = <1>;
-   };
-   PHY1: ethernet-phy@3 {
-   compatible = "broadcom,bcm5421";
-   interrupts = <76>;  /* GPP 12 */
-   interrupt-

[PATCH 1/5] drivers/tty: make hvc/hvc_vio.c explicitly non-modular

2015-10-18 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/tty/hvc/Kconfig:config HVC_CONSOLE
drivers/tty/hvc/Kconfig:bool "pSeries Hypervisor Virtual Console 
support"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

We don't replace module.h with init.h since the file already has that.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: Michael Ellerman 
Cc: Anton Blanchard 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 drivers/tty/hvc/hvc_vio.c | 29 -
 1 file changed, 4 insertions(+), 25 deletions(-)

diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c
index f575a9b5ede7..b05dc5086627 100644
--- a/drivers/tty/hvc/hvc_vio.c
+++ b/drivers/tty/hvc/hvc_vio.c
@@ -41,7 +41,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -61,7 +60,6 @@ static struct vio_device_id hvc_driver_table[] = {
 #endif
{ "", "" }
 };
-MODULE_DEVICE_TABLE(vio, hvc_driver_table);
 
 typedef enum hv_protocol {
HV_PROTOCOL_RAW,
@@ -363,26 +361,13 @@ static int hvc_vio_probe(struct vio_dev *vdev,
return 0;
 }
 
-static int hvc_vio_remove(struct vio_dev *vdev)
-{
-   struct hvc_struct *hp = dev_get_drvdata(&vdev->dev);
-   int rc, termno;
-
-   termno = hp->vtermno;
-   rc = hvc_remove(hp);
-   if (rc == 0) {
-   if (hvterm_privs[termno] != &hvterm_priv0)
-   kfree(hvterm_privs[termno]);
-   hvterm_privs[termno] = NULL;
-   }
-   return rc;
-}
-
 static struct vio_driver hvc_vio_driver = {
.id_table   = hvc_driver_table,
.probe  = hvc_vio_probe,
-   .remove = hvc_vio_remove,
.name   = hvc_driver_name,
+   .driver = {
+   .suppress_bind_attrs= true,
+   },
 };
 
 static int __init hvc_vio_init(void)
@@ -394,13 +379,7 @@ static int __init hvc_vio_init(void)
 
return rc;
 }
-module_init(hvc_vio_init); /* after drivers/char/hvc_console.c */
-
-static void __exit hvc_vio_exit(void)
-{
-   vio_unregister_driver(&hvc_vio_driver);
-}
-module_exit(hvc_vio_exit);
+device_initcall(hvc_vio_init); /* after drivers/tty/hvc/hvc_console.c */
 
 void __init hvc_vio_init_early(void)
 {
-- 
2.6.1

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

[PATCH 2/5] drivers/tty: make ehv_bytechan.c explicitly non-modular

2015-10-18 Thread Paul Gortmaker
The Kconfig currently controlling compilation of this code is:

drivers/tty/Kconfig:config PPC_EPAPR_HV_BYTECHAN
drivers/tty/Kconfig:bool "ePAPR hypervisor byte channel driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 drivers/tty/ehv_bytechan.c | 40 +++-
 1 file changed, 3 insertions(+), 37 deletions(-)

diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c
index 342b36b9ad35..7ac9bcdf1e61 100644
--- a/drivers/tty/ehv_bytechan.c
+++ b/drivers/tty/ehv_bytechan.c
@@ -23,7 +23,6 @@
  * byte channel used for the console is designated as the default tty.
  */
 
-#include 
 #include 
 #include 
 #include 
@@ -719,19 +718,6 @@ error:
return ret;
 }
 
-static int ehv_bc_tty_remove(struct platform_device *pdev)
-{
-   struct ehv_bc_data *bc = dev_get_drvdata(&pdev->dev);
-
-   tty_unregister_device(ehv_bc_driver, bc - bcs);
-
-   tty_port_destroy(&bc->port);
-   irq_dispose_mapping(bc->tx_irq);
-   irq_dispose_mapping(bc->rx_irq);
-
-   return 0;
-}
-
 static const struct of_device_id ehv_bc_tty_of_ids[] = {
{ .compatible = "epapr,hv-byte-channel" },
{}
@@ -741,15 +727,15 @@ static struct platform_driver ehv_bc_tty_driver = {
.driver = {
.name = "ehv-bc",
.of_match_table = ehv_bc_tty_of_ids,
+   .suppress_bind_attrs = true,
},
.probe  = ehv_bc_tty_probe,
-   .remove = ehv_bc_tty_remove,
 };
 
 /**
  * ehv_bc_init - ePAPR hypervisor byte channel driver initialization
  *
- * This function is called when this module is loaded.
+ * This function is called when this driver is loaded.
  */
 static int __init ehv_bc_init(void)
 {
@@ -814,24 +800,4 @@ error:
 
return ret;
 }
-
-
-/**
- * ehv_bc_exit - ePAPR hypervisor byte channel driver termination
- *
- * This function is called when this driver is unloaded.
- */
-static void __exit ehv_bc_exit(void)
-{
-   platform_driver_unregister(&ehv_bc_tty_driver);
-   tty_unregister_driver(ehv_bc_driver);
-   put_tty_driver(ehv_bc_driver);
-   kfree(bcs);
-}
-
-module_init(ehv_bc_init);
-module_exit(ehv_bc_exit);
-
-MODULE_AUTHOR("Timur Tabi ");
-MODULE_DESCRIPTION("ePAPR hypervisor byte channel driver");
-MODULE_LICENSE("GPL v2");
+device_initcall(ehv_bc_init);
-- 
2.6.1

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

[PATCH 0/5] drivers/tty: make more bool drivers explicitly non-modular

2015-10-18 Thread Paul Gortmaker
This next set of patches to drivers/tty fixes up more drivers that would
perhaps appear modular when looking at the code, but are controlled by
a bool Kconfig.  We make sure they don't look modular and get rid
of module related code in the drivers that would never be used.

The one common thread here for all the patches is that we also
scrap the .remove functions which would only be used for module
unload (impossible) and driver unbind.  For the drivers here, there
doesn't seem to be a sensible unbind use case (vs. e.g. a multiport
PCI ethernet driver where one port is unbound and passed through to
a kvm guest or similar).  Hence we just explicitly disallow any
driver unbind operations to help prevent root from doing something
illogical to the machine that they could have done previously.

We've already done this for drivers/tty/serial/mpsc.c previously.

Build tested for allmodconfig on ARM64 and powerpc for tty/tty-testing.

Paul.

---

Cc: Andy Gross 
Cc: Anton Blanchard 
Cc: David Brown 
Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: Kumar Gala 
Cc: Matthias Brugger 
Cc: Michael Ellerman 
Cc: Nicolas Ferre 
Cc: linux-arm-ker...@lists.infradead.org
Cc: linux-arm-...@vger.kernel.org
Cc: linux-media...@lists.infradead.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-ser...@vger.kernel.org
Cc: linux-...@vger.kernel.org

Paul Gortmaker (5):
  drivers/tty: make hvc/hvc_vio.c explicitly non-modular
  drivers/tty: make ehv_bytechan.c explicitly non-modular
  drivers/tty/serial: make serial/atmel_serial.c explicitly non-modular
  drivers/tty/serial: make msm_serial.c explicitly non-modular
  drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular

 drivers/tty/ehv_bytechan.c | 40 +++--
 drivers/tty/hvc/hvc_vio.c  | 29 
 drivers/tty/serial/8250/8250_mtk.c | 35 ++---
 drivers/tty/serial/atmel_serial.c  | 45 --
 drivers/tty/serial/msm_serial.c| 30 -
 5 files changed, 22 insertions(+), 157 deletions(-)

-- 
2.6.1

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

Re: [PATCH 0/5] drivers/tty: make more bool drivers explicitly non-modular

2015-10-20 Thread Paul Gortmaker
[Re: [PATCH 0/5] drivers/tty: make more bool drivers explicitly non-modular] On 
20/10/2015 (Tue 17:10) Alexandre Belloni wrote:

> On 18/10/2015 at 18:21:13 -0400, Paul Gortmaker wrote :
> > The one common thread here for all the patches is that we also
> > scrap the .remove functions which would only be used for module
> > unload (impossible) and driver unbind.  For the drivers here, there
> > doesn't seem to be a sensible unbind use case (vs. e.g. a multiport
> > PCI ethernet driver where one port is unbound and passed through to
> > a kvm guest or similar).  Hence we just explicitly disallow any
> > driver unbind operations to help prevent root from doing something
> > illogical to the machine that they could have done previously.
> > 
> > We've already done this for drivers/tty/serial/mpsc.c previously.
> > 
> > Build tested for allmodconfig on ARM64 and powerpc for tty/tty-testing.
> > 
> 
> So, how does this actually build test atmel_serial?

Not sure why this should be a surprise;  I build test it exactly like this:

paul@builder-02:~/git/linux-head$ echo $ARCH
arm64
paul@builder-02:~/git/linux-head$ echo $CROSS_COMPILE 
aarch64-linux-gnu-
paul@builder-02:~/git/linux-head$ make O=../arm-build/  
drivers/tty/serial/atmel_serial.o
make[1]: Entering directory '/home/paul/git/arm-build'
arch/arm64/Makefile:25: LSE atomics not supported by binutils
  CHK include/config/kernel.release
  Using /home/paul/git/linux-head as source for kernel
  GEN ./Makefile
  CHK include/generated/uapi/linux/version.h
  CHK include/generated/utsrelease.h

[...]

  HOSTCC  scripts/sign-file
  HOSTCC  scripts/extract-cert
  CC  drivers/tty/serial/atmel_serial.o
make[1]: Leaving directory '/home/paul/git/arm-build'
paul@builder-02:~/git/linux-head$ 

It did build; no warning/error.  Would you call it an invalid build test?

> 
> A proper solution would be to actually make it a tristate and allow
> building as a module. I think it currently fails because of
> console_initcall() but that is certainly fixable.

Well, as per other threads on this topic, if people want to extend
the functionality to support tristate, then great.  But please do
not confuse that with existing functionality which is clearly non
modular in this case.

Thanks,
Paul.
--

> 
> 
> -- 
> Alexandre Belloni, Free Electrons
> Embedded Linux, Kernel and Android engineering
> http://free-electrons.com
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: warn on spurious irq events (but ratelimited)

2015-12-07 Thread Paul Gortmaker
It might be worth warning on spurious IRQ events; they might
point someone at a bogus DTS value or similar.

But ratelimit them to ensure we aren't too spammy about it.

Cc: Benjamin Herrenschmidt 
Cc: Paul Mackerras 
Cc: Michael Ellerman 
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/kernel/irq.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 290559df1e8b..5c777e3a4c04 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -497,10 +497,12 @@ void __do_irq(struct pt_regs *regs)
may_hard_irq_enable();
 
/* And finally process it */
-   if (unlikely(irq == NO_IRQ))
+   if (unlikely(irq == NO_IRQ)) {
+   printk_ratelimited(KERN_WARNING "spurious irq on %d\n", irq);
__this_cpu_inc(irq_stat.spurious_irqs);
-   else
+   } else {
generic_handle_irq(irq);
+   }
 
trace_irq_exit(regs);
 
-- 
2.6.1

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

[PATCH] sbc8641: drop bogus PHY IRQ entries from DTS file

2015-12-08 Thread Paul Gortmaker
This file was originally cloned off of the MPC8641D-HPCN reference
platform, which actually had a PHY IRQ line connected.  However
this board does not.  The bogus entry was largely inert and went
undetected until commit 321beec5047af83db90c88114b7e664b156f49fe
("net: phy: Use interrupts when available in NOLINK state") was
added to the tree.

With the above commit, the board fails to NFS boot since it sits
waiting for a PHY IRQ event that of course never arrives.  Removing
the bogus entries from the DTS file fixes the issue.

Cc: Andrew Lunn 
Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/boot/dts/sbc8641d.dts | 8 
 1 file changed, 8 deletions(-)

diff --git a/arch/powerpc/boot/dts/sbc8641d.dts 
b/arch/powerpc/boot/dts/sbc8641d.dts
index 631ede72e226..68f0ed7626bd 100644
--- a/arch/powerpc/boot/dts/sbc8641d.dts
+++ b/arch/powerpc/boot/dts/sbc8641d.dts
@@ -227,23 +227,15 @@
reg = <0x520 0x20>;
 
phy0: ethernet-phy@1f {
-   interrupt-parent = <&mpic>;
-   interrupts = <10 1>;
reg = <0x1f>;
};
phy1: ethernet-phy@0 {
-   interrupt-parent = <&mpic>;
-   interrupts = <10 1>;
reg = <0>;
};
phy2: ethernet-phy@1 {
-   interrupt-parent = <&mpic>;
-   interrupts = <10 1>;
reg = <1>;
};
phy3: ethernet-phy@2 {
-   interrupt-parent = <&mpic>;
-   interrupts = <10 1>;
reg = <2>;
};
tbi0: tbi-phy@11 {
-- 
2.6.1

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

Re: [PATCH] sbc8641: drop bogus PHY IRQ entries from DTS file

2015-12-08 Thread Paul Gortmaker
[Re: [PATCH] sbc8641: drop bogus PHY IRQ entries from DTS file] On 09/12/2015 
(Wed 12:10) Michael Ellerman wrote:

> On Tue, 2015-12-08 at 17:44 -0500, Paul Gortmaker wrote:
> 
> > This file was originally cloned off of the MPC8641D-HPCN reference
> > platform, which actually had a PHY IRQ line connected.  However
> > this board does not.  The bogus entry was largely inert and went
> > undetected until commit 321beec5047af83db90c88114b7e664b156f49fe
> > ("net: phy: Use interrupts when available in NOLINK state") was
> > added to the tree.
> > 
> > With the above commit, the board fails to NFS boot since it sits
> > waiting for a PHY IRQ event that of course never arrives.  Removing
> > the bogus entries from the DTS file fixes the issue.
> 
> Commit 321beec5047a ("net: phy: Use interrupts when available in NOLINK 
> state")
> went into 4.4-rc2, so this is a fix for 4.4 right?

Correct, but I'm guessing there are not thousands of users of this board
out there, so it probably doesn't matter a whole lot if it goes in the
same release where the regression happened or one release later...

P.
--

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

Re: [PATCH] sbc8641: drop bogus PHY IRQ entries from DTS file

2015-12-09 Thread Paul Gortmaker
[Re: [PATCH] sbc8641: drop bogus PHY IRQ entries from DTS file] On 09/12/2015 
(Wed 04:07) Andrew Lunn wrote:

> On Tue, Dec 08, 2015 at 05:44:02PM -0500, Paul Gortmaker wrote:
> > This file was originally cloned off of the MPC8641D-HPCN reference
> > platform, which actually had a PHY IRQ line connected.  However
> > this board does not.  The bogus entry was largely inert and went
> > undetected until commit 321beec5047af83db90c88114b7e664b156f49fe
> > ("net: phy: Use interrupts when available in NOLINK state") was
> > added to the tree.
> > 
> > With the above commit, the board fails to NFS boot since it sits
> > waiting for a PHY IRQ event that of course never arrives.  Removing
> > the bogus entries from the DTS file fixes the issue.
> 
> Hi Paul
> 
> Originally the interrupt is used for detecting the link has gone
> down. That would of also been bogus before. Have you tried this?  If

Haven't tried it, but chances are you are right.

> that is also broken, maybe you need to add a fixes: tag so that it
> gets back ported?

Nobody noticed in the past ~7 years or so, but I guess I can point Greg
at it once it is present in mainline.  The main reason I'd Cc'd netdev
is just to possibly save anyone else the investigation if they ran into
the same issue on a different board -which seems highly probable IMHO.

Paul.
--

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

Re: [PATCH 0/5] drivers/tty: make more bool drivers explicitly non-modular

2015-12-15 Thread Paul Gortmaker
[[PATCH 0/5] drivers/tty: make more bool drivers explicitly non-modular] On 
18/10/2015 (Sun 18:21) Paul Gortmaker wrote:

> This next set of patches to drivers/tty fixes up more drivers that would
> perhaps appear modular when looking at the code, but are controlled by
> a bool Kconfig.  We make sure they don't look modular and get rid
> of module related code in the drivers that would never be used.

[...]

> Paul Gortmaker (5):
>   drivers/tty: make hvc/hvc_vio.c explicitly non-modular
>   drivers/tty: make ehv_bytechan.c explicitly non-modular
>   drivers/tty/serial: make serial/atmel_serial.c explicitly non-modular
>   drivers/tty/serial: make msm_serial.c explicitly non-modular
>   drivers/tty/serial: make 8250/8250_mtk.c explicitly non-modular

Hi Greg,

You've merged the #3 atmel patch and #5 the 8250_mtk patch; the msm_serial
patch (#4) is no longer applicable since the authors changed it to tristate.

That leaves the top two patches; both for PPC hardware.  Did you skip
those because you wanted them pushed through the powerpc tree?

If so, that is fine, I can do that.  Just let me know.

Thanks,
Paul.
--

> 
>  drivers/tty/ehv_bytechan.c | 40 +++--
>  drivers/tty/hvc/hvc_vio.c  | 29 
>  drivers/tty/serial/8250/8250_mtk.c | 35 ++---
>  drivers/tty/serial/atmel_serial.c  | 45 
> --
>  drivers/tty/serial/msm_serial.c| 30 -
>  5 files changed, 22 insertions(+), 157 deletions(-)
> 
> -- 
> 2.6.1
> 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH] powerpc: warn on spurious irq events (but ratelimited)

2015-12-21 Thread Paul Gortmaker
On Mon, Dec 7, 2015 at 8:38 PM, Paul Gortmaker
 wrote:
> It might be worth warning on spurious IRQ events; they might
> point someone at a bogus DTS value or similar.
>
> But ratelimit them to ensure we aren't too spammy about it.
>
> Cc: Benjamin Herrenschmidt 
> Cc: Paul Mackerras 
> Cc: Michael Ellerman 
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Paul Gortmaker 
> ---
>  arch/powerpc/kernel/irq.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
> index 290559df1e8b..5c777e3a4c04 100644
> --- a/arch/powerpc/kernel/irq.c
> +++ b/arch/powerpc/kernel/irq.c
> @@ -497,10 +497,12 @@ void __do_irq(struct pt_regs *regs)
> may_hard_irq_enable();
>
> /* And finally process it */
> -   if (unlikely(irq == NO_IRQ))
> +   if (unlikely(irq == NO_IRQ)) {
> +   printk_ratelimited(KERN_WARNING "spurious irq on %d\n", irq);

If we did decide we cared about this patch, then no need for "irq" above, as
we already know it is equal to NO_IRQ.

Paul.
--

> __this_cpu_inc(irq_stat.spurious_irqs);
> -   else
> +   } else {
> generic_handle_irq(irq);
> +   }
>
> trace_irq_exit(regs);
>
> --
> 2.6.1
>
> ___
> 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

Re: [PATCH] powerpc: warn on spurious irq events (but ratelimited)

2015-12-21 Thread Paul Gortmaker
[Re: [PATCH] powerpc: warn on spurious irq events (but ratelimited)] On 
22/12/2015 (Tue 11:10) Michael Ellerman wrote:

> On Mon, 2015-12-21 at 18:18 -0500, Paul Gortmaker wrote:
> > On Mon, Dec 7, 2015 at 8:38 PM, Paul Gortmaker
> >  wrote:
> > > It might be worth warning on spurious IRQ events; they might
> > > point someone at a bogus DTS value or similar.
> > > 

[...]

> > 
> > If we did decide we cared about this patch, then no need for "irq" above, as
> > we already know it is equal to NO_IRQ.
> 
> I'm not convinced it's worth printing, we already have a counter in proc.
> 
> I think it's more likely to just lead to console spam.
> 
> But maybe I'm wrong and you can convince me otherwise :)

I'm not sure I can even convince myself, let alone others.   :)

Feel free to bin it.

Paul.
--

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

Re: [PATCH] fsl-rio: fix compile error

2011-11-11 Thread Paul Gortmaker
On 11-11-11 08:48 AM, Liu Gang wrote:
> The "#include " was replaced by "#include "
> in the patch "powerpc: various straight conversions from module.h --> 
> export.h".
> This will cause the following compile problem:
> arch/powerpc/sysdev/fsl_rio.c: In function 'fsl_rio_mcheck_exception':
> arch/powerpc/sysdev/fsl_rio.c:296: error: implicit declaration of function 
> 'search_exception_tables'.
> 
> The file fsl_rio.c needs the declaration of function "search_exception_tables"
> in the header file "linux/module.h".

Thanks -- not sure why this never showed up in my builds of all the
powerpc configs, _or_ the linux-next builds.  Maybe srio isn't enabled
in any of them? 

In any case it looks fine to me.  Having the search_exception_tables
live in module.h seems odd, but that is an independent issue for later.

I can queue this unless someone else has already done so.

Paul.

> 
> Signed-off-by: Liu Gang 
> ---
>  arch/powerpc/sysdev/fsl_rio.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
> index de170fd..22ffccd 100644
> --- a/arch/powerpc/sysdev/fsl_rio.c
> +++ b/arch/powerpc/sysdev/fsl_rio.c
> @@ -23,7 +23,7 @@
>   */
>  
>  #include 
> -#include 
> +#include 
>  #include 
>  #include 
>  #include 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[GIT PULL] SRIO powerpc compile fix.

2011-11-14 Thread Paul Gortmaker
This fixes a compile regression in powerpc's serial rapidio, caused by
the module.h split.  It wasn't seen in defconfig/linux-next builds
since it isn't enabled anywhere by default.

Thanks,
Paul.


The following changes since commit 1ea6b8f48918282bdca0b32a34095504ee65bab5:

  Linux 3.2-rc1 (2011-11-07 16:16:02 -0800)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux.git for-linus

Liu Gang (1):
  fsl-rio: fix compile error

 arch/powerpc/sysdev/fsl_rio.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] 8250: add workaround for MPC8[356]xx UART break IRQ storm

2011-11-24 Thread Paul Gortmaker
On 11-11-24 03:14 AM, Kumar Gala wrote:
> 
> On Feb 26, 2010, at 1:25 PM, Paul Gortmaker wrote:
> 
>> Sending a break on the SOC UARTs found in some MPC83xx/85xx/86xx
>> chips seems to cause a short lived IRQ storm (/proc/interrupts
>> typically shows somewhere between 300 and 1500 events).  Unfortunately
>> this renders SysRQ over the serial console completely inoperable.
>> Testing with obvious things like ACKing the event doesn't seem to
>> change anything vs. a completely dumb approach of just ignoring
>> it and waiting for it to stop, so that is what is implemented here.
>>
>> Signed-off-by: Paul Gortmaker 
>> ---
>>
>> This is a refresh of a patch I'd done earlier -- I've tried to make
>> the bug support as generic as possible to minimize having board
>> specific ifdef crap in 8250.c -- any suggestions on how to further
>> improve it are welcome.
>>
>> drivers/serial/8250.c  |6 ++
>> drivers/serial/8250.h  |   20 
>> drivers/serial/Kconfig |   14 ++
>> include/linux/serial_reg.h |2 ++
>> 4 files changed, 42 insertions(+), 0 deletions(-)
> 
> Did we ever decide what to do with this or trying to get it accepted upstream?

That is an old version.  ScottW gave me the errata information
which allowed me to fix the problem in a cleaner way.

http://patchwork.ozlabs.org/patch/46609/

I think the above version is OK as-is; the only thing I
think we could do to improve it is to go and automatically
select the thing based on known impacted CPU types (which
could be a separate commit or commits, as various CPUs are
confirmed to have the issue.)

Paul.

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


[PATCH 2/3] serial: allow passing in hardware bug info via platform device

2011-12-01 Thread Paul Gortmaker
The normal arch hook into the 8250 serial world is via passing
in a plat_serial8250_port struct.  However, this struct does
not have a bugs field, so there is no way to have the arch
code pass in info about known uart issues.

Add a bug field to the plat_serial8250_port struct, so that the
arch can pass in this information.  Also don't do a blanket
overwrite of the bugs setting in the 8250.c driver.  Finally,
relocate the known bug #define list to a globally visible header
so that the arch can assign any appropriate values from the list.

Signed-off-by: Paul Gortmaker 
---
 drivers/tty/serial/8250.c   |3 ++-
 drivers/tty/serial/8250.h   |5 -
 include/linux/serial_8250.h |6 ++
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index 7c94dbc..f99f27c 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -1101,7 +1101,6 @@ static void autoconfig(struct uart_8250_port *up, 
unsigned int probeflags)
spin_lock_irqsave(&up->port.lock, flags);
 
up->capabilities = 0;
-   up->port.bugs = 0;
 
if (!(up->port.flags & UPF_BUGGY_UART)) {
/*
@@ -3075,6 +3074,7 @@ static int __devinit serial8250_probe(struct 
platform_device *dev)
port.serial_out = p->serial_out;
port.handle_irq = p->handle_irq;
port.set_termios= p->set_termios;
+   port.bugs   = p->bugs;
port.pm = p->pm;
port.dev= &dev->dev;
port.irqflags   |= irqflag;
@@ -3225,6 +3225,7 @@ int serial8250_register_port(struct uart_port *port)
uart->port.regshift = port->regshift;
uart->port.iotype   = port->iotype;
uart->port.flags= port->flags | UPF_BOOT_AUTOCONF;
+   uart->port.bugs = port->bugs;
uart->port.mapbase  = port->mapbase;
uart->port.private_data = port->private_data;
if (port->dev)
diff --git a/drivers/tty/serial/8250.h b/drivers/tty/serial/8250.h
index 6edf4a6..caefe00 100644
--- a/drivers/tty/serial/8250.h
+++ b/drivers/tty/serial/8250.h
@@ -44,11 +44,6 @@ struct serial8250_config {
 #define UART_CAP_UUE   (1 << 12)   /* UART needs IER bit 6 set (Xscale) */
 #define UART_CAP_RTOIE (1 << 13)   /* UART needs IER bit 4 set (Xscale, 
Tegra) */
 
-#define UART_BUG_QUOT  (1 << 0)/* UART has buggy quot LSB */
-#define UART_BUG_TXEN  (1 << 1)/* UART has buggy TX IIR status */
-#define UART_BUG_NOMSR (1 << 2)/* UART has buggy MSR status bits 
(Au1x00) */
-#define UART_BUG_THRE  (1 << 3)/* UART has buggy THRE reassertion */
-
 #define PROBE_RSA  (1 << 0)
 #define PROBE_ANY  (~0)
 
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 1f05bbe..8c660af 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -14,6 +14,11 @@
 #include 
 #include 
 
+#define UART_BUG_QUOT  (1 << 0)/* buggy quot LSB */
+#define UART_BUG_TXEN  (1 << 1)/* buggy TX IIR status */
+#define UART_BUG_NOMSR (1 << 2)/* buggy MSR status bits (Au1x00) */
+#define UART_BUG_THRE  (1 << 3)/* buggy THRE reassertion */
+
 /*
  * This is the platform device platform_data structure
  */
@@ -30,6 +35,7 @@ struct plat_serial8250_port {
unsigned char   hub6;
upf_t   flags;  /* UPF_* flags */
unsigned inttype;   /* If UPF_FIXED_TYPE */
+   unsigned short  bugs;   /* hardware specific bugs */
unsigned int(*serial_in)(struct uart_port *, int);
void(*serial_out)(struct uart_port *, int, int);
void(*set_termios)(struct uart_port *,
-- 
1.7.7

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


[PATCH 0/3] RFC Fix Fsl 8250 BRK bug via letting plat code set bugs

2011-12-01 Thread Paul Gortmaker
This is a respin of an earlier patch[1] that enabled a workaround
via Kconfig for an errata issue when using BRK on FSL 16550 UARTs.

In this version, the 8250 specific bug field is moved to the generic
uart_port struct, since hardware bugs aren't the unique domain of 
just the 8250 class of uarts.

Then the ability to set a known bugs value via the platform_device entry
point is added, so that it can be set externally vs. requiring some sort
of autodetection from the actual driver(s).

Then, the FSL errata fix is added to 8250.c by using the above support.
An entry in a DTS file is used to flag boards/platforms with the issue.
It is also added in a way that is optimized away for other architectures.

Kumar has a patch pending[2] that updates all the dts files.  I've not
included it here, so that review focus can be on the implementation.

I've re-tested it on an sbc8641D, where sysrq was useless before; with
this fix, it works as expected.

Thanks,
Paul.

[1] http://patchwork.ozlabs.org/patch/46609/
[2] http://patchwork.ozlabs.org/patch/128070/



Paul Gortmaker (3):
  serial: make bugs field not specific to 8250 type uarts.
  serial: allow passing in hardware bug info via platform device
  8250: add workaround for MPC8[356]xx UART break IRQ storm

 arch/powerpc/kernel/legacy_serial.c |   11 ++
 drivers/tty/serial/8250.c   |   37 +-
 drivers/tty/serial/8250.h   |5 
 include/linux/serial_8250.h |   11 ++
 include/linux/serial_core.h |1 +
 5 files changed, 46 insertions(+), 19 deletions(-)

-- 
1.7.7

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


[PATCH 1/3] serial: make bugs field not specific to 8250 type uarts.

2011-12-01 Thread Paul Gortmaker
There is a struct uart_8250_port that is private to 8250.c
itself, and it had a bugs field.  But there is no reason to
assume that hardware bugs are unique to 8250 type UARTS.

Make the bugs field part of the globally visible struct
uart_port and remove the 8250 specific one.

The value in doing so is that it helps pave the way for
allowing arch or platform specific code to pass in information
to the specific uart drivers about uart bugs known to impact
certain platforms that would otherwise be hard to detect from
within the context of the driver itself.

Signed-off-by: Paul Gortmaker 
---
 drivers/tty/serial/8250.c   |   25 -
 include/linux/serial_core.h |1 +
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index eeadf1b..7c94dbc 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -134,7 +134,6 @@ struct uart_8250_port {
struct timer_list   timer;  /* "no irq" timer */
struct list_headlist;   /* ports on this IRQ */
unsigned short  capabilities;   /* port capabilities */
-   unsigned short  bugs;   /* port bugs */
unsigned inttx_loadsz;  /* transmit fifo load size */
unsigned char   acr;
unsigned char   ier;
@@ -828,7 +827,7 @@ static void autoconfig_has_efr(struct uart_8250_port *up)
 * when DLL is 0.
 */
if (id3 == 0x52 && rev == 0x01)
-   up->bugs |= UART_BUG_QUOT;
+   up->port.bugs |= UART_BUG_QUOT;
return;
}
 
@@ -1102,7 +1101,7 @@ static void autoconfig(struct uart_8250_port *up, 
unsigned int probeflags)
spin_lock_irqsave(&up->port.lock, flags);
 
up->capabilities = 0;
-   up->bugs = 0;
+   up->port.bugs = 0;
 
if (!(up->port.flags & UPF_BUGGY_UART)) {
/*
@@ -1337,7 +1336,7 @@ static void serial8250_start_tx(struct uart_port *port)
up->ier |= UART_IER_THRI;
serial_out(up, UART_IER, up->ier);
 
-   if (up->bugs & UART_BUG_TXEN) {
+   if (port->bugs & UART_BUG_TXEN) {
unsigned char lsr;
lsr = serial_in(up, UART_LSR);
up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
@@ -1373,7 +1372,7 @@ static void serial8250_enable_ms(struct uart_port *port)
container_of(port, struct uart_8250_port, port);
 
/* no MSR capabilities */
-   if (up->bugs & UART_BUG_NOMSR)
+   if (port->bugs & UART_BUG_NOMSR)
return;
 
up->ier |= UART_IER_MSI;
@@ -2089,7 +2088,7 @@ static int serial8250_startup(struct uart_port *port)
 * kick the UART on a regular basis.
 */
if (!(iir1 & UART_IIR_NO_INT) && (iir & UART_IIR_NO_INT)) {
-   up->bugs |= UART_BUG_THRE;
+   port->bugs |= UART_BUG_THRE;
pr_debug("ttyS%d - using backup timer\n",
 serial_index(port));
}
@@ -2099,7 +2098,7 @@ static int serial8250_startup(struct uart_port *port)
 * The above check will only give an accurate result the first time
 * the port is opened so this value needs to be preserved.
 */
-   if (up->bugs & UART_BUG_THRE) {
+   if (port->bugs & UART_BUG_THRE) {
up->timer.function = serial8250_backup_timeout;
up->timer.data = (unsigned long)up;
mod_timer(&up->timer, jiffies +
@@ -2162,13 +2161,13 @@ static int serial8250_startup(struct uart_port *port)
serial_outp(up, UART_IER, 0);
 
if (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT) {
-   if (!(up->bugs & UART_BUG_TXEN)) {
-   up->bugs |= UART_BUG_TXEN;
+   if (!(port->bugs & UART_BUG_TXEN)) {
+   port->bugs |= UART_BUG_TXEN;
pr_debug("ttyS%d - enabling bad tx status 
workarounds\n",
 serial_index(port));
}
} else {
-   up->bugs &= ~UART_BUG_TXEN;
+   port->bugs &= ~UART_BUG_TXEN;
}
 
 dont_test_tx_en:
@@ -2323,7 +2322,7 @@ serial8250_do_set_termios(struct uart_port *port, struct 
ktermios *termios,
/*
 * Oxford Semi 952 rev B workaround
 */
-   if (up->bugs & UART_BUG_QUOT && (quot & 0xff) == 0)
+   if (port->bugs & UART_BUG_QUOT && (quot & 0xff) == 0)
quot++;
 
if (up->capabilities & UART_CAP_

[PATCH 3/3] 8250: add workaround for MPC8[356]xx UART break IRQ storm

2011-12-01 Thread Paul Gortmaker
Sending a break on the SOC UARTs found in some MPC83xx/85xx/86xx
chips seems to cause a short lived IRQ storm (/proc/interrupts
typically shows somewhere between 300 and 1500 events).  Unfortunately
this renders SysRQ over the serial console completely inoperable.

The suggested workaround in the errata is to read the Rx register,
wait one character period, and then read the Rx register again.
We achieve this by tracking the old LSR value, and on the subsequent
interrupt event after a break, we don't read LSR, instead we just
read the RBR again and return immediately.

The "fsl,ns16550" is used in the compatible field of the serial
device to mark UARTs known to have this issue.

Thanks to Scott Wood for providing the errata data which led to
a much cleaner fix.

Signed-off-by: Paul Gortmaker 
---
 arch/powerpc/kernel/legacy_serial.c |   11 +++
 drivers/tty/serial/8250.c   |   11 ++-
 include/linux/serial_8250.h |5 +
 3 files changed, 26 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kernel/legacy_serial.c 
b/arch/powerpc/kernel/legacy_serial.c
index c7b5afe..dd232ca 100644
--- a/arch/powerpc/kernel/legacy_serial.c
+++ b/arch/powerpc/kernel/legacy_serial.c
@@ -476,6 +476,15 @@ static void __init fixup_port_mmio(int index,
port->membase = ioremap(port->mapbase, 0x100);
 }
 
+static void __init fixup_port_bugs(int index,
+  struct device_node *np,
+  struct plat_serial8250_port *port)
+{
+   DBG("fixup_port_bugs(%d)\n", index);
+
+   if (of_device_is_compatible(np, "fsl,ns16550"))
+   port->bugs = UART_BUG_FSLBK;
+}
 /*
  * This is called as an arch initcall, hopefully before the PCI bus is
  * probed and/or the 8250 driver loaded since we need to register our
@@ -512,6 +521,8 @@ static int __init serial_dev_init(void)
fixup_port_pio(i, np, port);
if ((port->iotype == UPIO_MEM) || (port->iotype == UPIO_TSI))
fixup_port_mmio(i, np, port);
+
+   fixup_port_bugs(i, np, port);
}
 
DBG("Registering platform serial ports\n");
diff --git a/drivers/tty/serial/8250.c b/drivers/tty/serial/8250.c
index f99f27c..32e9821 100644
--- a/drivers/tty/serial/8250.c
+++ b/drivers/tty/serial/8250.c
@@ -142,6 +142,7 @@ struct uart_8250_port {
unsigned char   mcr_mask;   /* mask of user bits */
unsigned char   mcr_force;  /* mask of forced bits */
unsigned char   cur_iotype; /* Running I/O type */
+   unsigned char   lsr_last;   /* LSR of last IRQ event */
 
/*
 * Some bits in registers are cleared on a read, so they must
@@ -1553,7 +1554,15 @@ static void serial8250_handle_port(struct uart_8250_port 
*up)
 
spin_lock_irqsave(&up->port.lock, flags);
 
-   status = serial_inp(up, UART_LSR);
+   /* Workaround for IRQ storm errata on break with Freescale 16550 */
+   if (UART_BUG_FSLBK & up->port.bugs && up->lsr_last & UART_LSR_BI) {
+   up->lsr_last &= ~UART_LSR_BI;
+   serial_inp(up, UART_RX);
+   spin_unlock_irqrestore(&up->port.lock, flags);
+   return;
+   }
+
+   status = up->lsr_last = serial_inp(up, UART_LSR);
 
DEBUG_INTR("status = %x...", status);
 
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 8c660af..b0f4042 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -18,6 +18,11 @@
 #define UART_BUG_TXEN  (1 << 1)/* buggy TX IIR status */
 #define UART_BUG_NOMSR (1 << 2)/* buggy MSR status bits (Au1x00) */
 #define UART_BUG_THRE  (1 << 3)/* buggy THRE reassertion */
+#ifdef CONFIG_PPC32
+#define UART_BUG_FSLBK (1 << 4)/* buggy FSL break IRQ storm */
+#else  /* help GCC optimize away IRQ handler errata code for ARCH != PPC32 */
+#define UART_BUG_FSLBK 0
+#endif
 
 /*
  * This is the platform device platform_data structure
-- 
1.7.7

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


Re: [PATCH 3/3] 8250: add workaround for MPC8[356]xx UART break IRQ storm

2011-12-01 Thread Paul Gortmaker
On 11-12-01 06:51 PM, Scott Wood wrote:
> On 12/01/2011 05:47 PM, Paul Gortmaker wrote:
>> diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
>> index 8c660af..b0f4042 100644
>> --- a/include/linux/serial_8250.h
>> +++ b/include/linux/serial_8250.h
>> @@ -18,6 +18,11 @@
>>  #define UART_BUG_TXEN   (1 << 1)/* buggy TX IIR status */
>>  #define UART_BUG_NOMSR  (1 << 2)/* buggy MSR status bits 
>> (Au1x00) */
>>  #define UART_BUG_THRE   (1 << 3)/* buggy THRE reassertion */
>> +#ifdef CONFIG_PPC32
>> +#define UART_BUG_FSLBK  (1 << 4)/* buggy FSL break IRQ storm */
>> +#else   /* help GCC optimize away IRQ handler errata code for ARCH != 
>> PPC32 */
>> +#define UART_BUG_FSLBK  0
>> +#endif
> 
> I believe this bug still exists on our 64-bit chips.

OK, I'll simply change the above to CONFIG_PPC then.

Thanks,
Paul.

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


Re: [RFC][PATCH] update FSL 16550 nodes to have...

2011-12-01 Thread Paul Gortmaker
On Mon, Nov 28, 2011 at 3:02 PM, Kumar Gala  wrote:
> Signed-off-by: Kumar Gala 
> ---
> * Need to fixup the commit message

I had this written when I was thinking of re-sending the dts
with the other three, that is before I realized the dts patch
would then overwhelm the other patches completely.  :)

P.


ppc: update FSL 16550 nodes to have fsl,ns16550 compat entry

There is an errata relating to break handling on some of
the Freescale 16550 implementations.  By marking the nodes
with a fsl prefix, we can use that to know when to enable
the errata handling.

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


Re: [PATCH 1/3] serial: make bugs field not specific to 8250 type uarts.

2011-12-01 Thread Paul Gortmaker
On Thu, Dec 1, 2011 at 7:51 PM, Alan Cox  wrote:
>> Make the bugs field part of the globally visible struct
>> uart_port and remove the 8250 specific one.
>
> Except all the bits in it are 8250 specific things or names that are
> meaningless in generic form - no. I also don't want to encourage flags
> and bug bits. We already have too many and its making the code a mess.
> So right now we want less not more.

The bits in "bugs" are only passed through -- the idea is that there is
no "interpretation" of them by any generic layer -- only that they prop
from the arch down to the driver which knows what they mean.

I can understand the "want less not more" mentality -- I was thinking
the same thing when I was looking at the replication of fields between
uart_port and uart_8250_port, and toying with the idea of helping clean
that up  (separate topic, to be sure.)

If you have an idea in mind how arch/platform code should cleanly
pass data about known uart bugs to the uart driver, then let me know
what you have in mind.  I've no real attachment to what I proposed
here -- it just happened to be the solution I thought would be the least
offensive.  If there is a better idea floating around, I'll go ahead and
try to implement it.

Thanks,
Paul.

> --
> To unsubscribe from this list: send the line "unsubscribe linux-serial" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 3/3] 8250: add workaround for MPC8[356]xx UART break IRQ storm

2011-12-01 Thread Paul Gortmaker
On Thu, Dec 1, 2011 at 7:57 PM, Alan Cox  wrote:
>
>> @@ -1553,7 +1554,15 @@ static void serial8250_handle_port(struct
>> uart_8250_port *up)
>>       spin_lock_irqsave(&up->port.lock, flags);
>>
>> -     status = serial_inp(up, UART_LSR);
>> +     /* Workaround for IRQ storm errata on break with Freescale
>> 16550 */
>> +     if (UART_BUG_FSLBK & up->port.bugs && up->lsr_last &
>> UART_LSR_BI) {
>> +             up->lsr_last &= ~UART_LSR_BI;
>> +             serial_inp(up, UART_RX);
>> +             spin_unlock_irqrestore(&up->port.lock, flags);
>> +             return;
>> +     }
>> +
>> +     status = up->lsr_last = serial_inp(up, UART_LSR);
>
> We've now had a recent pile of IRQ function changes adding more quirk
> bits and special casing. This doesn't scale. We either need to make
> handle_port a method the specific drivers can override or you could
> hide the mess in your serial_inp implementation and not touch any core
> code.

To be fair, this one is zero cost for !PPC, but I understand your point,
and the idea of hiding it somehow in serial_inp was something that
never crossed my mind.  I'll look into seeing if I can abuse that.

>
> I really don't mind which but I suspect dealing with it in your
> serial_inp handler so that when you read UART_LSR you do the fixup
> might be simplest providing you can just do that.
>
> Sorting out a ->handle_port override is probably ultimately the right
> thing to do and then we can push some of the other funnies out further.
>
> At this point it's becoming increasingly clear that 8250 UART cloners
> are both very bad at cloning the things accurately, and very busy adding
> extra useful features so we need to start to treat 8250.c as a library
> you can wrap.

Sad but true.  It is like a time warp back to lib8390.c  --- whee.

P.

>
> Alan
> --
> To unsubscribe from this list: send the line "unsubscribe linux-serial" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 3/3] 8250: add workaround for MPC8[356]xx UART break IRQ storm

2011-12-02 Thread Paul Gortmaker
On 11-12-02 06:30 AM, Alan Cox wrote:
>>> OK, I'll simply change the above to CONFIG_PPC then.
>>
>> It does, the bug is in the uart IP which I don't think we ever plan on 
>> fixing, so 32 or 64-bit parts will have it for ever and ever ;)
> 
> It should be runtime selected, there should be no ifdefs here.

The ifdef wasn't strictly required; it just made it so gcc would
toss the errata code out of the irq handler for !PPC.  Anyway it
will be a moot point if I can somehow hide all the mess by snooping
serial_inp() traffic and deploying the errata fix from there

P.

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


  1   2   3   4   >