* [PATCH 09/11] Convert from DEBUG() to pr_debug() in platforms/pseries/rtasd.c
From: Michael Ellerman @ 2008-04-18 7:54 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <fbb91d0892c720d6f28501e1830028c78eb6664f.1208505275.git.michael@ellerman.id.au>
Add "rtasd" to some messages to make it clear where they're coming from.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/platforms/pseries/rtasd.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/rtasd.c b/arch/powerpc/platforms/pseries/rtasd.c
index e3078ce..befadd4 100644
--- a/arch/powerpc/platforms/pseries/rtasd.c
+++ b/arch/powerpc/platforms/pseries/rtasd.c
@@ -29,11 +29,6 @@
#include <asm/atomic.h>
#include <asm/machdep.h>
-#if 0
-#define DEBUG(A...) printk(KERN_ERR A)
-#else
-#define DEBUG(A...)
-#endif
static DEFINE_SPINLOCK(rtasd_log_lock);
@@ -198,7 +193,7 @@ void pSeries_log_error(char *buf, unsigned int err_type, int fatal)
unsigned long s;
int len = 0;
- DEBUG("logging event\n");
+ pr_debug("rtasd: logging event\n");
if (buf == NULL)
return;
@@ -409,7 +404,8 @@ static int rtasd(void *unused)
daemonize("rtasd");
printk(KERN_DEBUG "RTAS daemon started\n");
- DEBUG("will sleep for %d milliseconds\n", (30000/rtas_event_scan_rate));
+ pr_debug("rtasd: will sleep for %d milliseconds\n",
+ (30000 / rtas_event_scan_rate));
/* See if we have any error stored in NVRAM */
memset(logdata, 0, rtas_error_log_max);
@@ -428,9 +424,9 @@ static int rtasd(void *unused)
do_event_scan_all_cpus(1000);
if (surveillance_timeout != -1) {
- DEBUG("enabling surveillance\n");
+ pr_debug("rtasd: enabling surveillance\n");
enable_surveillance(surveillance_timeout);
- DEBUG("surveillance enabled\n");
+ pr_debug("rtasd: surveillance enabled\n");
}
/* Delay should be at least one second since some
--
1.5.5
^ permalink raw reply related
* [PATCH 08/11] Convert from DBG() to pr_debug() in platforms/pseries/lpar.c
From: Michael Ellerman @ 2008-04-18 7:54 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <fbb91d0892c720d6f28501e1830028c78eb6664f.1208505275.git.michael@ellerman.id.au>
While we're there, fix some printf specifier mismatches, and add a
newline to one printk.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/platforms/pseries/lpar.c | 34 ++++++++++++++------------------
1 files changed, 15 insertions(+), 19 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 450c237..0ce8c85 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -19,7 +19,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#undef DEBUG_LOW
+/* Enables debugging of low-level hash table routines - careful! */
+#undef DEBUG
#include <linux/kernel.h>
#include <linux/dma-mapping.h>
@@ -42,11 +43,6 @@
#include "plpar_wrappers.h"
#include "pseries.h"
-#ifdef DEBUG_LOW
-#define DBG_LOW(fmt...) do { udbg_printf(fmt); } while(0)
-#else
-#define DBG_LOW(fmt...) do { } while(0)
-#endif
/* in hvCall.S */
EXPORT_SYMBOL(plpar_hcall);
@@ -291,15 +287,15 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
unsigned long hpte_v, hpte_r;
if (!(vflags & HPTE_V_BOLTED))
- DBG_LOW("hpte_insert(group=%lx, va=%016lx, pa=%016lx, "
- "rflags=%lx, vflags=%lx, psize=%d)\n",
- hpte_group, va, pa, rflags, vflags, psize);
+ pr_debug("hpte_insert(group=%lx, va=%016lx, pa=%016lx, "
+ "rflags=%lx, vflags=%lx, psize=%d)\n",
+ hpte_group, va, pa, rflags, vflags, psize);
hpte_v = hpte_encode_v(va, psize, ssize) | vflags | HPTE_V_VALID;
hpte_r = hpte_encode_r(pa, psize) | rflags;
if (!(vflags & HPTE_V_BOLTED))
- DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
+ pr_debug(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);
/* Now fill in the actual HPTE */
/* Set CEC cookie to 0 */
@@ -316,7 +312,7 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
lpar_rc = plpar_pte_enter(flags, hpte_group, hpte_v, hpte_r, &slot);
if (unlikely(lpar_rc == H_PTEG_FULL)) {
if (!(vflags & HPTE_V_BOLTED))
- DBG_LOW(" full\n");
+ pr_debug(" full\n");
return -1;
}
@@ -327,11 +323,11 @@ static long pSeries_lpar_hpte_insert(unsigned long hpte_group,
*/
if (unlikely(lpar_rc != H_SUCCESS)) {
if (!(vflags & HPTE_V_BOLTED))
- DBG_LOW(" lpar err %d\n", lpar_rc);
+ pr_debug(" lpar err %lu\n", lpar_rc);
return -2;
}
if (!(vflags & HPTE_V_BOLTED))
- DBG_LOW(" -> slot: %d\n", slot & 7);
+ pr_debug(" -> slot: %lu\n", slot & 7);
/* Because of iSeries, we have to pass down the secondary
* bucket bit here as well
@@ -423,17 +419,17 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot,
want_v = hpte_encode_avpn(va, psize, ssize);
- DBG_LOW(" update: avpnv=%016lx, hash=%016lx, f=%x, psize: %d ... ",
- want_v, slot, flags, psize);
+ pr_debug(" update: avpnv=%016lx, hash=%016lx, f=%lx, psize: %d ...",
+ want_v, slot, flags, psize);
lpar_rc = plpar_pte_protect(flags, slot, want_v);
if (lpar_rc == H_NOT_FOUND) {
- DBG_LOW("not found !\n");
+ pr_debug("not found !\n");
return -1;
}
- DBG_LOW("ok\n");
+ pr_debug("ok\n");
BUG_ON(lpar_rc != H_SUCCESS);
@@ -508,8 +504,8 @@ static void pSeries_lpar_hpte_invalidate(unsigned long slot, unsigned long va,
unsigned long lpar_rc;
unsigned long dummy1, dummy2;
- DBG_LOW(" inval : slot=%lx, va=%016lx, psize: %d, local: %d",
- slot, va, psize, local);
+ pr_debug(" inval : slot=%lx, va=%016lx, psize: %d, local: %d\n",
+ slot, va, psize, local);
want_v = hpte_encode_avpn(va, psize, ssize);
lpar_rc = plpar_pte_remove(H_AVPN, slot, want_v, &dummy1, &dummy2);
--
1.5.5
^ permalink raw reply related
* [PATCH 07/11] Convert from DBG() to pr_debug() in platforms/pseries/iommu.c
From: Michael Ellerman @ 2008-04-18 7:54 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <fbb91d0892c720d6f28501e1830028c78eb6664f.1208505275.git.michael@ellerman.id.au>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/platforms/pseries/iommu.c | 39 +++++++++++++++----------------
1 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index a65c763..176f1f3 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -47,7 +47,6 @@
#include "plpar_wrappers.h"
-#define DBG(fmt...)
static void tce_build_pSeries(struct iommu_table *tbl, long index,
long npages, unsigned long uaddr,
@@ -322,7 +321,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
dn = pci_bus_to_OF_node(bus);
- DBG("pci_dma_bus_setup_pSeries: setting up bus %s\n", dn->full_name);
+ pr_debug("pci_dma_bus_setup_pSeries: setting up bus %s\n", dn->full_name);
if (bus->self) {
/* This is not a root bus, any setup will be done for the
@@ -347,7 +346,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
for (children = 0, tmp = dn->child; tmp; tmp = tmp->sibling)
children++;
- DBG("Children: %d\n", children);
+ pr_debug("Children: %d\n", children);
/* Calculate amount of DMA window per slot. Each window must be
* a power of two (due to pci_alloc_consistent requirements).
@@ -361,8 +360,8 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
while (pci->phb->dma_window_size * children > 0x80000000ul)
pci->phb->dma_window_size >>= 1;
- DBG("No ISA/IDE, window size is 0x%lx\n",
- pci->phb->dma_window_size);
+ pr_debug("No ISA/IDE, window size is 0x%lx\n",
+ pci->phb->dma_window_size);
pci->phb->dma_window_base_cur = 0;
return;
@@ -387,8 +386,7 @@ static void pci_dma_bus_setup_pSeries(struct pci_bus *bus)
while (pci->phb->dma_window_size * children > 0x70000000ul)
pci->phb->dma_window_size >>= 1;
- DBG("ISA/IDE, window size is 0x%lx\n", pci->phb->dma_window_size);
-
+ pr_debug("ISA/IDE, window size is 0x%lx\n", pci->phb->dma_window_size);
}
@@ -401,7 +399,8 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
dn = pci_bus_to_OF_node(bus);
- DBG("pci_dma_bus_setup_pSeriesLP: setting up bus %s\n", dn->full_name);
+ pr_debug("pci_dma_bus_setup_pSeriesLP: setting up bus %s\n",
+ dn->full_name);
/* Find nearest ibm,dma-window, walking up the device tree */
for (pdn = dn; pdn != NULL; pdn = pdn->parent) {
@@ -411,14 +410,14 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
}
if (dma_window == NULL) {
- DBG(" no ibm,dma-window property !\n");
+ pr_debug(" no ibm,dma-window property !\n");
return;
}
ppci = PCI_DN(pdn);
- DBG(" parent is %s, iommu_table: 0x%p\n",
- pdn->full_name, ppci->iommu_table);
+ pr_debug(" parent is %s, iommu_table: 0x%p\n",
+ pdn->full_name, ppci->iommu_table);
if (!ppci->iommu_table) {
tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
@@ -426,7 +425,7 @@ static void pci_dma_bus_setup_pSeriesLP(struct pci_bus *bus)
iommu_table_setparms_lpar(ppci->phb, pdn, tbl, dma_window,
bus->number);
ppci->iommu_table = iommu_init_table(tbl, ppci->phb->node);
- DBG(" created table: %p\n", ppci->iommu_table);
+ pr_debug(" created table: %p\n", ppci->iommu_table);
}
if (pdn != dn)
@@ -439,7 +438,7 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev *dev)
struct device_node *dn;
struct iommu_table *tbl;
- DBG("pci_dma_dev_setup_pSeries: %s\n", pci_name(dev));
+ pr_debug("pci_dma_dev_setup_pSeries: %s\n", pci_name(dev));
dn = dev->dev.archdata.of_node;
@@ -450,7 +449,7 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev *dev)
if (!dev->bus->self) {
struct pci_controller *phb = PCI_DN(dn)->phb;
- DBG(" --> first child, no bridge. Allocating iommu table.\n");
+ pr_debug(" --> first child, no bridge. Allocating iommu table.\n");
tbl = kmalloc_node(sizeof(struct iommu_table), GFP_KERNEL,
phb->node);
iommu_table_setparms(phb, dn, tbl);
@@ -480,7 +479,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
const void *dma_window = NULL;
struct pci_dn *pci;
- DBG("pci_dma_dev_setup_pSeriesLP: %s\n", pci_name(dev));
+ pr_debug("pci_dma_dev_setup_pSeriesLP: %s\n", pci_name(dev));
/* dev setup for LPAR is a little tricky, since the device tree might
* contain the dma-window properties per-device and not neccesarily
@@ -489,7 +488,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
* already allocated.
*/
dn = pci_device_to_OF_node(dev);
- DBG(" node is %s\n", dn->full_name);
+ pr_debug(" node is %s\n", dn->full_name);
for (pdn = dn; pdn && PCI_DN(pdn) && !PCI_DN(pdn)->iommu_table;
pdn = pdn->parent) {
@@ -504,13 +503,13 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
pci_name(dev), dn? dn->full_name : "<null>");
return;
}
- DBG(" parent is %s\n", pdn->full_name);
+ pr_debug(" parent is %s\n", pdn->full_name);
/* Check for parent == NULL so we don't try to setup the empty EADS
* slots on POWER4 machines.
*/
if (dma_window == NULL || pdn->parent == NULL) {
- DBG(" no dma window for device, linking to parent\n");
+ pr_debug(" no dma window for device, linking to parent\n");
dev->dev.archdata.dma_data = PCI_DN(pdn)->iommu_table;
return;
}
@@ -522,9 +521,9 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev)
iommu_table_setparms_lpar(pci->phb, pdn, tbl, dma_window,
pci->phb->bus->number);
pci->iommu_table = iommu_init_table(tbl, pci->phb->node);
- DBG(" created table: %p\n", pci->iommu_table);
+ pr_debug(" created table: %p\n", pci->iommu_table);
} else {
- DBG(" found DMA window, table: %p\n", pci->iommu_table);
+ pr_debug(" found DMA window, table: %p\n", pci->iommu_table);
}
dev->dev.archdata.dma_data = pci->iommu_table;
--
1.5.5
^ permalink raw reply related
* [PATCH 06/11] Convert from DBG() to pr_debug() in platforms/pseries/firmware.c
From: Michael Ellerman @ 2008-04-18 7:54 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <fbb91d0892c720d6f28501e1830028c78eb6664f.1208505275.git.michael@ellerman.id.au>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/platforms/pseries/firmware.c | 9 ++-------
1 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/firmware.c b/arch/powerpc/platforms/pseries/firmware.c
index b765b7c..743d494 100644
--- a/arch/powerpc/platforms/pseries/firmware.c
+++ b/arch/powerpc/platforms/pseries/firmware.c
@@ -27,11 +27,6 @@
#include <asm/prom.h>
#include <asm/udbg.h>
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
typedef struct {
unsigned long val;
@@ -72,7 +67,7 @@ void __init fw_feature_init(const char *hypertas, unsigned long len)
const char *s;
int i;
- DBG(" -> fw_feature_init()\n");
+ pr_debug(" -> fw_feature_init()\n");
for (s = hypertas; s < hypertas + len; s += strlen(s) + 1) {
for (i = 0; i < FIRMWARE_MAX_FEATURES; i++) {
@@ -88,5 +83,5 @@ void __init fw_feature_init(const char *hypertas, unsigned long len)
}
}
- DBG(" <- fw_feature_init()\n");
+ pr_debug(" <- fw_feature_init()\n");
}
--
1.5.5
^ permalink raw reply related
* [PATCH 05/11] Convert from DBG() to pr_debug() in platforms/pseries/smp.c
From: Michael Ellerman @ 2008-04-18 7:54 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <fbb91d0892c720d6f28501e1830028c78eb6664f.1208505275.git.michael@ellerman.id.au>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/platforms/pseries/smp.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/smp.c b/arch/powerpc/platforms/pseries/smp.c
index ea4c659..e9bc2a5 100644
--- a/arch/powerpc/platforms/pseries/smp.c
+++ b/arch/powerpc/platforms/pseries/smp.c
@@ -51,12 +51,6 @@
#include "plpar_wrappers.h"
#include "pseries.h"
-#ifdef DEBUG
-#include <asm/udbg.h>
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
/*
* The primary thread of each non-boot processor is recorded here before
@@ -231,7 +225,7 @@ static void __init smp_init_pseries(void)
{
int i;
- DBG(" -> smp_init_pSeries()\n");
+ pr_debug(" -> smp_init_pSeries()\n");
/* Mark threads which are still spinning in hold loops. */
if (cpu_has_feature(CPU_FTR_SMT)) {
@@ -255,7 +249,7 @@ static void __init smp_init_pseries(void)
smp_ops->take_timebase = pSeries_take_timebase;
}
- DBG(" <- smp_init_pSeries()\n");
+ pr_debug(" <- smp_init_pSeries()\n");
}
#ifdef CONFIG_MPIC
--
1.5.5
^ permalink raw reply related
* [PATCH 04/11] Convert from DBG() to pr_debug() in platforms/pseries/setup.c
From: Michael Ellerman @ 2008-04-18 7:54 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <fbb91d0892c720d6f28501e1830028c78eb6664f.1208505275.git.michael@ellerman.id.au>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/platforms/pseries/setup.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index fccca89..5486bea 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -70,11 +70,6 @@
#include "plpar_wrappers.h"
#include "pseries.h"
-#ifdef DEBUG
-#define DBG(fmt...) udbg_printf(fmt)
-#else
-#define DBG(fmt...)
-#endif
int fwnmi_active; /* TRUE if an FWNMI handler is present */
@@ -310,7 +305,7 @@ static int pseries_set_xdabr(unsigned long dabr)
*/
static void __init pSeries_init_early(void)
{
- DBG(" -> pSeries_init_early()\n");
+ pr_debug(" -> pSeries_init_early()\n");
if (firmware_has_feature(FW_FEATURE_LPAR))
find_udbg_vterm();
@@ -322,7 +317,7 @@ static void __init pSeries_init_early(void)
iommu_init_early_pSeries();
- DBG(" <- pSeries_init_early()\n");
+ pr_debug(" <- pSeries_init_early()\n");
}
/*
@@ -367,7 +362,7 @@ static int __init pSeries_probe(void)
of_flat_dt_is_compatible(root, "IBM,CBEA"))
return 0;
- DBG("pSeries detected, looking for LPAR capability...\n");
+ pr_debug("pSeries detected, looking for LPAR capability...\n");
/* Now try to figure out if we are running on LPAR */
of_scan_flat_dt(pSeries_probe_hypertas, NULL);
@@ -377,8 +372,8 @@ static int __init pSeries_probe(void)
else
hpte_init_native();
- DBG("Machine is%s LPAR !\n",
- (powerpc_firmware_features & FW_FEATURE_LPAR) ? "" : " not");
+ pr_debug("Machine is%s LPAR !\n",
+ (powerpc_firmware_features & FW_FEATURE_LPAR) ? "" : " not");
return 1;
}
--
1.5.5
^ permalink raw reply related
* [PATCH 03/11] Register udbg console early on pseries LPAR
From: Michael Ellerman @ 2008-04-18 7:54 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <fbb91d0892c720d6f28501e1830028c78eb6664f.1208505275.git.michael@ellerman.id.au>
On pseries LPAR we can call the udbg routines, and the udbg console very
early. So mark the udbg console as safe to call early in boot, and register
the udbg console as soon as the udbg routines are hooked up.
This allows platforms/pseries code to use printk() and pr_debug() rather
than needing to call udbg_printf() directly for early debugging. This is
nice because a) it's standard, b) it goes via the printk buffer, and c)
you can get printk time stamps.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/platforms/pseries/lpar.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 9235c46..450c237 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -196,6 +196,9 @@ void __init udbg_init_debug_lpar(void)
udbg_putc = udbg_putcLP;
udbg_getc = udbg_getcLP;
udbg_getc_poll = udbg_getc_pollLP;
+
+ udbg_console_anytime();
+ register_early_udbg_console();
}
/* returns 0 if couldn't find or use /chosen/stdout as console */
--
1.5.5
^ permalink raw reply related
* [PATCH 02/11] Add udbg_console_anytime() which sets udbg console to CON_ANYTIME
From: Michael Ellerman @ 2008-04-18 7:54 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <fbb91d0892c720d6f28501e1830028c78eb6664f.1208505275.git.michael@ellerman.id.au>
In theory the udbg console should be safe to call basically at any time
after boot. It does not need any per-cpu resources or for the cpu to be
online, as long as there is a udbg_putc routine hooked up it should
work. So it should be able to be marked as CON_ANYTIME.
Verifying this will take a bit of time and testing though, so instead of
marking udbg console as CON_ANYTIME for all platforms, add a routine so
that a platform can opt-in to having udbg console called early.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/kernel/udbg.c | 5 +++++
include/asm-powerpc/udbg.h | 1 +
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index 9ac5f3a..7b1fd86 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -158,6 +158,11 @@ static struct console udbg_console = {
.index = 0,
};
+void udbg_console_anytime(void)
+{
+ udbg_console.flags |= CON_ANYTIME;
+}
+
static int early_console_initialized;
/*
diff --git a/include/asm-powerpc/udbg.h b/include/asm-powerpc/udbg.h
index 6418cee..102fa91 100644
--- a/include/asm-powerpc/udbg.h
+++ b/include/asm-powerpc/udbg.h
@@ -23,6 +23,7 @@ extern int udbg_write(const char *s, int n);
extern int udbg_read(char *buf, int buflen);
extern void register_early_udbg_console(void);
+extern void udbg_console_anytime(void);
extern void udbg_printf(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));
extern void udbg_progress(char *s, unsigned short hex);
--
1.5.5
^ permalink raw reply related
* [PATCH 01/11] Set udbg_console index to 0
From: Michael Ellerman @ 2008-04-18 7:54 UTC (permalink / raw)
To: linuxppc-dev
Because the udbg_console has CON_ENABLED set, it's possible that when we
register it with the console code the index won't be set. This leads to
slightly confusing boot messages like:
[ 0.000000] console [udbg-1] enabled
We could remove CON_ENABLED, but we don't want to do that, we always
want the udbg console to be activated, even if the user specified some
other console on the command line.
The simplest fix seems to be just to set the index to 0 by hand. There
is no issue with duplicate udbg consoles, as we guard against registering
multiple times in register_early_udbg_console().
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/kernel/udbg.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/udbg.c b/arch/powerpc/kernel/udbg.c
index 7aad620..9ac5f3a 100644
--- a/arch/powerpc/kernel/udbg.c
+++ b/arch/powerpc/kernel/udbg.c
@@ -155,7 +155,7 @@ static struct console udbg_console = {
.name = "udbg",
.write = udbg_console_write,
.flags = CON_PRINTBUFFER | CON_ENABLED | CON_BOOT,
- .index = -1,
+ .index = 0,
};
static int early_console_initialized;
--
1.5.5
^ permalink raw reply related
* [PATCH 2/2] kallsyms: move get_func_addr to <asm/processor.h>
From: Kyle McMartin @ 2008-04-18 7:48 UTC (permalink / raw)
To: linux-arch
Cc: tony.luck, linux-ia64, rusty, linux-kernel, linuxppc-dev, paulus
While debugging something on parisc a few weeks ago, I noticed
kallsyms was all busted because print_symbol was printing the
descriptor address. Since we don't use addr[0] for the function
address, and we don't want a mess of #ifdef ARCH1 #elseif ARCH2
garbage, move the definitions to <asm/processor.h>
Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
---
include/asm-ia64/processor.h | 6 ++++++
include/asm-parisc/processor.h | 8 ++++++++
include/asm-powerpc/processor.h | 8 ++++++++
include/linux/kallsyms.h | 13 ++++---------
4 files changed, 26 insertions(+), 9 deletions(-)
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index 741f7ec..9edbf0e 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -701,6 +701,12 @@ prefetchw (const void *x)
extern unsigned long boot_option_idle_override;
+#define get_func_addr(x) ({ \
+ unsigned long *addr = \
+ (unsigned long *)x; \
+ addr[0]; \
+ })
+
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_IA64_PROCESSOR_H */
diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h
index 3c9d348..a82c122 100644
--- a/include/asm-parisc/processor.h
+++ b/include/asm-parisc/processor.h
@@ -352,6 +352,14 @@ static inline int parisc_requires_coherency(void)
#endif
}
+#ifdef CONFIG_64BIT
+#define get_func_addr(x) ({ \
+ unsigned long *addr = \
+ (unsigned long *)x; \
+ addr[2]; \
+ })
+#endif /*CONFIG_64BIT*/
+
#endif /* __ASSEMBLY__ */
#endif /* __ASM_PARISC_PROCESSOR_H */
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h
index fd98ca9..604ad95 100644
--- a/include/asm-powerpc/processor.h
+++ b/include/asm-powerpc/processor.h
@@ -281,6 +281,14 @@ static inline void prefetchw(const void *x)
#define HAVE_ARCH_PICK_MMAP_LAYOUT
#endif
+#ifdef CONFIG_PPC64
+#define get_func_addr(x) ({ \
+ unsigned long *addr = \
+ (unsigned long *)x; \
+ addr[0]; \
+ })
+#endif
+
#endif /* __KERNEL__ */
#endif /* __ASSEMBLY__ */
#endif /* _ASM_POWERPC_PROCESSOR_H */
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 6734a3f..9259d1f 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -8,6 +8,8 @@
#include <linux/errno.h>
#include <linux/stddef.h>
+#include <asm/processor.h>
+
#define KSYM_NAME_LEN 128
#define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \
2*(BITS_PER_LONG*3/10) + (MODULE_NAME_LEN - 1) + 1)
@@ -84,16 +86,9 @@ static inline void __check_printsym_format(const char *fmt, ...)
{
}
-/* ia64 and ppc64 use function descriptors, which contain the real address */
-#if defined(CONFIG_IA64) || defined(CONFIG_PPC64)
-#define get_func_addr(x) ({ \
- unsigned long *addr = \
- (unsigned long *)x; \
- addr[0]; \
- })
-#else
+#ifndef get_func_addr
#define get_func_addr(x) x
-#endif
+#endif /*get_func_addr*/
#define print_fn_descriptor_symbol(fmt, addr) \
print_symbol(fmt, get_func_addr(addr))
--
1.5.4.5
^ permalink raw reply related
* ppc_4xx uImage - kernel boot problem
From: ayhan @ 2008-04-18 7:36 UTC (permalink / raw)
To: Linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]
*Hello,
I have an AMCC 405gp board on which runs u-boot. I try to boot the Linux
Kernel via network but can not. I download uImage using DHCPD/TFTP. Here is
the minicom console output:*
Type "run flash_nfs" to mount root filesystem over NFS
Hit any key to stop autoboot: 0
ENET Speed is 100 Mbps - FULL duplex connection (EMAC0)
Using ppc_4xx_eth0 device
TFTP from server 192.168.1.210; our IP address is 192.168.1.220
Filename 'uImage'.
Load address: 0x200000
Loading: #################################################################
###############
done
Bytes transferred = 1167936 (11d240 hex)
## Booting image at 00200000 ...
Image Name: Linux-2.6.25-rc7-00000-ga1ba6f0
Created: 2008-04-07 12:32:44 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 1167872 Bytes = 1.1 MB
Load Address: 00000000
Entry Point: 00000000
Verifying Checksum ... OK
Uncompressing Kernel Image ... OK
*Here the console is frozen. It's the point where u-boot ends up and the
kernel code starts. I think I have a mistake in addressing. I don't have
sufficient knowledge about uImage format and the kernel compilation process.
I followed the steps through the ELDK documantation from DENX software for
cross-compiling the linux kernel as below: *
bash$ make mrproper
bash$ make ARCH=ppc CROSS_COMPILE=ppc_4xx- walnut_defconfig
bash$ make ARCH=ppc CROSS_COMPILE=ppc_4xx- uImage
*Could anyone help me solving the boot problem?*
[-- Attachment #2: Type: text/html, Size: 4277 bytes --]
^ permalink raw reply
* [PATCH] Fix the wrong serial1 interrupt for 8610 board
From: Jason Jin @ 2008-04-19 7:07 UTC (permalink / raw)
To: linuxppc-dev; +Cc: kumar.gala, Jason Jin
Signed-off-by: Jason Jin <Jason.jin@freescale.com>
---
arch/powerpc/boot/dts/mpc8610_hpcd.dts | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc8610_hpcd.dts b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
index 16c947b..97fdb01 100644
--- a/arch/powerpc/boot/dts/mpc8610_hpcd.dts
+++ b/arch/powerpc/boot/dts/mpc8610_hpcd.dts
@@ -100,7 +100,7 @@
compatible = "ns16550";
reg = <0x4600 0x100>;
clock-frequency = <0>;
- interrupts = <28 2>;
+ interrupts = <42 2>;
interrupt-parent = <&mpic>;
};
--
1.5.4
^ permalink raw reply related
* Re: [PATCH 3/3] Use __weak macro for smp_setup_processor_id
From: Andrew Morton @ 2008-04-18 7:07 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Linux-Arch, linuxppc-dev, Paul Mackerras, linux-kernel
In-Reply-To: <20080418065728.31AF4DE255@ozlabs.org>
On Fri, 18 Apr 2008 16:56:18 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> Use the __weak macro instead of the longer __attribute__ ((weak)) form
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> --
>
> init/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-work.orig/init/main.c 2008-04-18 16:44:32.000000000 +1000
> +++ linux-work/init/main.c 2008-04-18 16:44:37.000000000 +1000
> @@ -500,7 +500,7 @@ static void __init boot_cpu_init(void)
> cpu_set(cpu, cpu_possible_map);
> }
>
> -void __init __attribute__((weak)) smp_setup_processor_id(void)
> +void __init __weak smp_setup_processor_id(void)
> {
> }
ack on all three. Please fold #3 into #1 and add both to git-powerpc.
^ permalink raw reply
* Re: [PATCH 2/3] [POWERPC] Fix kernel stack allocation alignment
From: Andrew Morton @ 2008-04-18 7:06 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Linux-Arch, linuxppc-dev, Paul Mackerras, linux-kernel
In-Reply-To: <20080418065727.5FE1CDE247@ozlabs.org>
On Fri, 18 Apr 2008 16:56:17 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> The powerpc kernel stacks need to be naturally aligned, as they
> contain the thread info at the bottom, which is obtained by
> clearing the low bits of the stack pointer.
>
> However, when using 64K pages (the stack is smaller than a page),
> we use kmalloc to allocate it, which doesn't provide that guarantee.
>
> It appeared to work so far... until one enables SLUB debugging
> which then returns unaligned pointers. Ooops...
>
> This patch fixes it by using a slab cache with enforced alignment
> for those. It replies on my previous patch that adds a
> thread_info_cache_init() callback.
>
> ...
>
> +void thread_info_cache_init(void)
> +{
> + thread_info_cache = kmem_cache_create("thread_info", THREAD_SIZE,
> + THREAD_SIZE, 0, NULL);
> + BUG_ON(thread_info_cache == NULL);
> +}
so... the "0" defeats all of SLAB_DEBUG_FREE, SLAB_RED_ZONE, SLAB_POISON
and SLAB_STORE_USER, if the comment in slab.h is to be believed.
Was that overkill?
^ permalink raw reply
* [PATCH 3/3] Use __weak macro for smp_setup_processor_id
From: Benjamin Herrenschmidt @ 2008-04-18 6:56 UTC (permalink / raw)
To: Andrew Morton, Paul Mackerras; +Cc: Linux-Arch, linuxppc-dev, linux-kernel
Use the __weak macro instead of the longer __attribute__ ((weak)) form
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
--
init/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-work.orig/init/main.c 2008-04-18 16:44:32.000000000 +1000
+++ linux-work/init/main.c 2008-04-18 16:44:37.000000000 +1000
@@ -500,7 +500,7 @@ static void __init boot_cpu_init(void)
cpu_set(cpu, cpu_possible_map);
}
-void __init __attribute__((weak)) smp_setup_processor_id(void)
+void __init __weak smp_setup_processor_id(void)
{
}
^ permalink raw reply
* [PATCH 2/3] [POWERPC] Fix kernel stack allocation alignment
From: Benjamin Herrenschmidt @ 2008-04-18 6:56 UTC (permalink / raw)
To: Andrew Morton, Paul Mackerras; +Cc: Linux-Arch, linuxppc-dev, linux-kernel
The powerpc kernel stacks need to be naturally aligned, as they
contain the thread info at the bottom, which is obtained by
clearing the low bits of the stack pointer.
However, when using 64K pages (the stack is smaller than a page),
we use kmalloc to allocate it, which doesn't provide that guarantee.
It appeared to work so far... until one enables SLUB debugging
which then returns unaligned pointers. Ooops...
This patch fixes it by using a slab cache with enforced alignment
for those. It replies on my previous patch that adds a
thread_info_cache_init() callback.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Note that m32r seems to also have this problem.
arch/powerpc/kernel/process.c | 31 +++++++++++++++++++++++++++++++
include/asm-powerpc/thread_info.h | 8 ++------
2 files changed, 33 insertions(+), 6 deletions(-)
--- linux-work.orig/arch/powerpc/kernel/process.c 2008-04-17 14:33:26.000000000 +1000
+++ linux-work/arch/powerpc/kernel/process.c 2008-04-18 13:11:23.000000000 +1000
@@ -1038,3 +1038,34 @@ void ppc64_runlatch_off(void)
}
}
#endif
+
+#if THREAD_SHIFT < PAGE_SHIFT
+
+static struct kmem_cache *thread_info_cache;
+
+struct thread_info *alloc_thread_info(struct task_struct *tsk)
+{
+ struct thread_info *ti;
+
+ ti = kmem_cache_alloc(thread_info_cache, GFP_KERNEL);
+ if (unlikely(ti == NULL))
+ return NULL;
+#ifdef CONFIG_DEBUG_STACK_USAGE
+ memset(ti, 0, THREAD_SIZE);
+#endif
+ return ti;
+}
+
+void free_thread_info(struct thread_info *ti)
+{
+ kmem_cache_free(thread_info_cache, ti);
+}
+
+void thread_info_cache_init(void)
+{
+ thread_info_cache = kmem_cache_create("thread_info", THREAD_SIZE,
+ THREAD_SIZE, 0, NULL);
+ BUG_ON(thread_info_cache == NULL);
+}
+
+#endif /* THREAD_SHIFT < PAGE_SHIFT */
Index: linux-work/include/asm-powerpc/thread_info.h
===================================================================
--- linux-work.orig/include/asm-powerpc/thread_info.h 2007-09-28 11:42:10.000000000 +1000
+++ linux-work/include/asm-powerpc/thread_info.h 2008-04-18 13:11:44.000000000 +1000
@@ -80,12 +80,8 @@ struct thread_info {
#else /* THREAD_SHIFT < PAGE_SHIFT */
-#ifdef CONFIG_DEBUG_STACK_USAGE
-#define alloc_thread_info(tsk) kzalloc(THREAD_SIZE, GFP_KERNEL)
-#else
-#define alloc_thread_info(tsk) kmalloc(THREAD_SIZE, GFP_KERNEL)
-#endif
-#define free_thread_info(ti) kfree(ti)
+extern struct thread_info *alloc_thread_info(struct task_struct *tsk);
+extern void free_thread_info(struct thread_info *ti);
#endif /* THREAD_SHIFT < PAGE_SHIFT */
^ permalink raw reply
* [PATCH 1/3] Add thread_info_cache_init() weak hook
From: Benjamin Herrenschmidt @ 2008-04-18 6:56 UTC (permalink / raw)
To: Andrew Morton, Paul Mackerras; +Cc: Linux-Arch, linuxppc-dev, linux-kernel
Some architecture need to maintain a kmem cache for thread info
structures. (next patch adds that to powerpc to fix an alignment
problem).
There is no good arch callback to use to initialize that cache
that I can find, so this adds a new one in the form of a weak
function whose default is empty.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
include/linux/sched.h | 2 ++
init/main.c | 5 +++++
2 files changed, 7 insertions(+)
--- linux-work.orig/init/main.c 2008-03-26 10:39:25.000000000 +1100
+++ linux-work/init/main.c 2008-04-18 16:43:53.000000000 +1000
@@ -504,6 +504,10 @@ void __init __attribute__((weak)) smp_se
{
}
+void __init __weak thread_info_cache_init(void)
+{
+}
+
asmlinkage void __init start_kernel(void)
{
char * command_line;
@@ -623,6 +627,7 @@ asmlinkage void __init start_kernel(void
if (efi_enabled)
efi_enter_virtual_mode();
#endif
+ thread_info_cache_init();
fork_init(num_physpages);
proc_caches_init();
buffer_init();
Index: linux-work/include/linux/sched.h
===================================================================
--- linux-work.orig/include/linux/sched.h 2008-04-02 09:47:56.000000000 +1100
+++ linux-work/include/linux/sched.h 2008-04-18 13:11:10.000000000 +1000
@@ -1893,6 +1893,8 @@ static inline unsigned long *end_of_stac
#endif
+extern void thread_info_cache_init(void);
+
/* set thread flags in other task's structures
* - see asm/thread_info.h for TIF_xxxx flags available
*/
^ permalink raw reply
* Re: [PATCH 1/2] Add thread_info_cache_init() to all archs
From: Benjamin Herrenschmidt @ 2008-04-18 6:44 UTC (permalink / raw)
To: Andrew Morton
Cc: Linux-Arch, linux-m32r, takata, linux-kernel, linuxppc-dev,
Paul Mackerras
In-Reply-To: <20080417211905.8ff769fa.akpm@linux-foundation.org>
> > so what
> > about the patch below ?
>
> I like it, but the compiler won't ;)
>
> > If you're ok, I'll re-send with appropriate sob
> > & adapted powerpc part.
>
> Sure.
>
> > +void __init __attribute__((weak) thread_info_cache_init(void)
>
> s/weak)/weak))/
Yeah, missing quilt ref :-)
I'll send the proper patches in a minute.
Cheers,
Ben.
^ permalink raw reply
* Re: 2.6.25-mm1 on the g5
From: Paul Mackerras @ 2008-04-18 6:38 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev
In-Reply-To: <20080417224248.fdd89284.akpm@linux-foundation.org>
Andrew Morton writes:
> It had been running happily and hard for a couple of hours when:
Looks like the bug that Kamalesh Babulal reported and which I have
been chasing without success so far.
> That's a pretty crappy trace. Perhaps netconsole lost some of it, dunno.
Yeah, there's a bug in the handling of that particular error condition
which I have a patch to fix.
Paul.
^ permalink raw reply
* 2.6.25-mm1 on the g5
From: Andrew Morton @ 2008-04-18 5:42 UTC (permalink / raw)
To: Paul Mackerras, Benjamin Herrenschmidt; +Cc: linuxppc-dev
It had been running happily and hard for a couple of hours when:
registered taskstats version 1
Freeing unused kernel memory: 304k freed
windfarm: CPUs control loops started.
EXT3-fs: INFO: recovery required on readonly filesystem.
EXT3-fs: write access will be enabled during recovery.
kjournald starting. Commit interval 5 seconds
EXT3-fs: recovery complete.
EXT3-fs: mounted filesystem with ordered data mode.
Unrecoverable exception 4100 at c000000000008c24
Oops: Unrecoverable exception, sig: 6 [#1]
SMP NR_CPUS=4 PowerMac
Modules linked in: autofs
NIP: c000000000008c24 LR: 000000000feea4ac CTR: 000000000feea450
REGS: c000000178fb7bb0 TRAP: 4100 Not tainted (2.6.25-mm1)
MSR: 9000000000001030 <ME,IR,DR> CR: 42000424 XER: 20000000
TASK = c000000178aae3c0[24350] 'sed' THREAD: c000000178fb4000 CPU: 2
GPR00: 0000000000004000 c000000178fb7e30 000000000ff41d14 100000000000d032
GPR04: 000000000000000c 0000000000000400 0000000000000024 0000000000000000
GPR08: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
GPR12: 0000000000000000 0000000010023338 0000000000000000 0000000010020000
GPR16: 0000000000000000 0000000000000000 0000000000000000 000000001003d868
GPR20: 0000000000000000 00000000ffec39d0 000000001003c850 0000000000000000
GPR24: 0000000000000000 0000000000000015 000000000000003b 0000000000000400
GPR28: 000000000ffc69d0 00000000f7ff7000 000000000ffc6e5c 0000000000000400
NIP [c000000000008c24] restore+0xa4/0xc0
LR [000000000feea4ac] 0xfeea4ac
Call Trace:
[c000000178fb7e30] [c000000000008c54] do_work+0x14/0x2c (unreliable)
Instruction dump:
e88d01e0 f84d01e0 7c841050 e84d01d8 7c422214 f84d01d8 e9a100d8 7c7b03a6
e84101a0 7c4ff120 e8410170 7c5a03a6 <e8010070> e8410080 e8610088 e8810090
---[ end trace 07fd463c013eef9d ]---
BUG: soft lockup - CPU#2 stuck for 61s! [swapper:0]
NIP: c000000000013bd4 LR: c000000000013bd4 CTR: c00000000001c9bc
REGS: c00000017a10bbe0 TRAP: 0901 Tainted: G D (2.6.25-mm1)
MSR: 9000000000009032 <EE,ME,IR,DR> CR: 44ffff28 XER: 00000000
TASK = c00000017a105260[0] 'swapper' THREAD: c00000017a108000 CPU: 2
GPR00: 0000000000000001 c00000017a10be60 c0000000006eac48 c00000000070a200
GPR04: 0000000000000001 0000000000002d2e 0000000024ffff22 9000000000049032
GPR08: 0000000000000001 c00000017a108000 c00000017a108000 0000000000000000
GPR12: 0000000022024448 c00000000062d380
NIP [c000000000013bd4] .cpu_idle+0x14c/0x154
LR [c000000000013bd4] .cpu_idle+0x14c/0x154
Call Trace:
[c00000017a10be60] [c000000000013ba0] .cpu_idle+0x118/0x154 (unreliable)
[c00000017a10bf00] [c000000000456970] .start_secondary+0x148/0x1b0
[c00000017a10bf90] [c0000000000083c0] .start_secondary_prolog+0xc/0x10
Instruction dump:
4bffff64 7c210b78 7ffffb78 4bffff58 e93b01b0 e8090000 f8410028 60000000
e9690010 e8490008 7c0903a6 4e800421 <e8410028> 4bffff80 e8030008 e9440008
BUG: soft lockup - CPU#1 stuck for 936s! [mrtg:24361]
NIP: 000000000eafb6ac LR: 000000000eafb4dc CTR: 0000000000000000
REGS: c000000177197ea0 TRAP: 0901 Tainted: G D (2.6.25-mm1)
MSR: 100000000200f032 <EE,PR,FP,ME,IR,DR> CR: 24422482 XER: 00000000
TASK = c0000001771b5260[24361] 'mrtg' THREAD: c000000177194000 CPU: 1
GPR00: 0000000000000000 00000000ff803c10 00000000f7fe0860 0000000010445278
GPR04: 0000000000000001 0000000000000007 000000000eb14720 0000000000000007
GPR08: 0000000010452840 0000000000000040 0000000000000000 0000000010041640
GPR12: 0000000044422484 000000001001bb2c
NIP [000000000eafb6ac] 0xeafb6ac
LR [000000000eafb4dc] 0xeafb4dc
Call Trace:
BUG: soft lockup - CPU#0 stuck for 936s! [mrtg:24365]
NIP: 000000000eb34800 LR: 000000000eb345e8 CTR: 000000010eb2bb5c
REGS: c0000001788b3ea0 TRAP: 0901 Tainted: G D (2.6.25-mm1)
MSR: 100000000200f032 <EE,PR,FP,ME,IR,DR> CR: 44422484 XER: 00000000
TASK = c00000017863f5e0[24365] 'mrtg' THREAD: c0000001788b0000 CPU: 0
GPR00: 00000000104670f0 00000000ffba12c0 00000000f7fe0860 0000000010015008
GPR04: 0000000010137100 0000000000000008 0000000000000003 0000000000000482
GPR08: 000000001012bbb8 0000000000000002 000000001012aad8 000000001002afe0
GPR12: 0000000024422442 000000001001bb2c
NIP [000000000eb34800] 0xeb34800
LR [000000000eb345e8] 0xeb345e8
Call Trace:
BUG: soft lockup - CPU#3 stuck for 936s! [python:24362]
NIP: 000000000fef62c0 LR: 000000000fd31c58 CTR: 000000000fccfcdc
REGS: c000000178e43ea0 TRAP: 0901 Tainted: G D (2.6.25-mm1)
MSR: 100000000000f032 <EE,PR,FP,ME,IR,DR> CR: 22288424 XER: 20000000
TASK = c00000017735b560[24362] 'python' THREAD: c000000178e40000 CPU: 3
GPR00: 0000000000000000 00000000ff83abc0 00000000f7fe0480 00000000ff83b14c
GPR04: 000000000fd6e354 00000000ff83b148 000000002e736f00 fffffffffefefeff
GPR08: 000000007f7f0000 000000000fdbff64 0000000000000000 0000000000000000
GPR12: 0000000000000000 0000000010019b88
NIP [000000000fef62c0] 0xfef62c0
LR [000000000fd31c58] 0xfd31c58
Call Trace:
That's a pretty crappy trace. Perhaps netconsole lost some of it, dunno.
^ permalink raw reply
* [PATCH 2.6.26?] Raise the upper limit of NR_CPUS.
From: Tony Breeds @ 2008-04-18 5:33 UTC (permalink / raw)
To: Paul Mackerras, LinuxPPC-dev
As the pacas are statically initialised increasing NR_CPUS beyond 128,
means that any additional pacas will be empty ... which is bad.
This patch adds the required functionality to fill in any excess pacas
at runtime.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
I know it's late, but can this be considered for 2.6.26?
arch/powerpc/kernel/paca.c | 33 ++++++++++------------------
arch/powerpc/kernel/prom_init.c | 36 ++++++++++++++++++++++++++++++++
arch/powerpc/platforms/Kconfig.cputype | 4 +-
include/asm-powerpc/paca.h | 19 ++++++++++++++++
4 files changed, 69 insertions(+), 23 deletions(-)
diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
index ac163bd..29186eb 100644
--- a/arch/powerpc/kernel/paca.c
+++ b/arch/powerpc/kernel/paca.c
@@ -18,6 +18,15 @@
#include <asm/paca.h>
#include <asm/mmu.h>
+/*
+ * In order to handle "strange" values of NR_CPUS, Make sure we use
+ * max(NR_CPUS, NR_STATIC_PACAS) for array sizes below
+ */
+#if NR_CPUS > NR_STATIC_PACAS
+#define MAX_CPUS NR_CPUS
+#else
+#define MAX_CPUS NR_STATIC_PACAS
+#endif
/* This symbol is provided by the linker - let it fill in the paca
* field correctly */
@@ -33,7 +42,7 @@ extern unsigned long __toc_start;
* will suffice to ensure that it doesn't cross a page boundary.
*/
struct lppaca lppaca[] = {
- [0 ... (NR_CPUS-1)] = {
+ [0 ... (MAX_CPUS-1)] = {
.desc = 0xd397d781, /* "LpPa" */
.size = sizeof(struct lppaca),
.dyn_proc_status = 2,
@@ -50,7 +59,7 @@ struct lppaca lppaca[] = {
* initially, hence will all be invaild until we actually write them.
*/
struct slb_shadow slb_shadow[] __cacheline_aligned = {
- [0 ... (NR_CPUS-1)] = {
+ [0 ... (MAX_CPUS-1)] = {
.persistent = SLB_NUM_BOLTED,
.buffer_length = sizeof(struct slb_shadow),
},
@@ -76,7 +85,7 @@ struct slb_shadow slb_shadow[] __cacheline_aligned = {
.__current = &init_task, \
}
-struct paca_struct paca[] = {
+struct paca_struct paca[MAX_CPUS] = {
PACA_INIT(0),
#if NR_CPUS > 1
PACA_INIT( 1), PACA_INIT( 2), PACA_INIT( 3),
@@ -98,24 +107,6 @@ struct paca_struct paca[] = {
PACA_INIT( 52), PACA_INIT( 53), PACA_INIT( 54), PACA_INIT( 55),
PACA_INIT( 56), PACA_INIT( 57), PACA_INIT( 58), PACA_INIT( 59),
PACA_INIT( 60), PACA_INIT( 61), PACA_INIT( 62), PACA_INIT( 63),
-#if NR_CPUS > 64
- PACA_INIT( 64), PACA_INIT( 65), PACA_INIT( 66), PACA_INIT( 67),
- PACA_INIT( 68), PACA_INIT( 69), PACA_INIT( 70), PACA_INIT( 71),
- PACA_INIT( 72), PACA_INIT( 73), PACA_INIT( 74), PACA_INIT( 75),
- PACA_INIT( 76), PACA_INIT( 77), PACA_INIT( 78), PACA_INIT( 79),
- PACA_INIT( 80), PACA_INIT( 81), PACA_INIT( 82), PACA_INIT( 83),
- PACA_INIT( 84), PACA_INIT( 85), PACA_INIT( 86), PACA_INIT( 87),
- PACA_INIT( 88), PACA_INIT( 89), PACA_INIT( 90), PACA_INIT( 91),
- PACA_INIT( 92), PACA_INIT( 93), PACA_INIT( 94), PACA_INIT( 95),
- PACA_INIT( 96), PACA_INIT( 97), PACA_INIT( 98), PACA_INIT( 99),
- PACA_INIT(100), PACA_INIT(101), PACA_INIT(102), PACA_INIT(103),
- PACA_INIT(104), PACA_INIT(105), PACA_INIT(106), PACA_INIT(107),
- PACA_INIT(108), PACA_INIT(109), PACA_INIT(110), PACA_INIT(111),
- PACA_INIT(112), PACA_INIT(113), PACA_INIT(114), PACA_INIT(115),
- PACA_INIT(116), PACA_INIT(117), PACA_INIT(118), PACA_INIT(119),
- PACA_INIT(120), PACA_INIT(121), PACA_INIT(122), PACA_INIT(123),
- PACA_INIT(124), PACA_INIT(125), PACA_INIT(126), PACA_INIT(127),
-#endif
#endif
#endif
#endif
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index 6d6df1e..cf2a2db 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -37,6 +37,9 @@
#include <asm/smp.h>
#include <asm/system.h>
#include <asm/mmu.h>
+#ifdef CONFIG_PPC64
+#include <asm/paca.h>
+#endif
#include <asm/pgtable.h>
#include <asm/pci.h>
#include <asm/iommu.h>
@@ -49,6 +52,10 @@
extern const struct linux_logo logo_linux_clut224;
#endif
+/* This symbol is provided by the linker - let it fill in the paca
+ * field correctly */
+extern unsigned long __toc_start;
+
/*
* Properties whose value is longer than this get excluded from our
* copy of the device tree. This value does need to be big enough to
@@ -2332,6 +2339,32 @@ static void __init prom_check_initrd(unsigned long r3, unsigned long r4)
}
/*
+ * The first few (NR_STATIC_PACAS) paca entires are initiialised
+ * statically. populate the rest.
+ */
+static void __init prom_initialise_pacas(void)
+{
+#ifdef CONFIG_PPC64
+ int cpu;
+ unsigned long kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL;
+
+ /* Can't use for_each_*_cpu, as they aren't functional yet */
+ for (cpu = NR_STATIC_PACAS; cpu < NR_CPUS; cpu++) {
+ struct paca_struct *new_paca = &RELOC(paca[cpu]);
+
+ new_paca->lppaca_ptr = &lppaca[cpu];
+ new_paca->lock_token = 0x8000;
+ new_paca->paca_index = cpu;
+ new_paca->kernel_toc = kernel_toc;
+ new_paca->hw_cpu_id = 0xffff;
+ new_paca->slb_shadow_ptr = &slb_shadow[cpu];
+ new_paca->__current = &init_task;
+
+ }
+#endif /* CONFIG_PPC64 */
+}
+
+/*
* We enter here early on, when the Open Firmware prom is still
* handling exceptions and the MMU hash table for us.
*/
@@ -2432,6 +2465,9 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
prom_initialize_tce_table();
#endif
+ /* We statically initialised /some/ of the paca's, lets do the rest. */
+ prom_initialise_pacas();
+
/*
* On non-powermacs, try to instantiate RTAS and puts all CPUs
* in spin-loops. PowerMacs don't have a working RTAS and use
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 5fc7fac..f7efaa9 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -220,8 +220,8 @@ config SMP
If you don't know what to do here, say N.
config NR_CPUS
- int "Maximum number of CPUs (2-128)"
- range 2 128
+ int "Maximum number of CPUs (2-1024)"
+ range 2 1024
depends on SMP
default "32" if PPC64
default "4"
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h
index eb61b9c..511ebc9 100644
--- a/include/asm-powerpc/paca.h
+++ b/include/asm-powerpc/paca.h
@@ -16,10 +16,29 @@
#define _ASM_POWERPC_PACA_H
#ifdef __KERNEL__
+#include <linux/threads.h>
+
#include <asm/types.h>
#include <asm/lppaca.h>
#include <asm/mmu.h>
+/*
+ * iSeries needs the paca to be statically allocated and initialised.
+ * We will allocated this many, based on NR_CPUS.
+ */
+#if NR_CPUS >= 32
+#define NR_STATIC_PACAS 64
+#elif NR_CPUS > 8
+#define NR_STATIC_PACAS 32
+#elif NR_CPUS > 4
+#define NR_STATIC_PACAS 8
+#elif NR_CPUS > 1
+#define NR_STATIC_PACAS 4
+#else
+#define NR_STATIC_PACAS 1
+#endif
+
+
register struct paca_struct *local_paca asm("r13");
#if defined(CONFIG_DEBUG_PREEMPT) && defined(CONFIG_SMP)
--
1.5.5
Yours Tony
linux.conf.au http://www.marchsouth.org/
Jan 19 - 24 2009 The Australian Linux Technical Conference!
^ permalink raw reply related
* [POWERPC] Optimize fls64() on 64-bit processors
From: Paul Mackerras @ 2008-04-18 5:19 UTC (permalink / raw)
To: linuxppc-dev
64-bit powerpc processors can find the leftmost 1 bit in a 64-bit
doubleword in one instruction, so use that rather than using the
generic fls64(), which does two 32-bit fls() calls.
Signed-off-by: Paul Mackerras <paulus@samba.org>
---
This is on top of a patch from Alexander van Heukelum that was posted
to lkml (http://lkml.org/lkml/2008/4/16/107), which just uses
asm-generic/bitops/find.h in place of some declarations we had in
asm-powerpc/bitops.h.
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h
index 36c8f3a..a99a749 100644
--- a/include/asm-powerpc/bitops.h
+++ b/include/asm-powerpc/bitops.h
@@ -312,7 +312,24 @@ static __inline__ int fls(unsigned int x)
asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x));
return 32 - lz;
}
+
+/*
+ * 64-bit can do this using one cntlzd (count leading zeroes doubleword)
+ * instruction; for 32-bit we use the generic version, which does two
+ * 32-bit fls calls.
+ */
+#ifdef __powerpc64__
+static __inline__ int fls64(__u64 x)
+{
+ int lz;
+
+ asm ("cntlzd %0,%1" : "=r" (lz) : "r" (x));
+ return 64 - lz;
+}
+#else
#include <asm-generic/bitops/fls64.h>
+#endif /* __powerpc64__ */
+
#include <asm-generic/bitops/hweight.h>
#include <asm-generic/bitops/find.h>
^ permalink raw reply related
* Re: [RFC/PATCH 3/4] Use pseries_setup_i8259_cascade() in pseries_mpic_init_IRQ()
From: Michael Ellerman @ 2008-04-18 4:47 UTC (permalink / raw)
To: benh; +Cc: linuxppc-dev
In-Reply-To: <1208492131.6958.390.camel@pasglop>
[-- Attachment #1: Type: text/plain, Size: 918 bytes --]
On Fri, 2008-04-18 at 14:15 +1000, Benjamin Herrenschmidt wrote:
> On Tue, 2008-04-01 at 17:42 +1100, Michael Ellerman wrote:
> > pseries_mpic_init_IRQ() implements the same logic as the xics code did to
> > find the i8259 cascade irq. Now that we've pulled that logic out into
> > pseries_setup_i8259_cascade() we can use it in the mpic code.
> >
> > Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
>
> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>
> (provided you test it and it works :-)
Done. Booted on a Power something (5 or 6) partion and also booted fine
on bongohits, an old power 3 machine with an MPIC.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH 1/2] Add thread_info_cache_init() to all archs
From: Michael Ellerman @ 2008-04-18 4:38 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Linux-Arch, linux-m32r, takata, linux-kernel, linuxppc-dev,
Paul Mackerras, Andrew Morton
In-Reply-To: <20080417211905.8ff769fa.akpm@linux-foundation.org>
[-- Attachment #1: Type: text/plain, Size: 1689 bytes --]
On Thu, 2008-04-17 at 21:19 -0700, Andrew Morton wrote:
> On Fri, 18 Apr 2008 13:58:06 +1000 Benjamin Herrenschmidt <benh@ozlabs.org> wrote:
>
> >
> > > > > otoh, if only one .c file will ever call this function then I think that
> > > > > all problems are solved by
> > > > >
> > > > > a) moving the above ifdeffery into the .c file
> > > > > b) adding a comment explaining which arch file must provide the override
> > > > > c) directly including that file from within the .c file.
> > > >
> > > > I can definitely do that. I have no problem either way. I can add to all
> > > > archs too, it's just that whatever way I choose, some people won't be
> > > > happy with it :-)
> > > >
> > > > Anyway, I'll move the ifdeferry to init/main.c then.
> > >
> > > Thanks ;)
> > >
> > > I'm still wounded by my recent encounter with set_softirq_pending()
> > > and or_softirq_pending().
> >
> > Well, looking there, I saw we already used weak symbols for that
>
> Yes, `weak' is a nice solution. It does add a few bytes of text which we
> could avoid with compile-time trickery, but only a very few.
>
> Plus this is __init anyway, although I don't know how well the combination
> of `weak' and __init works.
>
> > +void __init __attribute__((weak) thread_info_cache_init(void)
>
> s/weak)/weak))/
There's also a #define of this called "__weak" if you like, less typing
and less ugly.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH 1/2] Add thread_info_cache_init() to all archs
From: Kyle McMartin @ 2008-04-18 4:21 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Linux-Arch, linux-m32r, takata, linux-kernel, linuxppc-dev,
Paul Mackerras, Andrew Morton
In-Reply-To: <1208491086.6958.381.camel@pasglop>
On Fri, Apr 18, 2008 at 01:58:06PM +1000, Benjamin Herrenschmidt wrote:
> Well, looking there, I saw we already used weak symbols for that so what
> about the patch below ? If you're ok, I'll re-send with appropriate sob
> & adapted powerpc part.
>
This is definitely the cleanest way to do this from my pov. Although I'm
slightly concerned about the proliferation of weak symbols, I'm much
more concerned with adding more include-order-dependent arch overrides. :)
speaking with the parisc dunce-cap on,
Kyle
^ 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