* [PATCH 2/3] [POWERPC] lockdep stacktrace support
From: Benjamin Herrenschmidt @ 2008-04-17 4:35 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
From: Christoph Hellwig <hch@lst.de>
I recently tried to work on lockdep for powerpc. I have preliminary
version of the stacktrace code, but had to give up on trace irqflags
support because I'm not that knowledgeable on lowlevel ppc details.
Maybe someone more faimilar with the code wants to give it another try?
My stacktrace code is below:
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/Kconfig | 4 +++
arch/powerpc/kernel/Makefile | 1
arch/powerpc/kernel/stacktrace.c | 47 +++++++++++++++++++++++++++++++++++++++
3 files changed, 52 insertions(+)
--- linux-work.orig/arch/powerpc/Kconfig 2008-04-17 13:17:06.000000000 +1000
+++ linux-work/arch/powerpc/Kconfig 2008-04-17 13:24:30.000000000 +1000
@@ -49,6 +49,10 @@ config IRQ_PER_CPU
bool
default y
+config STACKTRACE_SUPPORT
+ bool
+ default y
+
config RWSEM_GENERIC_SPINLOCK
bool
Index: linux-work/arch/powerpc/kernel/Makefile
===================================================================
--- linux-work.orig/arch/powerpc/kernel/Makefile 2008-04-17 13:17:06.000000000 +1000
+++ linux-work/arch/powerpc/kernel/Makefile 2008-04-17 13:24:31.000000000 +1000
@@ -67,6 +67,7 @@ obj-$(CONFIG_BOOTX_TEXT) += btext.o
obj-$(CONFIG_SMP) += smp.o
obj-$(CONFIG_KPROBES) += kprobes.o
obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o
+obj-$(CONFIG_STACKTRACE) += stacktrace.o
pci64-$(CONFIG_PPC64) += pci_dn.o isa-bridge.o
obj-$(CONFIG_PCI) += pci_$(CONFIG_WORD_SIZE).o $(pci64-y) \
Index: linux-work/arch/powerpc/kernel/stacktrace.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ linux-work/arch/powerpc/kernel/stacktrace.c 2008-04-17 13:24:47.000000000 +1000
@@ -0,0 +1,47 @@
+/*
+ * Stack trace utility
+ *
+ * Copyright 2008 Christoph Hellwig, IBM Corp.
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#include <linux/sched.h>
+#include <linux/stacktrace.h>
+#include <asm/ptrace.h>
+#include <asm/asm-offsets.h>
+
+/*
+ * Save stack-backtrace addresses into a stack_trace buffer.
+ */
+void save_stack_trace(struct stack_trace *trace)
+{
+ unsigned long sp;
+
+ asm("mr %0,1" : "=r" (sp));
+
+ for (;;) {
+ unsigned long *stack = (unsigned long *) sp;
+ unsigned long newsp, ip;
+
+ if (!validate_sp(sp, current, STACK_FRAME_OVERHEAD))
+ return;
+
+ newsp = stack[0];
+ ip = stack[STACK_FRAME_LR_SAVE];
+
+ if (!trace->skip)
+ trace->entries[trace->nr_entries++] = ip;
+ else
+ trace->skip--;
+
+ if (trace->nr_entries >= trace->max_entries)
+ return;
+
+ sp = newsp;
+ }
+}
^ permalink raw reply
* [PATCH 1/3] [POWERPC] Move stackframe definitions to common header
From: Benjamin Herrenschmidt @ 2008-04-17 4:34 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
This patch moves various definitions used all over the place
to parse stack frames to ptrace.h so only one definition is
needed.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/kernel/entry_64.S | 3 ++-
arch/powerpc/kernel/head_32.S | 5 +++--
arch/powerpc/kernel/process.c | 28 +++++++---------------------
arch/powerpc/xmon/xmon.c | 13 +++++--------
include/asm-powerpc/ptrace.h | 9 +++++++++
5 files changed, 26 insertions(+), 32 deletions(-)
--- linux-work.orig/arch/powerpc/kernel/process.c 2008-04-17 13:21:33.000000000 +1000
+++ linux-work/arch/powerpc/kernel/process.c 2008-04-17 13:22:29.000000000 +1000
@@ -919,20 +919,6 @@ int validate_sp(unsigned long sp, struct
return valid_irq_stack(sp, p, nbytes);
}
-#ifdef CONFIG_PPC64
-#define MIN_STACK_FRAME 112 /* same as STACK_FRAME_OVERHEAD, in fact */
-#define FRAME_LR_SAVE 2
-#define INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD + 288)
-#define REGS_MARKER 0x7265677368657265ul
-#define FRAME_MARKER 12
-#else
-#define MIN_STACK_FRAME 16
-#define FRAME_LR_SAVE 1
-#define INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)
-#define REGS_MARKER 0x72656773ul
-#define FRAME_MARKER 2
-#endif
-
EXPORT_SYMBOL(validate_sp);
unsigned long get_wchan(struct task_struct *p)
@@ -944,15 +930,15 @@ unsigned long get_wchan(struct task_stru
return 0;
sp = p->thread.ksp;
- if (!validate_sp(sp, p, MIN_STACK_FRAME))
+ if (!validate_sp(sp, p, STACK_FRAME_OVERHEAD))
return 0;
do {
sp = *(unsigned long *)sp;
- if (!validate_sp(sp, p, MIN_STACK_FRAME))
+ if (!validate_sp(sp, p, STACK_FRAME_OVERHEAD))
return 0;
if (count > 0) {
- ip = ((unsigned long *)sp)[FRAME_LR_SAVE];
+ ip = ((unsigned long *)sp)[STACK_FRAME_LR_SAVE];
if (!in_sched_functions(ip))
return ip;
}
@@ -981,12 +967,12 @@ void show_stack(struct task_struct *tsk,
lr = 0;
printk("Call Trace:\n");
do {
- if (!validate_sp(sp, tsk, MIN_STACK_FRAME))
+ if (!validate_sp(sp, tsk, STACK_FRAME_OVERHEAD))
return;
stack = (unsigned long *) sp;
newsp = stack[0];
- ip = stack[FRAME_LR_SAVE];
+ ip = stack[STACK_FRAME_LR_SAVE];
if (!firstframe || ip != lr) {
printk("["REG"] ["REG"] ", sp, ip);
print_symbol("%s", ip);
@@ -1000,8 +986,8 @@ void show_stack(struct task_struct *tsk,
* See if this is an exception frame.
* We look for the "regshere" marker in the current frame.
*/
- if (validate_sp(sp, tsk, INT_FRAME_SIZE)
- && stack[FRAME_MARKER] == REGS_MARKER) {
+ if (validate_sp(sp, tsk, STACK_INT_FRAME_SIZE)
+ && stack[STACK_FRAME_MARKER] == STACK_FRAME_REGS_MARKER) {
struct pt_regs *regs = (struct pt_regs *)
(sp + STACK_FRAME_OVERHEAD);
printk("--- Exception: %lx", regs->trap);
Index: linux-work/arch/powerpc/xmon/xmon.c
===================================================================
--- linux-work.orig/arch/powerpc/xmon/xmon.c 2008-04-17 13:23:21.000000000 +1000
+++ linux-work/arch/powerpc/xmon/xmon.c 2008-04-17 13:30:13.000000000 +1000
@@ -1244,15 +1244,12 @@ static void get_function_bounds(unsigned
static int xmon_depth_to_print = 64;
-#ifdef CONFIG_PPC64
-#define LRSAVE_OFFSET 0x10
-#define REG_FRAME_MARKER 0x7265677368657265ul /* "regshere" */
-#define MARKER_OFFSET 0x60
+#define LRSAVE_OFFSET (STACK_FRAME_LR_SAVE * sizeof(unsigned long))
+#define MARKER_OFFSET (STACK_FRAME_MARKER * sizeof(unsigned long))
+
+#ifdef __powerpc64__
#define REGS_OFFSET 0x70
#else
-#define LRSAVE_OFFSET 4
-#define REG_FRAME_MARKER 0x72656773
-#define MARKER_OFFSET 8
#define REGS_OFFSET 16
#endif
@@ -1318,7 +1315,7 @@ static void xmon_show_stack(unsigned lon
/* Look for "regshere" marker to see if this is
an exception frame. */
if (mread(sp + MARKER_OFFSET, &marker, sizeof(unsigned long))
- && marker == REG_FRAME_MARKER) {
+ && marker == STACK_FRAME_REGS_MARKER) {
if (mread(sp + REGS_OFFSET, ®s, sizeof(regs))
!= sizeof(regs)) {
printf("Couldn't read registers at %lx\n",
Index: linux-work/include/asm-powerpc/ptrace.h
===================================================================
--- linux-work.orig/include/asm-powerpc/ptrace.h 2008-04-17 13:19:04.000000000 +1000
+++ linux-work/include/asm-powerpc/ptrace.h 2008-04-17 13:33:06.000000000 +1000
@@ -58,6 +58,11 @@ struct pt_regs {
#define __ARCH_WANT_COMPAT_SYS_PTRACE
#define STACK_FRAME_OVERHEAD 112 /* size of minimum stack frame */
+#define STACK_FRAME_LR_SAVE 2 /* Location of LR in stack frame */
+#define STACK_FRAME_REGS_MARKER ASM_CONST(0x7265677368657265)
+#define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + \
+ STACK_FRAME_OVERHEAD + 288)
+#define STACK_FRAME_MARKER 12
/* Size of dummy stack frame allocated when calling signal handler. */
#define __SIGNAL_FRAMESIZE 128
@@ -66,6 +71,10 @@ struct pt_regs {
#else /* __powerpc64__ */
#define STACK_FRAME_OVERHEAD 16 /* size of minimum stack frame */
+#define STACK_FRAME_LR_SAVE 1 /* Location of LR in stack frame */
+#define STACK_FRAME_REGS_MARKER ASM_CONST(0x72656773)
+#define STACK_INT_FRAME_SIZE (sizeof(struct pt_regs) + STACK_FRAME_OVERHEAD)
+#define STACK_FRAME_MARKER 2
/* Size of stack frame allocated when calling signal handler. */
#define __SIGNAL_FRAMESIZE 64
Index: linux-work/arch/powerpc/kernel/entry_64.S
===================================================================
--- linux-work.orig/arch/powerpc/kernel/entry_64.S 2008-04-17 13:49:20.000000000 +1000
+++ linux-work/arch/powerpc/kernel/entry_64.S 2008-04-17 14:09:42.000000000 +1000
@@ -29,6 +29,7 @@
#include <asm/cputable.h>
#include <asm/firmware.h>
#include <asm/bug.h>
+#include <asm/ptrace.h>
/*
* System calls.
@@ -39,7 +40,7 @@
/* This value is used to mark exception frames on the stack. */
exception_marker:
- .tc ID_72656773_68657265[TC],0x7265677368657265
+ .tc ID_EXC_MARKER[TC],STACK_FRAME_REGS_MARKER
.section ".text"
.align 7
Index: linux-work/arch/powerpc/kernel/head_32.S
===================================================================
--- linux-work.orig/arch/powerpc/kernel/head_32.S 2008-04-17 14:10:02.000000000 +1000
+++ linux-work/arch/powerpc/kernel/head_32.S 2008-04-17 14:23:22.000000000 +1000
@@ -30,6 +30,7 @@
#include <asm/thread_info.h>
#include <asm/ppc_asm.h>
#include <asm/asm-offsets.h>
+#include <asm/ptrace.h>
/* 601 only have IBAT; cr0.eq is set on 601 when using this macro */
#define LOAD_BAT(n, reg, RA, RB) \
@@ -268,8 +269,8 @@ __secondary_hold_acknowledge:
li r10,MSR_KERNEL & ~(MSR_IR|MSR_DR); /* can take exceptions */ \
MTMSRD(r10); /* (except for mach check in rtas) */ \
stw r0,GPR0(r11); \
- lis r10,0x7265; /* put exception frame marker */ \
- addi r10,r10,0x6773; \
+ lis r10,STACK_FRAME_REGS_MARKER@ha; /* exception frame marker */ \
+ addi r10,r10,STACK_FRAME_REGS_MARKER@l; \
stw r10,8(r11); \
SAVE_4GPRS(3, r11); \
SAVE_2GPRS(7, r11)
^ permalink raw reply
* Re: [GIT PULL] Please pull spufs master branch
From: Jeremy Kerr @ 2008-04-17 3:57 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras, cbe-oss-dev
In-Reply-To: <1208403837.286854.46120525208.0.gpush@pingu>
> A few bugfixes for spufs.
... just in case you're not omnipotent, here's the git URL:
git://git.kernel.org/pub/scm/linux/kernel/git/jk/spufs.git master
Cheers,
Jeremy
^ permalink raw reply
* [GIT PULL] Please pull spufs master branch
From: Jeremy Kerr @ 2008-04-17 3:43 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev, cbe-oss-dev
Hi Paul,
A few bugfixes for spufs.
Cheers,
Jeremy
--- 4 commits:
[POWERPC] spufs: add newline to signal{1,2}_type files
Jeremy Kerr <jk@ozlabs.org>
arch/powerpc/platforms/cell/spufs/file.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[POWERPC] spufs: reacquire LS pointer in spu_process_callback
Jeremy Kerr <jk@ozlabs.org>
arch/powerpc/platforms/cell/spufs/run.c | 4 ++++
1 file changed, 4 insertions(+)
[POWERPC] spufs: save MFC command channel before purging MFC queue
Jeremy Kerr <jk@ozlabs.org>
arch/powerpc/platforms/cell/spufs/switch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[POWERPC] spufs: fix incorrect file descriptors in SPU coredump note names
Gerhard Stenzel <stenzel@de.ibm.com>
arch/powerpc/platforms/cell/spufs/coredump.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
^ permalink raw reply
* RE: [PATCH v2][POWERPC] qe_lib and ucc_geth: switch to the cpm_muram implementation
From: Li Yang @ 2008-04-17 3:38 UTC (permalink / raw)
To: avorontsov, Kumar Gala
Cc: Wood Scott, linuxppc-dev, Jeff Garzik, Tabi Timur, netdev
In-Reply-To: <20080416182214.GA20056@polina.dev.rtsoft.ru>
> -----Original Message-----
> From: linuxppc-dev-bounces+leoli=3Dfreescale.com@ozlabs.org=20
> [mailto:linuxppc-dev-bounces+leoli=3Dfreescale.com@ozlabs.org]=20
> On Behalf Of Anton Vorontsov
> Sent: Thursday, April 17, 2008 2:22 AM
> To: Kumar Gala
> Cc: Wood Scott; linuxppc-dev@ozlabs.org; Jeff Garzik; Tabi=20
> Timur; netdev@vger.kernel.org
> Subject: [PATCH v2][POWERPC] qe_lib and ucc_geth: switch to=20
> the cpm_muramimplementation
>=20
> This is very trivial patch. We're transitioning to the=20
> cpm_muram_* calls. That's it.
Hi Anoton,
It is a good thing to unify the CPM dpram operation and QE muram =
operation. But I'm having concerns about the naming as CPM is an =
obsolete block. Can we change to use the new name QE instead?
- Leo
^ permalink raw reply
* Re: [PATCH 2/11] cell: generalize io-workarounds code
From: Benjamin Herrenschmidt @ 2008-04-17 1:48 UTC (permalink / raw)
To: Ishizaki Kou; +Cc: linuxppc-dev, paulus
In-Reply-To: <1208330282.6958.264.camel@pasglop>
So I found a few issues with your patch. Below is a "Fixup" patch that
fixes the QS20 cell blades for me, but I would like you to apply that
directly to your series and post a new version of it so that there
is no breakage of QS20 during bisection.
Note that I believe Celleb may have some problems too. See below.
So the base issue was that on QS20, there was no struct device, thus the
dma mapping would crash.
I fixed that by changing the Cell blades code to create
of_platform_device's for the PCI busses like it does on QS21 or later,
and removed the initial call to the rtas PCI bus creation.
Now, that doesn't fix it all....
One thing I noticed in celleb_pci is that you initialize the workarounds
for the bus after it's been created at device_initcall time. This is not
good because at that time, drivers can already have been loaded &
initialized, quirks have been run, etc... so it's actually too late to
initialize the workarounds. They need to be initialized earlier.
I've tried something around the lines of initializing them from within
the PHB setup callback, which happens before the PCI probe. You should
be able to use the same approach for Celleb I suppose. Seems to work for
me so far...
In addition, your patch would have called io_workaround_init() on QS21
which doesn't need them (no Spider), thus slowing down access on
machines that don't need the workarounds.
My new code should hopefully only call this when needed. I made the call
safe to call multiple time to avoid having to test in the caller.
Another thing I noticed is that you removed the workaround to disable
PCI prefetch. Is there a reason for that ? As far as I understand,
prefetch is broken and can cause errors ranging from data corruption to
iommu exceptions if the iommu is enabled. Maybe you want to make it
depend on the revision of Spider in case your SCC has that fixed ?
My patch doesn't change that but we might need to...
So here is the patch. Please integrate my changes in your patch serie
and re-post it (minus the two patches that Paulus already accepted).
Cheers,
Ben.
Index: linux-work/arch/powerpc/kernel/of_platform.c
===================================================================
--- linux-work.orig/arch/powerpc/kernel/of_platform.c 2008-04-17 11:31:32.000000000 +1000
+++ linux-work/arch/powerpc/kernel/of_platform.c 2008-04-17 11:31:53.000000000 +1000
@@ -275,6 +275,8 @@ static int __devinit of_pci_phb_probe(st
/* Scan the bus */
scan_phb(phb);
+ if (phb->bus == NULL)
+ return -ENXIO;
/* Claim resources. This might need some rework as well depending
* wether we are doing probe-only or not, like assigning unassigned
Index: linux-work/arch/powerpc/platforms/cell/spider-pci.c
===================================================================
--- linux-work.orig/arch/powerpc/platforms/cell/spider-pci.c 2008-04-17 11:31:53.000000000 +1000
+++ linux-work/arch/powerpc/platforms/cell/spider-pci.c 2008-04-17 11:44:12.000000000 +1000
@@ -25,17 +25,12 @@
#include <asm/ppc-pci.h>
#include <asm/pci-bridge.h>
#include <asm/io.h>
+#include <asm/of_platform.h>
#include "io-workarounds.h"
#undef SPIDER_PCI_DISABLE_PREFETCH
-#define SPIDER_PCI_REG_BASE 0xd000
-#define SPIDER_PCI_REG_SIZE 0x1000
-#define SPIDER_PCI_VCI_CNTL_STAT 0x0110
-#define SPIDER_PCI_DUMMY_READ 0x0810
-#define SPIDER_PCI_DUMMY_READ_BASE 0x0814
-
struct spiderpci_iowa_private {
void __iomem *regs;
};
@@ -187,31 +182,3 @@ struct ppc_pci_io spiderpci_ops = {
.memcpy_fromio = spiderpci_memcpy_fromio,
};
-/* We must setup the IOMMU before spider_io_workaround_init() is called. */
-static int __init spider_pci_workaround_init(void)
-{
- struct pci_controller *phb;
-
- /* Find spider bridges. We assume they have been all probed
- * in setup_arch(). If that was to change, we would need to
- * update this code to cope with dynamically added busses
- */
- list_for_each_entry(phb, &hose_list, list_node) {
- struct device_node *np = phb->dn;
- const char *model = of_get_property(np, "model", NULL);
-
- /* If no model property or name isn't exactly "pci", skip */
- if (model == NULL || strcmp(np->name, "pci"))
- continue;
- /* If model is not "Spider", skip */
- if (strcmp(model, "Spider"))
- continue;
- iowa_register_bus(phb, &spiderpci_ops, &spiderpci_iowa_init,
- (void *)SPIDER_PCI_REG_BASE);
- }
-
- io_workaround_init();
-
- return 0;
-}
-machine_arch_initcall_sync(cell, spider_pci_workaround_init);
Index: linux-work/arch/powerpc/platforms/cell/io-workarounds.c
===================================================================
--- linux-work.orig/arch/powerpc/platforms/cell/io-workarounds.c 2008-04-17 11:31:53.000000000 +1000
+++ linux-work/arch/powerpc/platforms/cell/io-workarounds.c 2008-04-17 11:31:53.000000000 +1000
@@ -183,6 +183,11 @@ void __init iowa_register_bus(struct pci
/* enable IO workaround */
void __init io_workaround_init(void)
{
+ static int io_workaround_inited;
+
+ if (io_workaround_inited)
+ return;
ppc_pci_io = iowa_pci_io;
ppc_md.ioremap = iowa_ioremap;
+ io_workaround_inited = 1;
}
Index: linux-work/arch/powerpc/platforms/cell/io-workarounds.h
===================================================================
--- linux-work.orig/arch/powerpc/platforms/cell/io-workarounds.h 2008-04-17 11:31:53.000000000 +1000
+++ linux-work/arch/powerpc/platforms/cell/io-workarounds.h 2008-04-17 11:31:53.000000000 +1000
@@ -40,6 +40,12 @@ struct iowa_bus *iowa_mem_find_bus(const
struct iowa_bus *iowa_pio_find_bus(unsigned long);
extern struct ppc_pci_io spiderpci_ops;
-int spiderpci_iowa_init(struct iowa_bus *, void *);
+extern int spiderpci_iowa_init(struct iowa_bus *, void *);
+
+#define SPIDER_PCI_REG_BASE 0xd000
+#define SPIDER_PCI_REG_SIZE 0x1000
+#define SPIDER_PCI_VCI_CNTL_STAT 0x0110
+#define SPIDER_PCI_DUMMY_READ 0x0810
+#define SPIDER_PCI_DUMMY_READ_BASE 0x0814
#endif /* _IO_WORKAROUNDS_H */
Index: linux-work/arch/powerpc/platforms/cell/setup.c
===================================================================
--- linux-work.orig/arch/powerpc/platforms/cell/setup.c 2008-04-17 11:31:33.000000000 +1000
+++ linux-work/arch/powerpc/platforms/cell/setup.c 2008-04-17 11:31:53.000000000 +1000
@@ -57,6 +57,7 @@
#include "interrupt.h"
#include "pervasive.h"
#include "ras.h"
+#include "io-workarounds.h"
#ifdef DEBUG
#define DBG(fmt...) udbg_printf(fmt)
@@ -117,13 +118,50 @@ static void cell_fixup_pcie_rootcomplex(
}
DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, cell_fixup_pcie_rootcomplex);
+static int __devinit cell_setup_phb(struct pci_controller *phb)
+{
+ const char *model;
+ struct device_node *np;
+
+ int rc = rtas_setup_phb(phb);
+ if (rc)
+ return rc;
+
+ np = phb->dn;
+ model = of_get_property(np, "model", NULL);
+ if (model == NULL || strcmp(np->name, "pci"))
+ return 0;
+
+ /* Setup workarounds for spider */
+ if (strcmp(model, "Spider"))
+ return 0;
+
+ iowa_register_bus(phb, &spiderpci_ops, &spiderpci_iowa_init,
+ (void *)SPIDER_PCI_REG_BASE);
+ io_workaround_init();
+
+ return 0;
+}
+
static int __init cell_publish_devices(void)
{
+ struct device_node *root = of_find_node_by_path("/");
+ struct device_node *np;
int node;
/* Publish OF platform devices for southbridge IOs */
of_platform_bus_probe(NULL, NULL, NULL);
+ /* On spider based blades, we need to manually create the OF
+ * platform devices for the PCI host bridges
+ */
+ for_each_child_of_node(root, np) {
+ if (np->type == NULL || (strcmp(np->type, "pci") != 0 &&
+ strcmp(np->type, "pciex") != 0))
+ continue;
+ of_platform_device_create(np, NULL, NULL);
+ }
+
/* There is no device for the MIC memory controller, thus we create
* a platform device for it to attach the EDAC driver to.
*/
@@ -132,6 +170,7 @@ static int __init cell_publish_devices(v
continue;
platform_device_register_simple("cbe-mic", node, NULL, 0);
}
+
return 0;
}
machine_subsys_initcall(cell, cell_publish_devices);
@@ -213,7 +252,7 @@ static void __init cell_setup_arch(void)
/* Find and initialize PCI host bridges */
init_pci_config_tokens();
- find_and_init_phbs();
+
cbe_pervasive_init();
#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
@@ -249,7 +288,7 @@ define_machine(cell) {
.calibrate_decr = generic_calibrate_decr,
.progress = cell_progress,
.init_IRQ = cell_init_irq,
- .pci_setup_phb = rtas_setup_phb,
+ .pci_setup_phb = cell_setup_phb,
#ifdef CONFIG_KEXEC
.machine_kexec = default_machine_kexec,
.machine_kexec_prepare = default_machine_kexec_prepare,
^ permalink raw reply
* a question about serial driver on MPC8313
From: 旭 罗 @ 2008-04-17 1:11 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 436 bytes --]
hello all:
In my system, the CPU is MPC8313. When i debug it, i can't find the serial driver for the MPC8313 soc, i can only find the file 8250.c which is in the /drivers/serial directory. I am not sure the source code is the serial driver for the MPC8313. Could any one can help me to solve this problem or some one can give me some advises.
thanks
best wishs
---------------------------------
雅虎邮箱,您的终生邮箱!
[-- Attachment #2: Type: text/html, Size: 491 bytes --]
^ permalink raw reply
* Re: [PATCH] natsemi: fix MMIO for PPC 44x platforms
From: Jeff Garzik @ 2008-04-17 0:53 UTC (permalink / raw)
To: Sergei Shtylyov; +Cc: netdev, linuxppc-dev
In-Reply-To: <200804122058.31075.sshtylyov@ru.mvista.com>
Sergei Shtylyov wrote:
> The driver stores the PCI resource address into 'unsigned long' variable before
> calling ioremap() on it. This warrants a kernel oops when the registers are
> accessed on PPC 44x platforms which (being 32-bit) have PCI memory space mapped
> beyond 4 GB.
>
> The arch/ppc/ kernel has a fixup in ioremap() that creates an illusion of the
> PCI memory resources are mapped below 4 GB, but arch/powerpc/ code got rid of
> this trick, having instead CONFIG_RESOURCES_64BIT enabled.
>
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
>
> ---
> Reposting the patch with the typecast, log, and summary corrected.
> This is the same issue as the one that has been recently addressed by commits
> 3c34ac36ac1084e571ef9b6fb1d6a5b10ccc1fd0 (e1000: Fix for 32 bits platforms with
> 64 bits resources) and c976816b6e901341ec3c4653147316c15549a1c4 (siimage: fix
> kernel oops on PPC 44x). The patch has only been compile tested though...
>
> drivers/net/natsemi.c | 10 ++++++----
> 1 files changed, 6 insertions(+), 4 deletions(-)
applied
^ permalink raw reply
* MV64x60 device bus
From: Remi Machet @ 2008-04-17 0:36 UTC (permalink / raw)
To: linuxppc-dev
Hi,
I am working on a board with an MV64460 and this controller has what its
data sheet call a device controller (ie a generic asynchronous bus to
connect NOR flashes and other similar devices). On this board a NOR
flash is connected to it and I would like to get it to be recognized by
the Open Firmware MTD map driver.
The problem is that this driver expects the flash to be registered as an
of_platform device, I could do that in the board file itself but I think
it would be more useful to add some generic code for all MV64360 based
boards:
My idea would be to add to the MV64360 initialization code the
registration of an of_platform bus if a node of type 'devicectrl' is
found (inside the mv64360 node); this node would contain all the devices
attached to the device bus and the of_platform sub-system would take
care of creating the proper of_platform devices.
Does anyone have comments or a better idea ?
Thanks,
Remi
^ permalink raw reply
* More patches pushed to powerpc.git master and powerpc-next branches (second try)
From: Paul Mackerras @ 2008-04-17 0:36 UTC (permalink / raw)
To: linuxppc-dev
The following commits are now in the master and powerpc-next branches
in the powerpc.git tree. This includes commits pulled from Josh
Boyer's and Olof Johansson's trees.
There was a short period recently (approx. 12 hours ago) when
powerpc.git had a string of commits including two that broke the
ibm-newemac driver on some platforms. If you pulled during that
period then you'll need to do a git pull -f when you pull this lot.
Paul.
Adrian Bunk (1):
[POWERPC] Add MODULE_LICENSE to powerpc/sysdev/rtc_cmos_setup.c
Anton Vorontsov (2):
[POWERPC] OF helpers for the GPIO API
[POWERPC] Implement support for the GPIO LIB API
Benjamin Herrenschmidt (3):
[POWERPC] Initialize paca->current earlier
[POWERPC] Fixup softirq preempt count
[POWERPC] properly declare onstack completion in iseries veth
David Woodhouse (1):
[POWERPC] Efika: Really, don't pretend to be CHRP
Ishizaki Kou (2):
[POWERPC] celleb: Coding style cleanup
[POWERPC] hvcbeat: Fix buffer manipulation
Jerone Young (1):
[POWERPC] 4xx: Add idle wait support for 44x platforms
Jochen Friedrich (1):
[POWERPC] i2c: OF helpers for the i2c API
Josh Boyer (2):
[POWERPC] 4xx: Reorganize 4xx defconfigs
[POWERPC] 4xx: Add ppc40x_defconfig
Kumar Gala (13):
[POWERPC] Remove Kconfig option BOOT_LOAD
[POWERPC] Provide access to arch/powerpc include path on ppc64
[POWERPC] Remove and replace uses of PPC_MEMSTART with memstart_addr
[POWERPC] Introduce lowmem_end_addr to distinguish from total_lowmem
[POWERPC] 85xx: Cleanup TLB initialization
[POWERPC] Use lowmem_end_addr to limit lmb allocations on ppc32
[POWERPC] Rename __initial_memory_limit to __initial_memory_limit_addr
[POWERPC] Clean up some linker and symbol usage
[POWERPC] Move phys_addr_t definition into asm/types.h
[POWERPC] Update linker script to properly set physical addresses
[POWERPC] bootwrapper: Use physical address in PHDR for uImage
[POWERPC] Cleanup pgtable-ppc32.h
[POWERPC] Remove unused machine call outs
Manish Ahuja (1):
[POWERPC] pseries/phyp dump: Reserve a variable amount of space at boot
Michael Ellerman (2):
[POWERPC] Move prototype for find_udbg_vterm() into a header file
[POWERPC] Always add preferred consoles in platforms/pseries/lpar.c
Nate Case (1):
pasemi_mac: Netpoll support
Olof Johansson (2):
pasemi_mac: Jumbo frame bugfixes
[POWERPC] pasemi: Minor iommu cleanup
Valentine Barshak (1):
[POWERPC] kexec: MPIC ack interrupts at mpic_teardown_this_cpu()
^ permalink raw reply
* Re: XLlTemac soft lockup BUG
From: John Bonesio @ 2008-04-16 22:59 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: khollan
In-Reply-To: <16734685.post@talk.nabble.com>
Hi Kevin,
Does xlltemac_main.c have
#define MARVELL_88E1111_PHY
in it? If not, try setting that.
It's odd that sometimes it works. Does your system meet timing?
We've found that when the PHY is being poked, it can take a while before the PHY settles down and starts working. If the code tries to start using the PHY too soon, then the PHY never seems to get to a good state. So, you might experiement with different values in the udelay() call in _XLlTemac_SetOperatingSpeed().
If you really think there's something wrong in the fifo code, you can enable debug (#define DEBUG) in the following files:
drivers/xilinx_common/xdebug.h
drivers/xilinx_common/xstreamer.h
Perhaps that will shed some light on the problem.
- John
On Wednesday 16 April 2008 15:08, khollan wrote:
>
> Hugo Villeneuve-3 wrote:
> >
> > Hi,
> > we had a similar error message, which was caused by us selecting the wrong
> > PHY type in the kernel configuration menu (latest linux-2.6-xlnx-git
> > tree). In fact, we had to modify the lltemac driver to support our PHY
> > (BCM5466). Once we did that, the error message went away.
> >
> > Hugo V.
> >
> I tried out all 3 configurations and it didn't seem to help. We are using
> the Marvell Phy on our prototype. The weird thing is it seems to work
> perfectly every once in awhile, but not very often. I seem to have tracked
> the problem to the FifoRecvHandler tasklet function in xlltemac_main.c it
> gets stuck in this while loop:
> while (XLlFifo_RxOccupancy(&lp->Fifo) != 0) {
> the XLlFifo_RxOccupancy always reads the same value.
> Any ideas?
>
> Thanks
> Kevin
> --
> View this message in context: http://www.nabble.com/XLlTemac--soft-lockup-BUG-tp16711066p16734685.html
> Sent from the linuxppc-embedded mailing list archive at Nabble.com.
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
>
^ permalink raw reply
* RE: XLlTemac soft lockup BUG
From: khollan @ 2008-04-16 22:08 UTC (permalink / raw)
To: linuxppc-embedded
In-Reply-To: <42848A5C5A0D1E47B026E644DD49B08E025AA69F@mail>
Hugo Villeneuve-3 wrote:
>
> Hi,
> we had a similar error message, which was caused by us selecting the wrong
> PHY type in the kernel configuration menu (latest linux-2.6-xlnx-git
> tree). In fact, we had to modify the lltemac driver to support our PHY
> (BCM5466). Once we did that, the error message went away.
>
> Hugo V.
>
I tried out all 3 configurations and it didn't seem to help. We are using
the Marvell Phy on our prototype. The weird thing is it seems to work
perfectly every once in awhile, but not very often. I seem to have tracked
the problem to the FifoRecvHandler tasklet function in xlltemac_main.c it
gets stuck in this while loop:
while (XLlFifo_RxOccupancy(&lp->Fifo) != 0) {
the XLlFifo_RxOccupancy always reads the same value.
Any ideas?
Thanks
Kevin
--
View this message in context: http://www.nabble.com/XLlTemac--soft-lockup-BUG-tp16711066p16734685.html
Sent from the linuxppc-embedded mailing list archive at Nabble.com.
^ permalink raw reply
* Re: [PATCH 6/8] [POWERPC] sysdev,qe_lib: implement FSL GTM support
From: Scott Wood @ 2008-04-16 21:58 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linuxppc-dev
In-Reply-To: <20080416210042.GA3579@zarina>
On Thu, Apr 17, 2008 at 01:00:42AM +0400, Anton Vorontsov wrote:
> On Wed, Apr 16, 2008 at 01:44:42PM -0500, Scott Wood wrote:
> > A maximal timeout of ~65 ms is a little low... For use as a wakeup from
> > sleep mode, I'd like to be able to request timeouts as large as the
> > hardware allows.
>
> That is about precision. You just need to implement gtm_reset_stimer()
> is you want precision with a seconds, this will run a timer at 1 Hz.
Enh. I'm not crazy about having to call separately named functions,
rather than have the timer code set the reference clock to the highest
precision that has the needed range.
-Scott
^ permalink raw reply
* RE: lseek() on entries in /proc/device-tree returns EINVAL
From: Joakim Tjernlund @ 2008-04-16 21:40 UTC (permalink / raw)
To: 'Timur Tabi'; +Cc: linuxppc-dev
In-Reply-To: <48066C94.5040707@freescale.com>
> -----Original Message-----
> From: Timur Tabi [mailto:timur@freescale.com]
> Sent: den 16 april 2008 23:16
> To: Joakim Tjernlund
> Cc: linuxppc-dev@ozlabs.org
> Subject: Re: lseek() on entries in /proc/device-tree returns EINVAL
>
> Joakim Tjernlund wrote:
>
> > Good, bb should probably do the same. I just hope Al will allow a grace period and restore
> > the old behavior so bb can catch up.
>
> I don't see any reason why lseek() should not always work. Besides, a "grace
> period" would mean that on some future kernel, older busybox will not work.
Sure, but better a grace period than none at all. Currently no bb
works but with a grace period you can at least tell users to upgrade bb
when the grace period is over.
Jocke
^ permalink raw reply
* Re: lseek() on entries in /proc/device-tree returns EINVAL
From: Timur Tabi @ 2008-04-16 21:16 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: linuxppc-dev
In-Reply-To: <062801c8a006$a7715710$f6540530$@Tjernlund@transmode.se>
Joakim Tjernlund wrote:
> Good, bb should probably do the same. I just hope Al will allow a grace period and restore
> the old behavior so bb can catch up.
I don't see any reason why lseek() should not always work. Besides, a "grace
period" would mean that on some future kernel, older busybox will not work.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* RE: lseek() on entries in /proc/device-tree returns EINVAL
From: Joakim Tjernlund @ 2008-04-16 21:13 UTC (permalink / raw)
To: 'Timur Tabi'; +Cc: linuxppc-dev
In-Reply-To: <48066B54.30309@freescale.com>
> -----Original Message-----
> From: Timur Tabi [mailto:timur@freescale.com]
> Sent: den 16 april 2008 23:11
> To: Joakim Tjernlund
> Cc: linuxppc-dev@ozlabs.org
> Subject: Re: lseek() on entries in /proc/device-tree returns EINVAL
>
> Joakim Tjernlund wrote:
>
> > Yeah, just reported a similar problem at LKML. busybox start-stop-daemon broke
> > between 2.6.23 and current tree. The change was intentional but the borkage
> > was not. Al Viro has been informed, lets see what comes of it.
>
> I've changed my code to use fstat() instead, which is better for my purposes anyway.
Good, bb should probably do the same. I just hope Al will allow a grace period and restore
the old behavior so bb can catch up.
Jocke
^ permalink raw reply
* Re: lseek() on entries in /proc/device-tree returns EINVAL
From: Timur Tabi @ 2008-04-16 21:10 UTC (permalink / raw)
To: Joakim Tjernlund; +Cc: linuxppc-dev
In-Reply-To: <062501c8a006$27b17b90$771472b0$@Tjernlund@transmode.se>
Joakim Tjernlund wrote:
> Yeah, just reported a similar problem at LKML. busybox start-stop-daemon broke
> between 2.6.23 and current tree. The change was intentional but the borkage
> was not. Al Viro has been informed, lets see what comes of it.
I've changed my code to use fstat() instead, which is better for my purposes anyway.
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* RE: lseek() on entries in /proc/device-tree returns EINVAL
From: Joakim Tjernlund @ 2008-04-16 21:09 UTC (permalink / raw)
To: 'Timur Tabi', linuxppc-dev
In-Reply-To: <48066857.4030109@freescale.com>
> -----Original Message-----
> From: linuxppc-dev-bounces+joakim.tjernlund=transmode.se@ozlabs.org [mailto:linuxppc-dev-
> bounces+joakim.tjernlund=transmode.se@ozlabs.org] On Behalf Of Timur Tabi
> Sent: den 16 april 2008 22:58
> To: linuxppc-dev@ozlabs.org
> Subject: lseek() on entries in /proc/device-tree returns EINVAL
>
> I'm writing a utility that parses the device tree in /proc/device-tree, and in
> order to read a property into memory, I have to first find out how large it is.
> So I have the following code:
>
> off_t off;
> int f;
>
> f = open(filename, O_RDONLY);
> if (f == -1) {
> perror(__func__);
> return NULL;
> }
>
> off = lseek(f, 0, SEEK_END);
> if (off == -1) {
> perror(__func__);
> goto fail;
> }
>
> The lseek() call returns -1, and errno is set to EINVAL. According to the man
> page, this means:
>
> EINVAL The whence argument is not a proper value, or the resulting
> file offset would be negative for a regular file, block special
> file, or directory.
>
> Is there a limitation for the implementation of /proc/device-tree that prevents
> lseek() from working? If so, how do I determine the size of a property?
Yeah, just reported a similar problem at LKML. busybox start-stop-daemon broke
between 2.6.23 and current tree. The change was intentional but the borkage
was not. Al Viro has been informed, lets see what comes of it.
Jocke
^ permalink raw reply
* Re: lseek() on entries in /proc/device-tree returns EINVAL
From: Scott Wood @ 2008-04-16 21:01 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev
In-Reply-To: <48066857.4030109@freescale.com>
On Wed, Apr 16, 2008 at 03:57:59PM -0500, Timur Tabi wrote:
> Is there a limitation for the implementation of /proc/device-tree that prevents
> lseek() from working? If so, how do I determine the size of a property?
Try fstat().
-Scott
^ permalink raw reply
* Re: [PATCH 6/8] [POWERPC] sysdev,qe_lib: implement FSL GTM support
From: Anton Vorontsov @ 2008-04-16 21:00 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev
In-Reply-To: <20080416184442.GA12179@ld0162-tx32.am.freescale.net>
On Wed, Apr 16, 2008 at 01:44:42PM -0500, Scott Wood wrote:
> On Wed, Apr 16, 2008 at 10:39:04PM +0400, Anton Vorontsov wrote:
> > +/**
> > + * gtm_reset_utimer16 - reset 16 bits timer
> > + * @tmr: pointer to the gtm_timer structure obtained from gtm_get_timer
> > + * @usec: timer interval in microseconds
> > + * @free_run: free run flag
> > + *
> > + * This function (re)sets GTM timer so it counts up to the interval value and
> > + * fires the interrupt when the value is reached. If free_run flag was set,
> > + * timer will also reset itself upon reference value, otherwise it continues to
> > + * increment.
> > + */
> > +int gtm_reset_utimer16(struct gtm_timer *tmr, u16 usec, bool free_run)
>
> A maximal timeout of ~65 ms is a little low... For use as a wakeup from
> sleep mode, I'd like to be able to request timeouts as large as the
> hardware allows.
That is about precision. You just need to implement gtm_reset_stimer()
is you want precision with a seconds, this will run a timer at 1 Hz.
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
^ permalink raw reply
* lseek() on entries in /proc/device-tree returns EINVAL
From: Timur Tabi @ 2008-04-16 20:57 UTC (permalink / raw)
To: linuxppc-dev
I'm writing a utility that parses the device tree in /proc/device-tree, and in
order to read a property into memory, I have to first find out how large it is.
So I have the following code:
off_t off;
int f;
f = open(filename, O_RDONLY);
if (f == -1) {
perror(__func__);
return NULL;
}
off = lseek(f, 0, SEEK_END);
if (off == -1) {
perror(__func__);
goto fail;
}
The lseek() call returns -1, and errno is set to EINVAL. According to the man
page, this means:
EINVAL The whence argument is not a proper value, or the resulting
file offset would be negative for a regular file, block special
file, or directory.
Is there a limitation for the implementation of /proc/device-tree that prevents
lseek() from working? If so, how do I determine the size of a property?
--
Timur Tabi
Linux kernel developer at Freescale
^ permalink raw reply
* Re: [PATCH] pseries: phyp dump: Variable size reserve space.
From: Linas Vepstas @ 2008-04-16 20:22 UTC (permalink / raw)
To: Manish Ahuja; +Cc: mahuja, linuxppc-dev, paulus
In-Reply-To: <47FAB221.7050406@austin.ibm.com>
On 07/04/2008, Manish Ahuja <ahuja@austin.ibm.com> wrote:
> A small proposed change in the amount of reserve space we allocate during boot.
> Currently we reserve 256MB only.
> The proposed change does one of the 3 things.
>
> A. It checks to see if there is cmdline variable set and if found sets the
> value to it. OR
> B. It computes 5% of total ram and rounds it down to multiples of 256MB. AND
> C. Compares the rounded down value and returns larger of two values, the new
> computed value or 256MB.
>
> Again this is for large systems who have excess memory.
>
[...]
> early_param("phyp_dump", early_phyp_dump_enabled);
I'm pretty sure you will want to document this boot param in the documentation,
as well as add a few words about why it might be interesting to users (i.e.
that its for large systems...)
--linas
^ permalink raw reply
* Re: [PATCH] pseries: phyp dump: Variable size reserve space.
From: Joel Schopp @ 2008-04-16 19:42 UTC (permalink / raw)
To: Manish Ahuja; +Cc: mahuja, linuxppc-dev, linasvepstas, Paul Mackerras
In-Reply-To: <4805328E.2050709@austin.ibm.com>
> The aim is to have more flex space for the kernel on machines with more resources. Although the dump will be collected pretty fast and the memory released really early on allowing the machine to have the full memory available, this alleviates any issues that can be caused by having way too little memory on very very large systems during those few minutes.
>
> -Manish
I think this would be an issue for distro kernels that have minimum
requirements for memory above 256MB. It seems like a reasonable attempt
to have good defaults. The user can always override it with boot args.
I'm not sure where the exact numbers should be but the general statement
that larger memory systems should have more memory to boot with seems
like a good one.
^ permalink raw reply
* USB on MPC8641D
From: John Marc @ 2008-04-16 18:48 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 969 bytes --]
Hi Everybody,
I find this forum very much useful for the people who are working with powerpc's , and i am the one of them.Actually one more thing that make me to join this forum is my interest towards the Freescale MPC8641d board :-). I found that Freescale recently uploaded the linux BSP for MPC8641D board. One of the thing new in this BSP is USB driver.
At Ozlabs I found various patches for MPC8641D board,Most of then are regarding the PCI Express fixes, Some patches of ULI1575 chip, but my main concern is USB.
Can amyone help me out to find , what are the changes that freescale does for the USB drivers. I tried to search a lot for USB patch, but my bad luck , i don't find anything.
It would be a great help if anyone help me out to find what are the changes that freescale does for USB driver.
Thanks
John
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
[-- Attachment #2: Type: text/html, Size: 1205 bytes --]
^ permalink raw reply
* Re: [PATCH 6/8] [POWERPC] sysdev,qe_lib: implement FSL GTM support
From: Scott Wood @ 2008-04-16 18:44 UTC (permalink / raw)
To: Anton Vorontsov; +Cc: linuxppc-dev
In-Reply-To: <20080416183904.GA23512@polina.dev.rtsoft.ru>
On Wed, Apr 16, 2008 at 10:39:04PM +0400, Anton Vorontsov wrote:
> +/**
> + * gtm_reset_utimer16 - reset 16 bits timer
> + * @tmr: pointer to the gtm_timer structure obtained from gtm_get_timer
> + * @usec: timer interval in microseconds
> + * @free_run: free run flag
> + *
> + * This function (re)sets GTM timer so it counts up to the interval value and
> + * fires the interrupt when the value is reached. If free_run flag was set,
> + * timer will also reset itself upon reference value, otherwise it continues to
> + * increment.
> + */
> +int gtm_reset_utimer16(struct gtm_timer *tmr, u16 usec, bool free_run)
A maximal timeout of ~65 ms is a little low... For use as a wakeup from
sleep mode, I'd like to be able to request timeouts as large as the
hardware allows.
-Scott
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox