[PATCH 2/2][v3] rapidio, powerpc/85xx: Error interrupt handler for sRIO.

2010-11-17 Thread Shaohui Xie
The sRIO controller reports errors to the core with one signal, it uses
register EPWISR to provides the core quick access to where the error occurred.
The EPWISR indicates that there are 4 interrupts sources, port1, port2, message
unit and port write receive, but the sRIO driver does not support port2
for now, still the handler takes care of port2.
Currently the handler only clear error status without any recovery.

Signed-off-by: Shaohui Xie 
Cc: Li Yang 
Cc: Kumar Gala 
Cc: Roy Zang 
Cc: Alexandre Bounine 
---
updated to 37-rc2
 arch/powerpc/sysdev/fsl_rio.c |   85 +
 1 files changed, 77 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index ddbcd16..d036df9 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -10,7 +10,7 @@
  * - Added Port-Write message handling
  * - Added Machine Check exception handling
  *
- * Copyright (C) 2007, 2008 Freescale Semiconductor, Inc.
+ * Copyright (C) 2007, 2008, 2010 Freescale Semiconductor, Inc.
  * Zhang Wei 
  *
  * Copyright 2005 MontaVista Software, Inc.
@@ -47,15 +47,33 @@
 #define IRQ_RIO_RX(m)  (((struct rio_priv *)(m->priv))->rxirq)
 #define IRQ_RIO_PW(m)  (((struct rio_priv *)(m->priv))->pwirq)
 
+#define IPWSR_CLEAR0x98
+#define OMSR_CLEAR 0x1cb3
+#define IMSR_CLEAR 0x491
+#define IDSR_CLEAR 0x91
+#define ODSR_CLEAR 0x1c00
+#define LTLEECSR_ENABLE_ALL0xFFC000FC
+#define ESCSR_CLEAR0x07120204
+
+#define RIO_PORT1_EDCSR0x0640
+#define RIO_PORT2_EDCSR0x0680
+#define RIO_PORT1_IECSR0x10130
+#define RIO_PORT2_IECSR0x101B0
+#define RIO_IM0SR  0x13064
+#define RIO_IM1SR  0x13164
+#define RIO_OM0SR  0x13004
+#define RIO_OM1SR  0x13104
+
 #define RIO_ATMU_REGS_OFFSET   0x10c00
 #define RIO_P_MSG_REGS_OFFSET  0x11000
 #define RIO_S_MSG_REGS_OFFSET  0x13000
 #define RIO_GCCSR  0x13c
 #define RIO_ESCSR  0x158
+#define RIO_PORT2_ESCSR0x178
 #define RIO_CCSR   0x15c
 #define RIO_LTLEDCSR   0x0608
-#define  RIO_LTLEDCSR_IER  0x8000
-#define  RIO_LTLEDCSR_PRT  0x0100
+#define RIO_LTLEDCSR_IER   0x8000
+#define RIO_LTLEDCSR_PRT   0x0100
 #define RIO_LTLEECSR   0x060c
 #define RIO_EPWISR 0x10010
 #define RIO_ISR_AACR   0x10120
@@ -88,7 +106,10 @@
 #define RIO_IPWSR_PWD  0x0008
 #define RIO_IPWSR_PWB  0x0004
 
-#define RIO_EPWISR_PINT0x8000
+/* EPWISR Error match value */
+#define RIO_EPWISR_PINT1   0x8000
+#define RIO_EPWISR_PINT2   0x4000
+#define RIO_EPWISR_MU  0x0002
 #define RIO_EPWISR_PW  0x0001
 
 #define RIO_MSG_DESC_SIZE  32
@@ -1066,6 +1087,40 @@ static int fsl_rio_doorbell_init(struct rio_mport *mport)
return rc;
 }
 
+static void port_error_handler(struct rio_mport *port, int offset)
+{
+   /*XXX: Error recovery is not implemented, we just clear errors */
+   out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR), 0);
+
+   if (offset == 0) {
+   out_be32((u32 *)(rio_regs_win + RIO_PORT1_EDCSR), 0);
+   out_be32((u32 *)(rio_regs_win + RIO_PORT1_IECSR), 0);
+   out_be32((u32 *)(rio_regs_win + RIO_ESCSR), ESCSR_CLEAR);
+   } else {
+   out_be32((u32 *)(rio_regs_win + RIO_PORT2_EDCSR), 0);
+   out_be32((u32 *)(rio_regs_win + RIO_PORT2_IECSR), 0);
+   out_be32((u32 *)(rio_regs_win + RIO_PORT2_ESCSR), ESCSR_CLEAR);
+   }
+}
+
+static void msg_unit_error_handler(struct rio_mport *port)
+{
+   struct rio_priv *priv = port->priv;
+
+   /*XXX: Error recovery is not implemented, we just clear errors */
+   out_be32((u32 *)(rio_regs_win + RIO_LTLEDCSR), 0);
+
+   out_be32((u32 *)(rio_regs_win + RIO_IM0SR), IMSR_CLEAR);
+   out_be32((u32 *)(rio_regs_win + RIO_IM1SR), IMSR_CLEAR);
+   out_be32((u32 *)(rio_regs_win + RIO_OM0SR), OMSR_CLEAR);
+   out_be32((u32 *)(rio_regs_win + RIO_OM1SR), OMSR_CLEAR);
+
+   out_be32(&priv->msg_regs->odsr, ODSR_CLEAR);
+   out_be32(&priv->msg_regs->dsr, IDSR_CLEAR);
+
+   out_be32(&priv->msg_regs->pwsr, IPWSR_CLEAR);
+}
+
 /**
  * fsl_rio_port_write_handler - MPC85xx port write interrupt handler
  * @irq: Linux interrupt number
@@ -1146,10 +1201,22 @@ fsl_rio_port_write_handler(int irq, void *dev_instance)
}
 
 pw_done:
-   if (epwisr & RIO_EPWISR_PINT) {
+   if (epwisr & RIO_EPWISR_PINT1) {
+   tmp = in_be32(priv->regs_win + RIO_LTLEDCSR);
+   pr_debug("RIO_LTLEDCSR = 0x%x\n", tmp);
+   port_error_handler(port, 0);
+   }
+
+   if (epwisr & RIO_EPWISR_PINT2) {
+   tmp = in_be32(priv->regs_win + RIO_LTLEDCSR);
+   

[PATCH 1/2][v4] fsl_rio: move machine_check handler into machine_check_e500 & machine_check_e500mc

2010-11-17 Thread Shaohui Xie
Signed-off-by: Shaohui Xie 
Cc: Li Yang 
Cc: Kumar Gala 
Cc: Roy Zang 
Cc: Alexandre Bounine 
---
 arch/powerpc/include/asm/rio.h |5 +
 arch/powerpc/kernel/traps.c|   13 +
 arch/powerpc/sysdev/fsl_rio.c  |   15 +++
 3 files changed, 21 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/include/asm/rio.h b/arch/powerpc/include/asm/rio.h
index 0018bf8..d902abd 100644
--- a/arch/powerpc/include/asm/rio.h
+++ b/arch/powerpc/include/asm/rio.h
@@ -14,5 +14,10 @@
 #define ASM_PPC_RIO_H
 
 extern void platform_rio_init(void);
+#ifdef CONFIG_RAPIDIO
+extern int fsl_rio_mcheck_exception(struct pt_regs *);
+#else
+static inline int fsl_rio_mcheck_exception(struct pt_regs *regs) {return 0; }
+#endif
 
 #endif /* ASM_PPC_RIO_H */
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 1b2cdc8..5f6c106 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -55,6 +55,7 @@
 #endif
 #include 
 #include 
+#include 
 
 #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
 int (*__debugger)(struct pt_regs *regs) __read_mostly;
@@ -425,6 +426,12 @@ int machine_check_e500mc(struct pt_regs *regs)
unsigned long reason = mcsr;
int recoverable = 1;
 
+   if (reason & MCSR_BUS_RBERR) {
+   recoverable = fsl_rio_mcheck_exception(regs);
+   if (recoverable == 1)
+   goto silent_out;
+   }
+
printk("Machine check in kernel mode.\n");
printk("Caused by (from MCSR=%lx): ", reason);
 
@@ -500,6 +507,7 @@ int machine_check_e500mc(struct pt_regs *regs)
   reason & MCSR_MEA ? "Effective" : "Physical", addr);
}
 
+silent_out:
mtspr(SPRN_MCSR, mcsr);
return mfspr(SPRN_MCSR) == 0 && recoverable;
 }
@@ -508,6 +516,11 @@ int machine_check_e500(struct pt_regs *regs)
 {
unsigned long reason = get_mc_reason(regs);
 
+   if (reason & MCSR_BUS_RBERR) {
+   if (fsl_rio_mcheck_exception(regs))
+   return 1;
+   }
+
printk("Machine check in kernel mode.\n");
printk("Caused by (from MCSR=%lx): ", reason);
 
diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index 4c518d1..ddbcd16 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -260,9 +260,7 @@ struct rio_priv {
 static void __iomem *rio_regs_win;
 
 #ifdef CONFIG_E500
-static int (*saved_mcheck_exception)(struct pt_regs *regs);
-
-static int fsl_rio_mcheck_exception(struct pt_regs *regs)
+int fsl_rio_mcheck_exception(struct pt_regs *regs)
 {
const struct exception_table_entry *entry = NULL;
unsigned long reason = mfspr(SPRN_MCSR);
@@ -284,11 +282,9 @@ static int fsl_rio_mcheck_exception(struct pt_regs *regs)
}
}
 
-   if (saved_mcheck_exception)
-   return saved_mcheck_exception(regs);
-   else
-   return cur_cpu_spec->machine_check(regs);
+   return 0;
 }
+EXPORT_SYMBOL_GPL(fsl_rio_mcheck_exception);
 #endif
 
 /**
@@ -1552,11 +1548,6 @@ int fsl_rio_setup(struct platform_device *dev)
fsl_rio_doorbell_init(port);
fsl_rio_port_write_init(port);
 
-#ifdef CONFIG_E500
-   saved_mcheck_exception = ppc_md.machine_check_exception;
-   ppc_md.machine_check_exception = fsl_rio_mcheck_exception;
-#endif
-
return 0;
 err:
iounmap(priv->regs_win);
-- 
1.6.4


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


[git pull] Please pull powerpc.git merge branch

2010-11-17 Thread Benjamin Herrenschmidt
Hi Linus !

Here are a handful of bug fixes and trivialities for powerpc for you
to pull.

Thanks !

Cheers,
Ben.

The following changes since commit 7957f0a857754c555e07f58a3fb83ac29501478c:
  Linus Torvalds (1):
Fix build failure due to hwirq.h needing smp_lock.h

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git merge

Alessio Igor Bogani (1):
  powerpc: Update a BKL related comment

Benjamin Herrenschmidt (1):
  powerpc: Fix div64 in bootloader

Kumar Gala (2):
  powerpc/mm: Fix build error in setup_initial_memory_limit
  powerpc/mm: Fix module instruction tlb fault handling on Book-E 64

Michael Neuling (1):
  powerpc: Fix call to subpage_protection()

Nishanth Aravamudan (1):
  powerpc/pseries: Don't override CONFIG_PPC_PSERIES_DEBUG

kerstin jonsson (1):
  powerpc: Set CONFIG_32BIT on ppc32

 arch/powerpc/Kconfig   |4 
 arch/powerpc/boot/div64.S  |3 ++-
 arch/powerpc/kernel/setup_64.c |5 ++---
 arch/powerpc/mm/hash_utils_64.c|2 +-
 arch/powerpc/mm/tlb_low_64e.S  |5 -
 arch/powerpc/mm/tlb_nohash.c   |2 +-
 arch/powerpc/platforms/pseries/Kconfig |6 ++
 arch/powerpc/platforms/pseries/eeh.c   |2 --
 arch/powerpc/platforms/pseries/pci_dlpar.c |2 --
 9 files changed, 20 insertions(+), 11 deletions(-)


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


[PATCH 4/4] powerpc: hash_preload: avoid avoidable void

2010-11-17 Thread mikey
Change pgdir from a void to real type.  Having this as a void is
stupid and has already caused 1 bug.

Signed-off-by: Michael Neuling 
---
 arch/powerpc/mm/hash_utils_64.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6-ozlabs/arch/powerpc/mm/hash_utils_64.c
===
--- linux-2.6-ozlabs.orig/arch/powerpc/mm/hash_utils_64.c
+++ linux-2.6-ozlabs/arch/powerpc/mm/hash_utils_64.c
@@ -1070,7 +1070,7 @@
  unsigned long access, unsigned long trap)
 {
unsigned long vsid;
-   void *pgdir;
+   pgd_t *pgdir;
pte_t *ptep;
unsigned long flags;
int rc, ssize, local = 0;


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


[PATCH 3/4] powerpc: add POWER7+ cputable entry

2010-11-17 Thread mikey
This adds the POWER7+ cputable entry for the PVR 0x004a.  Rest is
the same as vanilla POWER7.

Signed-off-by: Michael Neuling 
---
 arch/powerpc/kernel/cputable.c |   16 
 1 file changed, 16 insertions(+)

Index: linux-2.6-ozlabs/arch/powerpc/kernel/cputable.c
===
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/cputable.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/cputable.c
@@ -461,6 +461,22 @@
.oprofile_type  = PPC_OPROFILE_POWER4,
.platform   = "power7",
},
+   {   /* Power7+ */
+   .pvr_mask   = 0x,
+   .pvr_value  = 0x004A,
+   .cpu_name   = "POWER7+ (raw)",
+   .cpu_features   = CPU_FTRS_POWER7,
+   .cpu_user_features  = COMMON_USER_POWER7,
+   .mmu_features   = MMU_FTR_HPTE_TABLE |
+   MMU_FTR_TLBIE_206,
+   .icache_bsize   = 128,
+   .dcache_bsize   = 128,
+   .num_pmcs   = 6,
+   .pmc_type   = PPC_PMC_IBM,
+   .oprofile_cpu_type  = "ppc64/power7",
+   .oprofile_type  = PPC_OPROFILE_POWER4,
+   .platform   = "power7+",
+   },
{   /* Cell Broadband Engine */
.pvr_mask   = 0x,
.pvr_value  = 0x0070,


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


[PATCH 2/4] powerpc: remove POWER6 oprofile workarounds for POWER7

2010-11-17 Thread mikey
These are not needed on POWER7 so remove them.

Signed-off-by: Michael Neuling 
---
 arch/powerpc/kernel/cputable.c |4 
 1 file changed, 4 deletions(-)

Index: linux-2.6-ozlabs/arch/powerpc/kernel/cputable.c
===
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/cputable.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/cputable.c
@@ -459,10 +459,6 @@
.pmc_type   = PPC_PMC_IBM,
.oprofile_cpu_type  = "ppc64/power7",
.oprofile_type  = PPC_OPROFILE_POWER4,
-   .oprofile_mmcra_sihv= POWER6_MMCRA_SIHV,
-   .oprofile_mmcra_sipr= POWER6_MMCRA_SIPR,
-   .oprofile_mmcra_clear   = POWER6_MMCRA_THRM |
-   POWER6_MMCRA_OTHER,
.platform   = "power7",
},
{   /* Cell Broadband Engine */


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


[PATCH 1/4] powerpc: remove unneeded cpu_setup/restore from POWER7 cputable entry

2010-11-17 Thread mikey
These are not needed so just remove them

Signed-off-by: Michael Neuling 

---
 arch/powerpc/kernel/cputable.c |2 --
 arch/powerpc/kernel/misc.S |5 -
 2 files changed, 7 deletions(-)

Index: linux-2.6-ozlabs/arch/powerpc/kernel/cputable.c
===
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/cputable.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/cputable.c
@@ -457,8 +457,6 @@
.dcache_bsize   = 128,
.num_pmcs   = 6,
.pmc_type   = PPC_PMC_IBM,
-   .cpu_setup  = __setup_cpu_power7,
-   .cpu_restore= __restore_cpu_power7,
.oprofile_cpu_type  = "ppc64/power7",
.oprofile_type  = PPC_OPROFILE_POWER4,
.oprofile_mmcra_sihv= POWER6_MMCRA_SIHV,
Index: linux-2.6-ozlabs/arch/powerpc/kernel/misc.S
===
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/misc.S
+++ linux-2.6-ozlabs/arch/powerpc/kernel/misc.S
@@ -122,8 +122,3 @@
mtlrr0
mr  r3,r4
blr
-
-_GLOBAL(__setup_cpu_power7)
-_GLOBAL(__restore_cpu_power7)
-   /* place holder */
-   blr


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


[PATCH 0/4] Patches from my local tree

2010-11-17 Thread mikey
Below are a few patches from my local tree

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


Re: linux-next: build warning in Linus' tree

2010-11-17 Thread Arnaud Lacombe
Hi,

On Wed, Nov 17, 2010 at 10:55 PM, Benjamin Herrenschmidt
 wrote:
> On Mon, 2010-10-25 at 17:03 +1100, Stephen Rothwell wrote:
>> Hi Arnaud,
>>
>> On Sun, 24 Oct 2010 23:47:09 -0400 Arnaud Lacombe  wrote:
>> >
>> > The following patch should fix this warning.
>>
>> I think the following is preferable.  Not tested yet, I will test
>> tomorrow and submit properly then.
>
> I agree. Tho I don't understand the original problem. Both definitions
> have no parenthesis for me and I don't see warnings, or am I missing
> some changes still in -next that cause this ?
>
The warning was caused by part of the following commit which came
through the x86 tree, afaik during the merge window:

   commit 3234282f33b29d349bcada40204fc7c8fda7fe72
   Author: Jan Beulich 
   Date:   Tue Oct 19 14:52:26 2010 +0100
   x86, asm: Fix CFI macro invocations to deal with shortcomings in gas

It looks to have been fixed by:

commit 95a2f6f72d37762ba1b3d6c8031f66a6467a63df
Author: David Howells 
Date:   Wed Oct 27 17:28:32 2010 +0100

Partially revert patch that encloses asm-offset.h numbers in brackets

Partially revert patch:

commit 3234282f33b29d349bcada40204fc7c8fda7fe72
Author: Jan Beulich 
Date:   Tue Oct 19 14:52:26 2010 +0100
x86, asm: Fix CFI macro invocations to deal with shortcomings in gas
[...]

which came in through the mn10300 tree. So if you're no longer seeing
the warning, no ppc specific patch seems to be needed.

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


Re: linux-next: build warning in Linus' tree

2010-11-17 Thread Benjamin Herrenschmidt
On Mon, 2010-10-25 at 17:03 +1100, Stephen Rothwell wrote:
> Hi Arnaud,
> 
> On Sun, 24 Oct 2010 23:47:09 -0400 Arnaud Lacombe  wrote:
> >
> > The following patch should fix this warning.
> 
> I think the following is preferable.  Not tested yet, I will test
> tomorrow and submit properly then.

I agree. Tho I don't understand the original problem. Both definitions
have no parenthesis for me and I don't see warnings, or am I missing
some changes still in -next that cause this ?

Cheers,
Ben.


> -- 
> Cheers,
> Stephen Rothwells...@canb.auug.org.au
> http://www.canb.auug.org.au/~sfr/
> 
> From: Stephen Rothwell 
> Date: Mon, 25 Oct 2010 16:57:47 +1100
> Subject: [PATCH] powerpc: remove second definition of STACK_FRAME_OVERHEAD
> 
> Since STACK_FRAME_OVERHEAD is defined in asm/ptrace.h and that
> is ASSEMBER safe, we can just include that instead of going via
> asm-offsets.h.
> 
> Eliminated build warnings about a duplicate definition now that
> the asm-offsets.h version has parentheses around the values.
> 
> Signed-off-by: Stephen Rothwell 
> ---
>  arch/powerpc/kernel/asm-offsets.c   |1 -
>  arch/powerpc/kernel/entry_32.S  |1 +
>  arch/powerpc/kernel/exceptions-64s.S|1 +
>  arch/powerpc/kernel/fpu.S   |1 +
>  arch/powerpc/kernel/head_40x.S  |1 +
>  arch/powerpc/kernel/head_44x.S  |1 +
>  arch/powerpc/kernel/head_64.S   |1 +
>  arch/powerpc/kernel/head_8xx.S  |1 +
>  arch/powerpc/kernel/head_fsl_booke.S|1 +
>  arch/powerpc/kernel/misc_32.S   |1 +
>  arch/powerpc/kernel/misc_64.S   |1 +
>  arch/powerpc/kernel/ppc_save_regs.S |1 +
>  arch/powerpc/kernel/vector.S|1 +
>  arch/powerpc/platforms/pseries/hvCall.S |1 +
>  14 files changed, 13 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/asm-offsets.c 
> b/arch/powerpc/kernel/asm-offsets.c
> index bd0df2e..23e6a93 100644
> --- a/arch/powerpc/kernel/asm-offsets.c
> +++ b/arch/powerpc/kernel/asm-offsets.c
> @@ -209,7 +209,6 @@ int main(void)
>   DEFINE(RTASENTRY, offsetof(struct rtas_t, entry));
>  
>   /* Interrupt register frame */
> - DEFINE(STACK_FRAME_OVERHEAD, STACK_FRAME_OVERHEAD);
>   DEFINE(INT_FRAME_SIZE, STACK_INT_FRAME_SIZE);
>   DEFINE(SWITCH_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct 
> pt_regs));
>  #ifdef CONFIG_PPC64
> diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
> index ed4aeb9..c22dc1e 100644
> --- a/arch/powerpc/kernel/entry_32.S
> +++ b/arch/powerpc/kernel/entry_32.S
> @@ -31,6 +31,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #undef SHOW_SYSCALLS
>  #undef SHOW_SYSCALLS_TASK
> diff --git a/arch/powerpc/kernel/exceptions-64s.S 
> b/arch/powerpc/kernel/exceptions-64s.S
> index 9f8b01d..8a81799 100644
> --- a/arch/powerpc/kernel/exceptions-64s.S
> +++ b/arch/powerpc/kernel/exceptions-64s.S
> @@ -13,6 +13,7 @@
>   */
>  
>  #include 
> +#include 
>  
>  /*
>   * We layout physical memory as follows:
> diff --git a/arch/powerpc/kernel/fpu.S b/arch/powerpc/kernel/fpu.S
> index e86c040..de36955 100644
> --- a/arch/powerpc/kernel/fpu.S
> +++ b/arch/powerpc/kernel/fpu.S
> @@ -23,6 +23,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #ifdef CONFIG_VSX
>  #define REST_32FPVSRS(n,c,base)  
> \
> diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
> index 8278e8b..9dd21a8 100644
> --- a/arch/powerpc/kernel/head_40x.S
> +++ b/arch/powerpc/kernel/head_40x.S
> @@ -40,6 +40,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  /* As with the other PowerPC ports, it is expected that when code
>   * execution begins here, the following registers contain valid, yet
> diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
> index 562305b..cbb3436 100644
> --- a/arch/powerpc/kernel/head_44x.S
> +++ b/arch/powerpc/kernel/head_44x.S
> @@ -37,6 +37,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  #include "head_booke.h"
>  
> diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
> index f0dd577..ce41b97 100644
> --- a/arch/powerpc/kernel/head_64.S
> +++ b/arch/powerpc/kernel/head_64.S
> @@ -38,6 +38,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  /* The physical memory is layed out such that the secondary processor
>   * spin code sits at 0x...0x00ff. On server, the vectors follow
> diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
> index 1f1a04b..1cbf64e 100644
> --- a/arch/powerpc/kernel/head_8xx.S
> +++ b/arch/powerpc/kernel/head_8xx.S
> @@ -29,6 +29,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  /* Macro to make the code more readable. */
>  #ifdef CONFIG_8xx_CPU6
> diff --git a/arch/powerpc/kernel/head_fsl_booke.S 
> b/arch/powerpc/kernel/head_fsl_booke.S
> index 529b817..3e02

Re: [PATCH 1/5] scripts: dtc: Merge in changes from the dtc repository

2010-11-17 Thread David Gibson
On Wed, Nov 17, 2010 at 09:47:55AM -0600, Jon Loeliger wrote:
> > On Tue, Nov 16, 2010 at 12:49:51PM -0800, John Bonesio wrote:
> > > Pull in recent changes from the main dtc repository. These changes 
> > > primarily
> > > allow multiple device trees to be declared which are merged by dtc. This
> > > feature allows us to include a basic dts file and then provide more 
> > > informatio
> > n
> > > for the specific system through the merging functionality.
> > > 
> > > Signed-off-by: John Bonesio 
> > 
> > Jon & David, I'll need your input on whether or not this is the best
> > way to handle updating the dtc copy in the kernel tree.
> > 
> > g.
> 
> Grant,
> 
> Yeah, I wondered too. :-)  David added it and updated
> in the kernel last round, so he may have some good notion
> of what would be best there.

For now I think just a direct diff updating the in-kernel dtc to
current upstream is the simplest approach.  This is how I made the
original commit.

There may be better methods to directly arrange for pulling of the dtc
git tree into the kernel git tree, but I have not had time to
investigate and set up such a scheme.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: arch/powerpc/*/div64.S

2010-11-17 Thread Benjamin Herrenschmidt
On Sat, 2010-10-02 at 14:16 -0400, Albert Cahalan wrote:
> This looks like duplicated code getting out of sync.

Right, tho your patch actually reverts the fix :-)

I don't know if it's worth considering using common files for some /lib
stuff there tho.. .the runtime env. is quite different...

Ben.

> $ diff -Naurd arch/powerpc/lib/div64.S arch/powerpc/boot/div64.S
> --- arch/powerpc/lib/div64.S2009-09-09 18:13:59.0 -0400
> +++ arch/powerpc/boot/div64.S   2009-09-09 18:13:59.0 -0400
> @@ -13,10 +13,10 @@
>   * as published by the Free Software Foundation; either version
>   * 2 of the License, or (at your option) any later version.
>   */
> -#include 
> -#include 
> +#include "ppc_asm.h"
> 
> -_GLOBAL(__div64_32)
> +   .globl __div64_32
> +__div64_32:
> lwz r5,0(r3)# get the dividend into r5/r6
> lwz r6,4(r3)
> cmplw   r5,r4
> @@ -33,10 +33,9 @@
> cntlzw  r0,r5   # we are shifting the dividend right
> li  r10,-1  # to make it < 2^32, and shifting
> srw r10,r10,r0  # the divisor right the same amount,
> -   addcr9,r4,r10   # rounding up (so the estimate cannot
> +   add r9,r4,r10   # rounding up (so the estimate cannot
> andcr11,r6,r10  # ever be too large, only too small)
> andcr9,r9,r10
> -   addze   r9,r9
> or  r11,r5,r11
> rotlw   r9,r9,r0
> rotlw   r11,r11,r0
> ___
> 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: fix call to subpage_protection()

2010-11-17 Thread Michael Neuling
In: 
  powerpc/mm: Fix pgtable cache cleanup with CONFIG_PPC_SUBPAGE_PROT
  commit d28513bc7f675d28b479db666d572e078ecf182d
  Author: David Gibson 

subpage_protection() was changed to to take an mm rather a pgdir but it
didn't change calling site in hashpage_preload().  The change wasn't
noticed at compile time since hashpage_preload() used a void* as the
parameter to subpage_protection().

This is obviously wrong and can trigger the following crash when
CONFIG_SLAB, CONFIG_DEBUG_SLAB, CONFIG_PPC_64K_PAGES
CONFIG_PPC_SUBPAGE_PROT are enabled.

Freeing unused kernel memory: 704k freed
Unable to handle kernel paging request for data at address 0x6b6b6b6b6b6c49b7
Faulting instruction address: 0xc00410f4
cpu 0x2: Vector: 300 (Data Access) at [c0004233f590]
pc: c00410f4: .hash_preload+0x258/0x338
lr: c0041054: .hash_preload+0x1b8/0x338
sp: c0004233f810
   msr: 80009032
   dar: 6b6b6b6b6b6c49b7
 dsisr: 4000
  current = 0xc0007e2c0070
  paca= 0xc7fe0500
pid   = 1, comm = init
enter ? for help
[c0004233f810] c0041020 .hash_preload+0x184/0x338 (unreliable)
[c0004233f8f0] c003ed98 .update_mmu_cache+0xb0/0xd0
[c0004233f990] c0157754 .__do_fault+0x48c/0x5dc
[c0004233faa0] c0158fd0 .handle_mm_fault+0x508/0xa8c
[c0004233fb90] c06acdd4 .do_page_fault+0x428/0x6ac
[c0004233fe30] c0005260 handle_page_fault+0x20/0x74
--- Exception: 401 (Instruction Access) at f7937794
SP (ffef72c0) is in userspace

The following changes this subpage_protection() call.

Reported-by: Jim Keniston 
Signed-off-by: Michael Neuling 
Tested-by: Jim Keniston 
cc: David Gibson 
cc: sta...@kernel.org (only 2.6.33 and newer)
---
> It boots fine with pseries_defconfig.
> 
> Attached is the config file that I've been using, which is probably
> descended over many generations of kernels from some config file in my
> machine's distant past.  (Enable DEBUG_SLAB or DEBUG_PAGEALLOC and it
> will fail to boot.)  After I run 'make menuconfig' starting from
> pseries_defconfig...
> $ diff config_ok .config | wc -l
> 2052

I narrowed this down to adding the following on pseries_defconfig:
  +CONFIG_SLAB=y
  +CONFIG_PPC_64K_PAGES=y
  +CONFIG_PPC_SUBPAGE_PROT=y
  +CONFIG_DEBUG_SLAB=y
To reproduce the fail.  

diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 83f534d..5e95844 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -1123,7 +1123,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
else
 #endif /* CONFIG_PPC_HAS_HASH_64K */
rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize,
-   subpage_protection(pgdir, ea));
+   subpage_protection(mm, ea));
 
/* Dump some info in case of hash insertion failure, they should
 * never happen so it is really useful to know if/when they do


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


application needs fast access to physical memory

2010-11-17 Thread steven . lin


My application needs a fast way to access a specific physical DDR memory
region. The application runs on an MPC8548 PowerPC which has an MMU. I've
tried two approaches that are typical for Linux, mmap() and using a kernel
module that implements read()/write() into this region and I'm finding that
performance is very slow for both. It's a couple orders of magnitude slower
than, for example, copying a large buffer from one place in the
application's virtual memory to another place in the application's virtual
memory.

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

[PATCH 4/5] powerpc/5200: dts: Change combatible strings on localbus

2010-11-17 Thread John Bonesio
This patch changes some incorrect compatible strings on the local plus bus node
in dts files for MPC5200b based systems.

Signed-off-by: John Bonesio 
---

 arch/powerpc/boot/dts/cm5200.dts|2 +-
 arch/powerpc/boot/dts/digsy_mtc.dts |2 +-
 arch/powerpc/boot/dts/media5200.dts |2 +-
 arch/powerpc/boot/dts/motionpro.dts |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/boot/dts/cm5200.dts b/arch/powerpc/boot/dts/cm5200.dts
index d549897..22f7233 100644
--- a/arch/powerpc/boot/dts/cm5200.dts
+++ b/arch/powerpc/boot/dts/cm5200.dts
@@ -219,7 +219,7 @@
};
 
localbus {
-   compatible = "fsl,mpc5200b-lpb","simple-bus";
+   compatible = "fsl,mpc5200b-lpb","fsl,mpc5200-lpb","simple-bus";
#address-cells = <2>;
#size-cells = <1>;
ranges = <0 0 0xfc00 0x200>;
diff --git a/arch/powerpc/boot/dts/digsy_mtc.dts 
b/arch/powerpc/boot/dts/digsy_mtc.dts
index f0592de..3147b98 100644
--- a/arch/powerpc/boot/dts/digsy_mtc.dts
+++ b/arch/powerpc/boot/dts/digsy_mtc.dts
@@ -218,7 +218,7 @@
};
 
localbus {
-   compatible = "fsl,mpc5200b-lpb","simple-bus";
+   compatible = "fsl,mpc5200b-lpb","fsl,mpc5200-lpb","simple-bus";
#address-cells = <2>;
#size-cells = <1>;
ranges = <0 0 0xff00 0x100>;
diff --git a/arch/powerpc/boot/dts/media5200.dts 
b/arch/powerpc/boot/dts/media5200.dts
index e027f45..861f09f 100644
--- a/arch/powerpc/boot/dts/media5200.dts
+++ b/arch/powerpc/boot/dts/media5200.dts
@@ -270,7 +270,7 @@
};
 
localbus {
-   compatible = "fsl,mpc5200b-lpb","simple-bus";
+   compatible = "fsl,mpc5200b-lpb","fsl,mpc5200-lpb","simple-bus";
#address-cells = <2>;
#size-cells = <1>;
 
diff --git a/arch/powerpc/boot/dts/motionpro.dts 
b/arch/powerpc/boot/dts/motionpro.dts
index 3ab4666..97cb085 100644
--- a/arch/powerpc/boot/dts/motionpro.dts
+++ b/arch/powerpc/boot/dts/motionpro.dts
@@ -236,7 +236,7 @@
};
 
localbus {
-   compatible = "fsl,mpc5200b-lpb","simple-bus";
+   compatible = "fsl,mpc5200b-lpb","fsl,mpc5200-lpb","simple-bus";
#address-cells = <2>;
#size-cells = <1>;
ranges = <0 0 0xff00 0x0100

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


[PATCH 3/5] powerpc/5200: dts: remove unused properties

2010-11-17 Thread John Bonesio
This patch remove unused properties in dts files in preparation of refactoring
the dts files for MPC5200b based boards.

Signed-off-by: John Bonesio 
---

 arch/powerpc/boot/dts/cm5200.dts|2 --
 arch/powerpc/boot/dts/lite5200b.dts |3 ---
 arch/powerpc/boot/dts/media5200.dts |2 --
 arch/powerpc/boot/dts/motionpro.dts |2 --
 arch/powerpc/boot/dts/pcm030.dts|2 --
 arch/powerpc/boot/dts/pcm032.dts|2 --
 6 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/boot/dts/cm5200.dts b/arch/powerpc/boot/dts/cm5200.dts
index 9369dcd..d549897 100644
--- a/arch/powerpc/boot/dts/cm5200.dts
+++ b/arch/powerpc/boot/dts/cm5200.dts
@@ -230,8 +230,6 @@
reg = <0 0 0x200>;
bank-width = <2>;
device-width = <2>;
-   #size-cells = <1>;
-   #address-cells = <1>;
};
};
 };
diff --git a/arch/powerpc/boot/dts/lite5200b.dts 
b/arch/powerpc/boot/dts/lite5200b.dts
index a74b790..c0a4e45 100644
--- a/arch/powerpc/boot/dts/lite5200b.dts
+++ b/arch/powerpc/boot/dts/lite5200b.dts
@@ -174,7 +174,6 @@
 
p...@2000 { // PSC1
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
-   cell-index = <0>;
reg = <0x2000 0x100>;
interrupts = <2 1 0>;
};
@@ -198,7 +197,6 @@
// PSC4 in uart mode example
//ser...@2600 { // PSC4
//  compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
-   //  cell-index = <3>;
//  reg = <0x2600 0x100>;
//  interrupts = <2 11 0>;
//};
@@ -206,7 +204,6 @@
// PSC5 in uart mode example
//ser...@2800 { // PSC5
//  compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
-   //  cell-index = <4>;
//  reg = <0x2800 0x100>;
//  interrupts = <2 12 0>;
//};
diff --git a/arch/powerpc/boot/dts/media5200.dts 
b/arch/powerpc/boot/dts/media5200.dts
index a70ef68..e027f45 100644
--- a/arch/powerpc/boot/dts/media5200.dts
+++ b/arch/powerpc/boot/dts/media5200.dts
@@ -185,8 +185,6 @@
// PSC6 in uart mode
console: p...@2c00 {// PSC6
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
-   cell-index = <5>;
-   port-number = <0>;  // Logical port assignment
reg = <0x2c00 0x100>;
interrupts = <2 4 0>;
};
diff --git a/arch/powerpc/boot/dts/motionpro.dts 
b/arch/powerpc/boot/dts/motionpro.dts
index f6261ea..3ab4666 100644
--- a/arch/powerpc/boot/dts/motionpro.dts
+++ b/arch/powerpc/boot/dts/motionpro.dts
@@ -277,8 +277,6 @@
reg = <0 0 0x0100>;
bank-width = <2>;
device-width = <2>;
-   #size-cells = <1>;
-   #address-cells = <1>;
};
};
 };
diff --git a/arch/powerpc/boot/dts/pcm030.dts b/arch/powerpc/boot/dts/pcm030.dts
index 3a4f554..f3e30bb 100644
--- a/arch/powerpc/boot/dts/pcm030.dts
+++ b/arch/powerpc/boot/dts/pcm030.dts
@@ -196,7 +196,6 @@
 
p...@2400 { /* PSC3 in UART mode */
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
-   cell-index = <2>;
reg = <0x2400 0x100>;
interrupts = <2 3 0>;
};
@@ -207,7 +206,6 @@
 
p...@2c00 { /* PSC6 in UART mode */
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
-   cell-index = <5>;
reg = <0x2c00 0x100>;
interrupts = <2 4 0>;
};
diff --git a/arch/powerpc/boot/dts/pcm032.dts b/arch/powerpc/boot/dts/pcm032.dts
index 17596c7..e0f2702 100644
--- a/arch/powerpc/boot/dts/pcm032.dts
+++ b/arch/powerpc/boot/dts/pcm032.dts
@@ -196,7 +196,6 @@
 
p...@2400 { /* PSC3 in UART mode */
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
-   cell-index = <2>;
reg = <0x2400 0x100>;
interrupts = <2 3 0>;
};
@@ -207,7 +206,6 @@
 
p...@2c00 { /* PSC6 in UART mode */
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
-   cell-index = <5>;
reg = <0x2c00 0x100>;
interrupts = <2 4 0>;
};

___
Linuxppc-dev mailing list
Linuxppc-dev@l

[PATCH 2/5] powerpc/5200: dts: rename nodes to prepare for refactoring dts files

2010-11-17 Thread John Bonesio
This patch renames nodes in dts fils for MPC5200b files to prepare for
refactoring of these files later. When refactoring it will be easier to verify
the results if the node names aren't changing at the same time.

Signed-off-by: John Bonesio 
---

 arch/powerpc/boot/dts/cm5200.dts|8 
 arch/powerpc/boot/dts/digsy_mtc.dts |6 +++---
 arch/powerpc/boot/dts/lite5200b.dts |2 +-
 arch/powerpc/boot/dts/media5200.dts |2 +-
 arch/powerpc/boot/dts/motionpro.dts |   10 +-
 arch/powerpc/boot/dts/mucmc52.dts   |6 +++---
 arch/powerpc/boot/dts/pcm030.dts|6 +++---
 arch/powerpc/boot/dts/pcm032.dts|6 +++---
 arch/powerpc/boot/dts/uc101.dts |6 +++---
 9 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/arch/powerpc/boot/dts/cm5200.dts b/arch/powerpc/boot/dts/cm5200.dts
index dd38608..9369dcd 100644
--- a/arch/powerpc/boot/dts/cm5200.dts
+++ b/arch/powerpc/boot/dts/cm5200.dts
@@ -160,25 +160,25 @@
reg = <0x1f00 0x100>;
};
 
-   ser...@2000 {   // PSC1
+   p...@2000 { // PSC1
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
reg = <0x2000 0x100>;
interrupts = <2 1 0>;
};
 
-   ser...@2200 {   // PSC2
+   p...@2200 { // PSC2
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
reg = <0x2200 0x100>;
interrupts = <2 2 0>;
};
 
-   ser...@2400 {   // PSC3
+   p...@2400 { // PSC3
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
reg = <0x2400 0x100>;
interrupts = <2 3 0>;
};
 
-   ser...@2c00 {   // PSC6
+   p...@2c00 { // PSC6
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
reg = <0x2c00 0x100>;
interrupts = <2 4 0>;
diff --git a/arch/powerpc/boot/dts/digsy_mtc.dts 
b/arch/powerpc/boot/dts/digsy_mtc.dts
index 8e9be6b..f0592de 100644
--- a/arch/powerpc/boot/dts/digsy_mtc.dts
+++ b/arch/powerpc/boot/dts/digsy_mtc.dts
@@ -155,13 +155,13 @@
reg = <0x1f00 0x100>;
};
 
-   ser...@2600 {   // PSC4
+   p...@2600 { // PSC4
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
reg = <0x2600 0x100>;
interrupts = <2 11 0>;
};
 
-   ser...@2800 {   // PSC5
+   p...@2800 { // PSC5
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
reg = <0x2800 0x100>;
interrupts = <2 12 0>;
@@ -217,7 +217,7 @@
};
};
 
-   lpb {
+   localbus {
compatible = "fsl,mpc5200b-lpb","simple-bus";
#address-cells = <2>;
#size-cells = <1>;
diff --git a/arch/powerpc/boot/dts/lite5200b.dts 
b/arch/powerpc/boot/dts/lite5200b.dts
index 59702ac..a74b790 100644
--- a/arch/powerpc/boot/dts/lite5200b.dts
+++ b/arch/powerpc/boot/dts/lite5200b.dts
@@ -172,7 +172,7 @@
reg = <0x1f00 0x100>;
};
 
-   ser...@2000 {   // PSC1
+   p...@2000 { // PSC1
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
cell-index = <0>;
reg = <0x2000 0x100>;
diff --git a/arch/powerpc/boot/dts/media5200.dts 
b/arch/powerpc/boot/dts/media5200.dts
index 0c3902b..a70ef68 100644
--- a/arch/powerpc/boot/dts/media5200.dts
+++ b/arch/powerpc/boot/dts/media5200.dts
@@ -183,7 +183,7 @@
};
 
// PSC6 in uart mode
-   console: ser...@2c00 {  // PSC6
+   console: p...@2c00 {// PSC6
compatible = 
"fsl,mpc5200b-psc-uart","fsl,mpc5200-psc-uart";
cell-index = <5>;
port-number = <0>;  // Logical port assignment
diff --git a/arch/powerpc/boot/dts/motionpro.dts 
b/arch/powerpc/boot/dts/motionpro.dts
index 6ca4fc1..f6261ea 100644
--- a/arch/powerpc/boot/dts/motionpro.dts
+++ b/arch/powerpc/boot/dts/motionpro.dts
@@ -100,7 +100,7 @@
interrupts = <1 14 0>;
};
 
-   motionpro-...@660 { // Motion-PRO status LED
+   ti...@660 { // Motion-PRO status LED
compatible = "promess,motionpro-led";
label = "motionpro-statusled";
reg = <0x660 0x10>

[PATCH 0/5] refactor dts files for mpc5200b based systems (take 2)

2010-11-17 Thread John Bonesio
I belive I've fixed the problems with the messed up [PATCH 1/5]. I've also
incorporated changes per comments.

The following series implements a set of changes to refactor dts (device tree
source) files for systems using the mpc5200b SoC.

The dtc changes allow a base dts to be defined in a common dts file included
with '/include/ '. This base dts can then be updated and modified
by merging in a second device tree defined in the system specific dts file.

The rest of the changes are the refactoring of the mpc5200b dts files.

---

John Bonesio (5):
  Pull in recent changes from the main dtc repository. These changes 
primarily
  powerpc/5200: dts: rename nodes to prepare for refactoring dts files
  powerpc/5200: dts: remove unused properties
  powerpc/5200: dts: Change combatible strings on localbus
  powerpc/5200: dts: refactor dts files


 arch/powerpc/boot/dts/cm5200.dts|  198 +++--
 arch/powerpc/boot/dts/digsy_mtc.dts |  179 +++
 arch/powerpc/boot/dts/lite5200b.dts |  232 ++---
 arch/powerpc/boot/dts/media5200.dts |  216 +++
 arch/powerpc/boot/dts/motionpro.dts |  198 +++--
 arch/powerpc/boot/dts/mpc5200b.dtsi |  276 +++
 arch/powerpc/boot/dts/mucmc52.dts   |  176 ++
 arch/powerpc/boot/dts/pcm030.dts|  201 ++---
 arch/powerpc/boot/dts/pcm032.dts|  205 ++
 arch/powerpc/boot/dts/uc101.dts |  162 -
 10 files changed, 499 insertions(+), 1544 deletions(-)
 create mode 100644 arch/powerpc/boot/dts/mpc5200b.dtsi

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


Re: PowerMac8600 help ...

2010-11-17 Thread Segher Boessenkool
> I have also discovered what prevented
> firefox from working with 4.3.5. It was picking up the 3.4.6 libstdc++
> (possibly other internal tidbits as well).

So you installed (one of) those compilers incorrectly.

> P.S.:  newer powermacs have a line in cpuinfo, like "PowerMac 7,2".
> Does this uniquely identify a particular model?

Yes.  There's a board revision as well, but I don't think we ever
needed to use that info.


Segher

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


Re: PowerMac8600 help ...

2010-11-17 Thread kevin diggs
Hi,

I have managed to boot the G4 (GigE) using a kernel built with the
4.3.5 compiler on the 8600. I have also discovered what prevented
firefox from working with 4.3.5. It was picking up the 3.4.6 libstdc++
(possibly other internal tidbits as well). Even something as simple
as:

#include 
#include 
using namespace std;

inline void pr_message(string s="Hello world!")  {
cout< wrote:
> Ben,
>
> Thanks for taking the time to reply. I tried removing some memory that
> I "suspect" might be "less than ideal". The result was the same. So I
> don't think the problem is memory related. Also the latest firefox
> build using gcc 4.3.5 I tried was with CFLAGS="-O0 -mcpu=powerpc".
> This should chew up less memory than a gcc 3.4.6 build with "-O2
> -mcpu=750 -mmultiple", right?
>
> I'm gonna switch to the GigE and try a 2.6.36 with the 8600 config and
> a firefox build using 4.3.5. The GigE has an hd5500 HDTV card in it!
>
> Thanks again for taking the time to try to help!
>
> kevin
>
> P.S.:  I have discovered that one should not build firefox with
> -mpowerpc-gpopt for a 750GX cauz it ain't not got no hardware fsqrt!
> Off the top of your head would you know which of the ppc32 processors
> has fsqrt? Is it only the 604?
>
> On Mon, Nov 8, 2010 at 4:31 PM, Benjamin Herrenschmidt
>  wrote:
>> On Mon, 2010-11-08 at 10:43 -0600, kevin diggs wrote:
>>>
>>> Sorry for the noise but I am having trouble getting the latest kernel
>>> built for a PowerMac8600 with a 750GX processor card. If this is not
>>> an appropriate topic for the list please tell me (and hopefully point
>>> me in the correct direction).
>>>
>>> I have narrowed the problem down to the compiler. YDL 4.0 is installed
>>> on the machine. The stock compiler is 3.3.3. That version can NOT
>>> build past 2.6.28. I built 3.4.6, (the latest 3 series I could find).
>>> It can NOT build later kernel versions either. It can build Firefox
>>> 2.0.0.15pre, including powerpc thin lock support. Running it now.
>>>
>>> I then tried 4.3.5. This will build the kernel. But the resulting
>>> kernel will NOT run. A firefox built with 4.3.5 also will not run. Or
>>> if it runs it crashes often (http://abcnews.com).
>>>
>>> What really puzzles me is I used the same basic compiler boot
>>> strapping (3.3.3 to build 3.4.6, 3.4.6 to build 4.3.5) on a GiGE. That
>>> machine is now running 2.6.36.
>>>
>>> The CFLAGS used were:  "-O2 -mcpu=7450 -mmultiple -mstring" for the
>>> GiGE (dual 7455s). Substitute 750 for the 8600.
>>>
>>> Any suggestions would be appreciated.
>>
>> This is odd... I wonder if your 8600 is having some memory problems ?
>>
>> Have you tried using the kernel/firefox built with 4.3.5 on the GigE and
>> booting them on the 8600 ?
>>
>> 3.x are ancient but I would expect 4.3.x to work just fine
>>
>> Cheers,
>> Ben.
>>
>>
>>
>
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] powerpc: Per process DSCR

2010-11-17 Thread Benjamin Herrenschmidt
On Wed, 2010-11-17 at 11:15 -0600, Kumar Gala wrote:
> We don't have no stinking DSCR ;).  Would like this to be #ifdef
> CONFIG_PPC_BOOK3S_64.

That or select it from the platform / CPUs that support it.

Cheers,
Ben.


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


Re: [PATCH 1/5] of: Add support for linking device tree blobs into vmlinux

2010-11-17 Thread Sam Ravnborg
> > > +
> > > +DTC = $(objtree)/scripts/dtc/dtc
> > > +
> > > +quiet_cmd_dtc = DTC  $@
> > Please avoid tabs in the output - all other uses spaces. (There is a tab 
> > between DTC and $@)
> > 
> > > +  cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) 
> > > $(src)/dts/$*.dts
> > 
> > Looks strange. How about:
> >   cmd_dtc = $(DTC) -O dtb -o $@ -b 0 $(DTS_FLAGS) $<
> > 
> > Then you avoid the hardcoded path in the rule too.
> > 
> > 
> > > +
> > > +$(obj)/%.dtb: $(src)/dts/%.dts
> > > + $(call if_changed,dtc)
> 
> The rule should be generic (not depend on the presence of a dts
> subdirectory.  Basically, the .dtb really should be generated in the
> same directory as the .dts file.  There is no reason for this rule to
> have special behaviour.
> 
> > 
> > This snippet belong in the file that uses this.
> > This is how we do for other rules like bzip etc.
> 
> This rule is intended to be generic and usable anywhere in the tree.
I understand this.
But only few people will recognize this so they see something like this:

obj-y := foo.dtb.o

And they look for a file named foo.dtb.S or foo.dtb.c.

If we spell it out then we have a better chance to allow
people to understand the relation ships between the files.


If we really want to hide this in scipts/Makefile.* then Makefile.build
is the logical places to do so.
Makefile.lib is supposed to be stuff that is relavent for more than
one Makefile in scripts/* but it has unfortunately also grown
some of the boot support stuff.

Today there is a single rule related to _shipped files.
We should not fill it up with additional rules - put them
Makefile.build if we really want to avoid them in boot/Makefile.

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


Re: [PATCH] kgdb, ppc: Corrected the address using of current->thread.evr register

2010-11-17 Thread Kumar Gala
> From: Dongdong Deng 
> Date: Tue, 16 Nov 2010 16:02:00 -0600
> Subject: [PATCH 4/4] kgdb: Fix regression in evr register handling
> 
> Commit ff10b88b5a05c8f1646dd15fb9f6093c1384ff6d (kgdb,ppc: Individual
> register get/set for ppc) introduced a problem where memcpy was used
> incorrectly to read and write the evr registers with a kernel that
> has:
> 
> CONFIG_FSL_BOOKE=y
> CONFIG_SPE=y
> CONFIG_KGDB=y
> 
> This patch also fixes the following compilation problems:
> 
> arch/powerpc/kernel/kgdb.c: In function 'dbg_get_reg':
> arch/powerpc/kernel/kgdb.c:341: error: passing argument 2 of 'memcpy' makes 
> pointer from integer without a cast
> arch/powerpc/kernel/kgdb.c: In function 'dbg_set_reg':
> arch/powerpc/kernel/kgdb.c:366: error: passing argument 1 of 'memcpy' makes 
> pointer from integer without a cast
> 
> [jason.wes...@windriver.com: Remove void * casts and fix patch header]
> Reported-by: Milton Miller 
> Signed-off-by: Dongdong Deng 
> Signed-off-by: Jason Wessel 
> CC: linuxppc-dev@lists.ozlabs.org
> ---
> arch/powerpc/kernel/kgdb.c |4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
> index 7a9db64..42850ee 100644
> --- a/arch/powerpc/kernel/kgdb.c
> +++ b/arch/powerpc/kernel/kgdb.c
> @@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs 
> *regs)
>   /* FP registers 32 -> 63 */
> #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE)
>   if (current)
> - memcpy(mem, current->thread.evr[regno-32],
> + memcpy(mem, ¤t->thread.evr[regno-32],
>   dbg_reg_def[regno].size);
> #else
>   /* fp registers not used by kernel, leave zero */
> @@ -362,7 +362,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs 
> *regs)
>   if (regno >= 32 && regno < 64) {
>   /* FP registers 32 -> 63 */
> #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE)
> - memcpy(current->thread.evr[regno-32], mem,
> + memcpy(¤t->thread.evr[regno-32], mem,
>   dbg_reg_def[regno].size);
> #else
>   /* fp registers not used by kernel, leave zero */
> -- 
> 1.7.0.4

Acked-by: Kumar Gala 

- k

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


Re: [PATCH 1/5] of: Add support for linking device tree blobs into vmlinux

2010-11-17 Thread Grant Likely
On Wed, Nov 17, 2010 at 10:27:51AM +0100, Sam Ravnborg wrote:
> On Tue, Nov 16, 2010 at 02:41:36PM -0800, dirk.brande...@gmail.com wrote:
> > From: Dirk Brandewie 
> > 
> > This patch adds support for linking device tree blobs into
> > vmlinux. Modifies asm-generic/vmlinux.lds.h to add linking
> > .dtb.init.rodata sections into the .init.data section of the vmlinux
> > image. Modifies scripts/Makefile.lib to add a kbuild command to
> > compile DTS files to device tree blobs and a rule to create objects to
> > wrap the blobs for linking.
> > 
> > The DTB's are placed on 32 byte boundries to allow parsing the blob
> > with driver/of/fdt.c during early boot without having to copy the blob
> > to get the structure alignment GCC expects.
> > 
> > A DTB is linked in by adding the DTB object to the list of objects to
> > be linked into vmlinux in the archtecture specific Makefile using
> >obj-y += foo.dtb.o
> > 
> > Signed-off-by: Dirk Brandewie 
> > ---
> >  include/asm-generic/vmlinux.lds.h |   19 +--
> >  scripts/Makefile.lib  |   20 
> >  2 files changed, 37 insertions(+), 2 deletions(-)
> 
> When you touch Makefiles in scripts/* it is always a good idea to cc:
> kbuild maintainer on the patch - I have added Michal.
> 
> Support functionality in Makefile.lib is documented in
> Documentation/kbuild/* - please add documentation there.
> 
> > 
> > diff --git a/include/asm-generic/vmlinux.lds.h 
> > b/include/asm-generic/vmlinux.lds.h
> > index bd69d79..ea671e7 100644
> > --- a/include/asm-generic/vmlinux.lds.h
> > +++ b/include/asm-generic/vmlinux.lds.h
> > @@ -67,7 +67,14 @@
> >   * Align to a 32 byte boundary equal to the
> >   * alignment gcc 4.5 uses for a struct
> >   */
> > -#define STRUCT_ALIGN() . = ALIGN(32)
> > +#define STRUCT_ALIGNMENT 32
> > +#define STRUCT_ALIGN() . = ALIGN(STRUCT_ALIGNMENT)
> > +
> > +/* Device tree blobs linked into the kernel need to have proper
> > + * structure alignment to be parsed by the flat device tree library
> > + * used in early boot
> > +*/
> > +#define DTB_ALIGNMENT STRUCT_ALIGNMENT
> 
> It has been discussed in another thread some time ago to move
> to a general 32 byte alignment for everything in vmlinux.lds.h
> So there is not much need for the specific DTB alignment.
> 
> > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> > index 4c72c11..29db062 100644
> > --- a/scripts/Makefile.lib
> > +++ b/scripts/Makefile.lib
> > @@ -200,6 +200,26 @@ quiet_cmd_gzip = GZIP$@
> >  cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \
> > (rm -f $@ ; false)
> >  
> > +# DTC
> > +#  
> > ---
> > +$(obj)/%.dtb.S: $(obj)/%.dtb FORCE
> > +   @echo '#include ' > $@
> > +   @echo '.section .dtb.init.rodata,"a"' >> $@
> > +   @echo '.balign DTB_ALIGNMENT' >> $@
> > +   @echo '.global __dtb_$(*F)_begin' >> $@
> > +   @echo '__dtb_$(*F)_begin:' >> $@
> > +   @echo '.incbin "$<" ' >> $@
> > +   @echo '__dtb_$(*F)_end:' >> $@
> > +   @echo '.global __dtb_$(*F)_end' >> $@
> > +   @echo '.balign DTB_ALIGNMENT' >> $@
> 
> 
> This will be noisy during build. Please use proper macors to supress output.
> 
> 
> > +
> > +DTC = $(objtree)/scripts/dtc/dtc
> > +
> > +quiet_cmd_dtc = DTC$@
> Please avoid tabs in the output - all other uses spaces. (There is a tab 
> between DTC and $@)
> 
> > +  cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) 
> > $(src)/dts/$*.dts
> 
> Looks strange. How about:
>   cmd_dtc = $(DTC) -O dtb -o $@ -b 0 $(DTS_FLAGS) $<
> 
> Then you avoid the hardcoded path in the rule too.
> 
> 
> > +
> > +$(obj)/%.dtb: $(src)/dts/%.dts
> > +   $(call if_changed,dtc)

The rule should be generic (not depend on the presence of a dts
subdirectory.  Basically, the .dtb really should be generated in the
same directory as the .dts file.  There is no reason for this rule to
have special behaviour.

> 
> This snippet belong in the file that uses this.
> This is how we do for other rules like bzip etc.

This rule is intended to be generic and usable anywhere in the tree.

g.

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


Re: [PATCH 1/5] of: Add support for linking device tree blobs into vmlinux

2010-11-17 Thread David Daney

On 11/16/2010 10:14 PM, Dirk Brandewie wrote:

On 11/16/2010 06:58 PM, Grant Likely wrote:

On Tue, Nov 16, 2010 at 7:21 PM, Dirk Brandewie
 wrote:


On 11/16/2010 04:39 PM, David Daney wrote:


Thanks for doing this. However I have a few comments...

On 11/16/2010 02:41 PM, dirk.brande...@gmail.com wrote:


From: Dirk Brandewie

/* .data section */
#define DATA_DATA \
*(.data) \
@@ -468,7 +482,8 @@
MCOUNT_REC() \
DEV_DISCARD(init.rodata) \
CPU_DISCARD(init.rodata) \
- MEM_DISCARD(init.rodata)
+ MEM_DISCARD(init.rodata) \
+ KERNEL_DTB()



I thought the init.rodata was only for data used by __init things.
Although the
current linker scripts do not put it in the section that gets
recycled as
usable
memory.

IIRC the unflattened version of the device tree has pointers to the
flattened
data. Since the device tree nodes are live for the entire kernel
lifecycle,
shouldn't the device tree blobs be in non-init memory?



The contents of the blob get copied to allocated memory during
unflatten_device_tree() so the blob that is linked in is no longer
needed
after init.


Have you written a patch to add this behaviour? The current code
doesn't. :-)



I misspoke, my blob gets copied to allocated memory during
unflatten_device_tree.
my early_init_dt_alloc_memory_arch() returns the physical address of a
kmalloc'd
buffer.



Perhaps you should take a look at unflatten_dt_node(), especially the 
part where property names and values are assigned.  I could be mistaken, 
but it appears to me that the memory allocated by 
early_init_dt_alloc_memory_arch() is not used to hold the name and value 
strings.  It is possible that they might be referred to in their 
original location in the flattened blob.




You would want copy the dtb that your platform is going to use to
non-init memory.



... or you might want to locate the dtb somewhere where it would be 
unlikely to get clobbered if someone were to arrange for the init.rodata 
to be freed for reuse.


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


Re: [PATCH] kgdb, ppc: Corrected the address using of current->thread.evr register

2010-11-17 Thread Kumar Gala

On Nov 17, 2010, at 11:21 AM, Jason Wessel wrote:

> On 11/17/2010 11:16 AM, Kumar Gala wrote:
> 
>>> Thanks,
>>> Jason.
>> 
>> Repost a version with the casts and I'll pick it up.
>> 
>> - k
> 
> I have the final version ready for a pull request that I was going to
> make in the next hour or two that is fully regression tested.
> 
> If you would prefer to these changes in the PPC, let me know, or if
> you want to ack the patch, I'll add that before submitting the pull
> request.
> 
> Thanks,
> Jason.
> 
> --

If they'll get pulled in via another path that is fine.  I'm happy to ack a 
proper patch.

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


Re: [PATCH] kgdb, ppc: Corrected the address using of current->thread.evr register

2010-11-17 Thread Jason Wessel
On 11/17/2010 11:16 AM, Kumar Gala wrote:

>> Thanks,
>> Jason.
> 
> Repost a version with the casts and I'll pick it up.
> 
> - k

I have the final version ready for a pull request that I was going to
make in the next hour or two that is fully regression tested.

If you would prefer to these changes in the PPC, let me know, or if
you want to ack the patch, I'll add that before submitting the pull
request.

Thanks,
Jason.

--
>From b47efa1d4fa4631ee0cc59f4fcd143464b910cdc Mon Sep 17 00:00:00 2001
From: Dongdong Deng 
Date: Tue, 16 Nov 2010 16:02:00 -0600
Subject: [PATCH 4/4] kgdb: Fix regression in evr register handling

Commit ff10b88b5a05c8f1646dd15fb9f6093c1384ff6d (kgdb,ppc: Individual
register get/set for ppc) introduced a problem where memcpy was used
incorrectly to read and write the evr registers with a kernel that
has:

CONFIG_FSL_BOOKE=y
CONFIG_SPE=y
CONFIG_KGDB=y

This patch also fixes the following compilation problems:

arch/powerpc/kernel/kgdb.c: In function 'dbg_get_reg':
arch/powerpc/kernel/kgdb.c:341: error: passing argument 2 of 'memcpy' makes 
pointer from integer without a cast
arch/powerpc/kernel/kgdb.c: In function 'dbg_set_reg':
arch/powerpc/kernel/kgdb.c:366: error: passing argument 1 of 'memcpy' makes 
pointer from integer without a cast

[jason.wes...@windriver.com: Remove void * casts and fix patch header]
Reported-by: Milton Miller 
Signed-off-by: Dongdong Deng 
Signed-off-by: Jason Wessel 
CC: linuxppc-dev@lists.ozlabs.org
---
 arch/powerpc/kernel/kgdb.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
index 7a9db64..42850ee 100644
--- a/arch/powerpc/kernel/kgdb.c
+++ b/arch/powerpc/kernel/kgdb.c
@@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs 
*regs)
/* FP registers 32 -> 63 */
 #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE)
if (current)
-   memcpy(mem, current->thread.evr[regno-32],
+   memcpy(mem, ¤t->thread.evr[regno-32],
dbg_reg_def[regno].size);
 #else
/* fp registers not used by kernel, leave zero */
@@ -362,7 +362,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs)
if (regno >= 32 && regno < 64) {
/* FP registers 32 -> 63 */
 #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE)
-   memcpy(current->thread.evr[regno-32], mem,
+   memcpy(¤t->thread.evr[regno-32], mem,
dbg_reg_def[regno].size);
 #else
/* fp registers not used by kernel, leave zero */
-- 
1.7.0.4

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


[PATCH] powerpc/mm: Fix module instruction tlb fault handling on Book-E 64

2010-11-17 Thread Kumar Gala
We were seeing oops like the following when we did an rmmod on a module:

Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x80008010
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=2 P5020 DS
last sysfs file: /sys/devices/qman-portals.2/qman-pool.9/uevent
Modules linked in: qman_tester(-)
NIP: 80008010 LR: c0074858 CTR: 80008010
REGS: c0002e29bab0 TRAP: 0400   Not tainted
(2.6.34.6-00744-g2d21f14)
MSR: 80029000   CR: 24000448  XER: 
TASK = c0007a8be600[4987] 'rmmod' THREAD: c0002e298000 CPU: 1
GPR00: 80008010 c0002e29bd30 80012798 c035fb28
GPR04: 0002 0002 24022428 c0009108
GPR08: fffe 8000a618 c03c13c8 
GPR12: 22000444 cfffed00  
GPR16: 100c  100dabc8 10099688
GPR20:  100cfc28  10011a44
GPR24: 100017b2   0880
GPR28: c035fb28 8000a7b8 c0376d80 c03cce50
NIP [80008010] .test_exit+0x0/0x10 [qman_tester]
LR [c0074858] .SyS_delete_module+0x1f8/0x2f0
Call Trace:
[c0002e29bd30] [c00748b4] .SyS_delete_module+0x254/0x2f0 
(unreliable)
[c0002e29be30] [c580] syscall_exit+0x0/0x2c
Instruction dump:
       
3860 4e800020 6000 6000 <4e800020> 6000 6000 6000
---[ end trace 4f57124939a84dc8 ]---

This appears to be due to checking the wrong permission bits in the
instruction_tlb_miss handling if the address that faulted was in vmalloc
space.  We need to look at the supervisor execute (_PAGE_BAP_SX) bit and
not the user bit (_PAGE_BAP_UX/_PAGE_EXEC).

Also removed a branch level since it did not appear to be used.

Reported-by: Jeffrey Ladouceur 
Signed-off-by: Kumar Gala 
---
 arch/powerpc/mm/tlb_low_64e.S |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/mm/tlb_low_64e.S b/arch/powerpc/mm/tlb_low_64e.S
index 8b04c54..8526bd9 100644
--- a/arch/powerpc/mm/tlb_low_64e.S
+++ b/arch/powerpc/mm/tlb_low_64e.S
@@ -138,8 +138,11 @@
cmpldi  cr0,r15,0   /* Check for user region */
std r14,EX_TLB_ESR(r12) /* write crazy -1 to frame */
beq normal_tlb_miss
+
+   li  r11,_PAGE_PRESENT|_PAGE_BAP_SX  /* Base perm */
+   orisr11,r11,_page_acces...@h
/* XXX replace the RMW cycles with immediate loads + writes */
-1: mfspr   r10,SPRN_MAS1
+   mfspr   r10,SPRN_MAS1
cmpldi  cr0,r15,8   /* Check for vmalloc region */
rlwinm  r10,r10,0,16,1  /* Clear TID */
mtspr   SPRN_MAS1,r10
-- 
1.7.2.3

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


Re: [PATCH] kgdb, ppc: Corrected the address using of current->thread.evr register

2010-11-17 Thread Kumar Gala

On Nov 16, 2010, at 4:02 PM, Jason Wessel wrote:

> On 11/16/2010 06:58 AM, Dongdong Deng wrote:
>> Passing the address of current->thread.evr register to memcpy function.
>> 
>> 
> 
> It turns out that out of all of my test configs and targets I did not
> have any that defined both CONFIG_FSL_BOOKE and CONFIG_SPE else this
> would have been caught in testing because will definitely crash
> dereferencing the contents of the evr registers.
> 
>> Signed-off-by: Dongdong Deng 
>> CC: Hai Shan 
>> CC: Milton Miller 
>> CC: linuxppc-dev@lists.ozlabs.org
>> ---
>> arch/powerpc/kernel/kgdb.c |4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>> 
>> diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c
>> index 7a9db64..781acff 100644
>> --- a/arch/powerpc/kernel/kgdb.c
>> +++ b/arch/powerpc/kernel/kgdb.c
>> @@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs 
>> *regs)
>>  /* FP registers 32 -> 63 */
>> #if defined(CONFIG_FSL_BOOKE) && defined(CONFIG_SPE)
>>  if (current)
>> -memcpy(mem, current->thread.evr[regno-32],
>> +memcpy(mem, (void *)¤t->thread.evr[regno-32],
>>  dbg_reg_def[regno].size);
>> 
> 
> As Sergei already pointed out, the (void *) casts should not be needed here.
> 
> This would have been fixed correctly had I seen the compile warnings
> from the CONFIG_SPE at the test phase.   Namely at the compile phase
> doesn't even complete:
> 
> arch/powerpc/kernel/kgdb.c: In function 'dbg_get_reg':
> arch/powerpc/kernel/kgdb.c:341: error: passing argument 2 of 'memcpy'
> makes pointer from integer without a cast
> arch/powerpc/include/asm/string.h:25: note: expected 'const void *' but
> argument is of type 'long unsigned int'
> arch/powerpc/kernel/kgdb.c: In function 'dbg_set_reg':
> arch/powerpc/kernel/kgdb.c:366: error: passing argument 1 of 'memcpy'
> makes pointer from integer without a cast
> arch/powerpc/include/asm/string.h:25: note: expected 'void *' but
> argument is of type 'long unsigned int'
> 
> 
> Moral of the story... I now have a board and config with the SPE turned
> on, and after boot testing confirmed the evr registers are working.
> 
> I plan to have a pull request out to Linus with this fix and several
> other accumulated regression fixes sometime in the next 48 hours.
> 
> Thanks,
> Jason.

Repost a version with the casts and I'll pick it up.

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


Re: [PATCH] powerpc: Per process DSCR

2010-11-17 Thread Kumar Gala

On Nov 16, 2010, at 6:31 PM, Anton Blanchard wrote:

> In order to add per process control of the DSCR, the following patch emulates
> read/write of the DSCR from userspace and saves and restores it on context
> switch. We add emulated stats to track how many times we do this.
> 
> While writing this patch a few things were apparent:
> 
> - How will this work with the global DSCR setting in
>  /sys/devices/system/cpu/cpu*/dscr? Do we deprecate it? One thought is
>  to add a new sysfs entry (eg dscr_enabled), which tells us to
>  override any per process settings. Another way would be to overload
>  the dscr sysfs entry and make -1 mean the system wide dscr setting is
>  disabled.
> 
> - Do we need an out of band method of changing the DSCR so another
>  process or could modify it? We may want to modify the DSCR of a long
>  running process, eg a HPC job.
> 
> - To improve context switch speed we should probably check the old and
>  new DSCR values are identical and avoid the SPR write.
> 
> Signed-off-by: Anton Blanchard 

We don't have no stinking DSCR ;).  Would like this to be #ifdef 
CONFIG_PPC_BOOK3S_64.

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


Re: [PATCH 1/5] scripts: dtc: Merge in changes from the dtc repository

2010-11-17 Thread Jon Loeliger
> 
> Hmm, is there some documentation for how to use this feature?
> Specifically I have a custom board with multiple discrete computers on
> it which are only very slightly physically different from each other
> and I'd like to be able to avoid maintaining 2 nearly-exact copies of
> the same DTS file.

Heh.

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


Re: [PATCH 1/5] scripts: dtc: Merge in changes from the dtc repository

2010-11-17 Thread Jon Loeliger
> On Tue, Nov 16, 2010 at 12:49:51PM -0800, John Bonesio wrote:
> > Pull in recent changes from the main dtc repository. These changes primarily
> > allow multiple device trees to be declared which are merged by dtc. This
> > feature allows us to include a basic dts file and then provide more 
> > informatio
> n
> > for the specific system through the merging functionality.
> > 
> > Signed-off-by: John Bonesio 
> 
> Jon & David, I'll need your input on whether or not this is the best
> way to handle updating the dtc copy in the kernel tree.
> 
> g.

Grant,

Yeah, I wondered too. :-)  David added it and updated
in the kernel last round, so he may have some good notion
of what would be best there.

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


[PATCH 3/3] powerpc: pcm030/032: add pagesize to dts

2010-11-17 Thread Wolfram Sang
Signed-off-by: Wolfram Sang 
---
 arch/powerpc/boot/dts/pcm030.dts |1 +
 arch/powerpc/boot/dts/pcm032.dts |3 ++-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/boot/dts/pcm030.dts b/arch/powerpc/boot/dts/pcm030.dts
index 8a4ec30..e7c36bc 100644
--- a/arch/powerpc/boot/dts/pcm030.dts
+++ b/arch/powerpc/boot/dts/pcm030.dts
@@ -259,6 +259,7 @@
eep...@52 {
compatible = "catalyst,24c32";
reg = <0x52>;
+   pagesize = <32>;
};
};
 
diff --git a/arch/powerpc/boot/dts/pcm032.dts b/arch/powerpc/boot/dts/pcm032.dts
index 85d857a..e175e2c 100644
--- a/arch/powerpc/boot/dts/pcm032.dts
+++ b/arch/powerpc/boot/dts/pcm032.dts
@@ -257,8 +257,9 @@
reg = <0x51>;
};
eep...@52 {
-   compatible = "at24,24c32";
+   compatible = "catalyst,24c32";
reg = <0x52>;
+   pagesize = <32>;
};
};
 
-- 
1.7.2.3

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


[PATCH 2/3] misc: at24: add more sanity checks for parameters

2010-11-17 Thread Wolfram Sang
Side-effects happen when passing 0 to either io_limit or page_size. Give
an error in case of this misconfiguration.

Signed-off-by: Wolfram Sang 
---
 drivers/misc/eeprom/at24.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 3a53efc..ab1ad41 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -517,6 +517,11 @@ static int at24_probe(struct i2c_client *client, const 
struct i2c_device_id *id)
if (!is_power_of_2(chip.byte_len))
dev_warn(&client->dev,
"byte_len looks suspicious (no power of 2)!\n");
+   if (!chip.page_size) {
+   dev_err(&client->dev, "page_size must not be 0!\n");
+   err = -EINVAL;
+   goto err_out;
+   }
if (!is_power_of_2(chip.page_size))
dev_warn(&client->dev,
"page_size looks suspicious (no power of 2)!\n");
@@ -681,6 +686,11 @@ static struct i2c_driver at24_driver = {
 
 static int __init at24_init(void)
 {
+   if (!io_limit) {
+   pr_err("at24: io_limit must not be 0!\n");
+   return -EINVAL;
+   }
+
io_limit = rounddown_pow_of_two(io_limit);
return i2c_add_driver(&at24_driver);
 }
-- 
1.7.2.3

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


[PATCH 1/3] misc: at24: parse OF-data, too

2010-11-17 Thread Wolfram Sang
Information about the pagesize and read-only-status may also come from
the devicetree. Parse this data, too, and act accordingly. While we are
here, change the initialization printout a bit. write_max is useful to
know to detect performance bottlenecks, the rest is superfluous.

Signed-off-by: Wolfram Sang 
---

Changes since last version:

- use __be32 instead of u32

 Documentation/powerpc/dts-bindings/eeprom.txt |   28 +
 drivers/misc/eeprom/at24.c|   33 
 2 files changed, 55 insertions(+), 6 deletions(-)
 create mode 100644 Documentation/powerpc/dts-bindings/eeprom.txt

diff --git a/Documentation/powerpc/dts-bindings/eeprom.txt 
b/Documentation/powerpc/dts-bindings/eeprom.txt
new file mode 100644
index 000..4342c10
--- /dev/null
+++ b/Documentation/powerpc/dts-bindings/eeprom.txt
@@ -0,0 +1,28 @@
+EEPROMs (I2C)
+
+Required properties:
+
+  - compatible : should be ","
+If there is no specific driver for , a generic
+driver based on  is selected. Possible types are:
+24c00, 24c01, 24c02, 24c04, 24c08, 24c16, 24c32, 24c64,
+24c128, 24c256, 24c512, 24c1024, spd
+
+  - reg : the I2C address of the EEPROM
+
+Optional properties:
+
+  - pagesize : the length of the pagesize for writing. Please consult the
+   manual of your device, that value varies a lot. A wrong value
+  may result in data loss! If not specified, a safety value of
+  '1' is used which will be very slow.
+
+  - read-only: this parameterless property disables writes to the eeprom
+
+Example:
+
+eep...@52 {
+   compatible = "atmel,24c32";
+   reg = <0x52>;
+   pagesize = <32>;
+};
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 559b0b3..3a53efc 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -457,6 +458,27 @@ static ssize_t at24_macc_write(struct memory_accessor 
*macc, const char *buf,
 
 /*-*/
 
+#ifdef CONFIG_OF
+static void at24_get_ofdata(struct i2c_client *client,
+   struct at24_platform_data *chip)
+{
+   const __be32 *val;
+   struct device_node *node = client->dev.of_node;
+
+   if (node) {
+   if (of_get_property(node, "read-only", NULL))
+   chip->flags |= AT24_FLAG_READONLY;
+   val = of_get_property(node, "pagesize", NULL);
+   if (val)
+   chip->page_size = be32_to_cpup(val);
+   }
+}
+#else
+static void at24_get_ofdata(struct i2c_client *client,
+   struct at24_platform_data *chip)
+{ }
+#endif /* CONFIG_OF */
+
 static int at24_probe(struct i2c_client *client, const struct i2c_device_id 
*id)
 {
struct at24_platform_data chip;
@@ -485,6 +507,9 @@ static int at24_probe(struct i2c_client *client, const 
struct i2c_device_id *id)
 */
chip.page_size = 1;
 
+   /* update chipdata if OF is present */
+   at24_get_ofdata(client, &chip);
+
chip.setup = NULL;
chip.context = NULL;
}
@@ -597,19 +622,15 @@ static int at24_probe(struct i2c_client *client, const 
struct i2c_device_id *id)
 
i2c_set_clientdata(client, at24);
 
-   dev_info(&client->dev, "%zu byte %s EEPROM %s\n",
+   dev_info(&client->dev, "%zu byte %s EEPROM, %s, %u bytes/write\n",
at24->bin.size, client->name,
-   writable ? "(writable)" : "(read-only)");
+   writable ? "writable" : "read-only", at24->write_max);
if (use_smbus == I2C_SMBUS_WORD_DATA ||
use_smbus == I2C_SMBUS_BYTE_DATA) {
dev_notice(&client->dev, "Falling back to %s reads, "
   "performance will suffer\n", use_smbus ==
   I2C_SMBUS_WORD_DATA ? "word" : "byte");
}
-   dev_dbg(&client->dev,
-   "page_size %d, num_addresses %d, write_max %d, use_smbus %d\n",
-   chip.page_size, num_addresses,
-   at24->write_max, use_smbus);
 
/* export data to kernel code */
if (chip.setup)
-- 
1.7.2.3

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


[PATCH V2 0/3] at24: parse OF-data

2010-11-17 Thread Wolfram Sang
Here is the second round of this series:

* 1/3 now uses __be32 instead of u32.
* 2/3 is new and adds some more sanity checks
* 3/3 is unchanged

Grant, I hope you can pick 2/3 as well. Should make things easier and it is
just a misc-driver (which I maintain) :)

Wolfram Sang (3):
  misc: at24: parse OF-data, too
  misc: at24: add more sanity checks for parameters
  powerpc: pcm030/032: add pagesize to dts

 Documentation/powerpc/dts-bindings/eeprom.txt |   28 
 arch/powerpc/boot/dts/pcm030.dts  |1 +
 arch/powerpc/boot/dts/pcm032.dts  |3 +-
 drivers/misc/eeprom/at24.c|   43 +---
 4 files changed, 68 insertions(+), 7 deletions(-)
 create mode 100644 Documentation/powerpc/dts-bindings/eeprom.txt

-- 
1.7.2.3

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


Re: [PATCH 1/5] of: Add support for linking device tree blobs into vmlinux

2010-11-17 Thread Sam Ravnborg
On Tue, Nov 16, 2010 at 02:41:36PM -0800, dirk.brande...@gmail.com wrote:
> From: Dirk Brandewie 
> 
> This patch adds support for linking device tree blobs into
> vmlinux. Modifies asm-generic/vmlinux.lds.h to add linking
> .dtb.init.rodata sections into the .init.data section of the vmlinux
> image. Modifies scripts/Makefile.lib to add a kbuild command to
> compile DTS files to device tree blobs and a rule to create objects to
> wrap the blobs for linking.
> 
> The DTB's are placed on 32 byte boundries to allow parsing the blob
> with driver/of/fdt.c during early boot without having to copy the blob
> to get the structure alignment GCC expects.
> 
> A DTB is linked in by adding the DTB object to the list of objects to
> be linked into vmlinux in the archtecture specific Makefile using
>obj-y += foo.dtb.o
> 
> Signed-off-by: Dirk Brandewie 
> ---
>  include/asm-generic/vmlinux.lds.h |   19 +--
>  scripts/Makefile.lib  |   20 
>  2 files changed, 37 insertions(+), 2 deletions(-)

When you touch Makefiles in scripts/* it is always a good idea to cc:
kbuild maintainer on the patch - I have added Michal.

Support functionality in Makefile.lib is documented in
Documentation/kbuild/* - please add documentation there.

> 
> diff --git a/include/asm-generic/vmlinux.lds.h 
> b/include/asm-generic/vmlinux.lds.h
> index bd69d79..ea671e7 100644
> --- a/include/asm-generic/vmlinux.lds.h
> +++ b/include/asm-generic/vmlinux.lds.h
> @@ -67,7 +67,14 @@
>   * Align to a 32 byte boundary equal to the
>   * alignment gcc 4.5 uses for a struct
>   */
> -#define STRUCT_ALIGN() . = ALIGN(32)
> +#define STRUCT_ALIGNMENT 32
> +#define STRUCT_ALIGN() . = ALIGN(STRUCT_ALIGNMENT)
> +
> +/* Device tree blobs linked into the kernel need to have proper
> + * structure alignment to be parsed by the flat device tree library
> + * used in early boot
> +*/
> +#define DTB_ALIGNMENT STRUCT_ALIGNMENT

It has been discussed in another thread some time ago to move
to a general 32 byte alignment for everything in vmlinux.lds.h
So there is not much need for the specific DTB alignment.

> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 4c72c11..29db062 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -200,6 +200,26 @@ quiet_cmd_gzip = GZIP$@
>  cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -f -9 > $@) || \
>   (rm -f $@ ; false)
>  
> +# DTC
> +#  
> ---
> +$(obj)/%.dtb.S: $(obj)/%.dtb FORCE
> + @echo '#include ' > $@
> + @echo '.section .dtb.init.rodata,"a"' >> $@
> + @echo '.balign DTB_ALIGNMENT' >> $@
> + @echo '.global __dtb_$(*F)_begin' >> $@
> + @echo '__dtb_$(*F)_begin:' >> $@
> + @echo '.incbin "$<" ' >> $@
> + @echo '__dtb_$(*F)_end:' >> $@
> + @echo '.global __dtb_$(*F)_end' >> $@
> + @echo '.balign DTB_ALIGNMENT' >> $@


This will be noisy during build. Please use proper macors to supress output.


> +
> +DTC = $(objtree)/scripts/dtc/dtc
> +
> +quiet_cmd_dtc = DTC  $@
Please avoid tabs in the output - all other uses spaces. (There is a tab 
between DTC and $@)

> +  cmd_dtc = $(DTC) -O dtb -o $(obj)/$*.dtb -b 0 $(DTS_FLAGS) 
> $(src)/dts/$*.dts

Looks strange. How about:
  cmd_dtc = $(DTC) -O dtb -o $@ -b 0 $(DTS_FLAGS) $<

Then you avoid the hardcoded path in the rule too.


> +
> +$(obj)/%.dtb: $(src)/dts/%.dts
> + $(call if_changed,dtc)

This snippet belong in the file that uses this.
This is how we do for other rules like bzip etc.

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


RE: [PATCH 4/4][v2] rapidio, powerpc/85xx: Error interrupt handler for sRIO.

2010-11-17 Thread Xie Shaohui-B21989
 

 

 

Best Regards, 
Shaohui Xie 

 

From: Bounine, Alexandre [mailto:alexandre.boun...@idt.com] 
Sent: Tuesday, November 16, 2010 10:01 PM
To: Xie Shaohui-B21989; a...@linux-foundation.org
Cc: linux-ker...@vger.kernel.org; linuxppc-dev@lists.ozlabs.org; Li
Yang-R58472; Gala Kumar-B11780; Zang Roy-R61911
Subject: RE: [PATCH 4/4][v2] rapidio, powerpc/85xx: Error interrupt
handler for sRIO.

 

> From: Shaohui Xie [mailto:b21...@freescale.com]
>
> The sRIO controller reports errors to the core with one signal, it
uses
> register EPWISR to provides the core quick access to where the error
occurred.
> The EPWISR indicates that there are 4 interrupts sources, port1,
port2, message
> unit and port write receive, but the sRIO driver does not support
port2
> for now, still the handler takes care of port2.
> Currently the handler only clear error status without any recovery.
>

Do these dual-RIO controllers have only one port-write interrupt?
(sorry, user manuals are not available for download from FSL).  

[Xie Shaohui] Yes, only one inbound port-write interrupt.



> @@ -1082,14 +1142,24 @@ fsl_rio_port_write_handler(int irq, void
*dev_instance)
>   ipwsr = in_be32(&priv->msg_regs->pwsr);
>
>   epwisr = in_be32(priv->regs_win + RIO_EPWISR);
> - if (epwisr & 0x8000) {
> + if (epwisr & EPWISR_ERR_PINT1) {
>   tmp = in_be32(priv->regs_win + RIO_LTLEDCSR);
>   pr_info("RIO_LTLEDCSR = 0x%x\n", tmp);
> - out_be32(priv->regs_win + RIO_LTLEDCSR, 0);
> + port_error_handler(port, 0);
> + }
> +
> + if (epwisr & EPWISR_ERR_PINT2) {
> + pr_info("RIO: port2 error\n");
> + port_error_handler(port, 1);
> + }
> +
> + if (epwisr & EPWISR_ERR_MU) {
> + pr_info("RIO: message unit error\n");
> + msg_unit_error_handler(port);
>   }
>
> - if (!(epwisr & 0x0001))
> - return IRQ_HANDLED;
> + if (!(epwisr & EPWISR_ERR_PW))
> + return IRQ_NONE;
>
>  #ifdef DEBUG_PW
>   pr_debug("PW Int->IPWMR: 0x%08x IPWSR: 0x%08x (", ipwmr, ipwsr);

This part is out of sync with mainline code tree (37-rc1). Probably it
should be updated to make it easier to apply your patch. Besides that,
works as expected on my RIO setup.




[Xie Shaohui] Ok, I'll updated my patch to latest kernel.

BTW: Something wrong with my outlook, seems it cannot prefix  each line
of original message to some specific emails, but not all, Sorry if this
cause you trouble to read my reply. 

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