* [PATCH v2] Fix hardware IRQ time accounting problem.
From: Tony Breeds @ 2007-12-04 5:51 UTC (permalink / raw)
To: Paul Mackerras, LinuxPPC-dev, Linux Kernel ML
Cc: Johannes Berg, Frederik Himpe, linux-usb-devel
The commit fa13a5a1f25f671d084d8884be96fc48d9b68275 (sched: restore
deterministic CPU accounting on powerpc), unconditionally calls
update_process_tick() in system context. In the deterministic accounting case
this is the correct thing to do. However, in the non-deterministic accounting
case we need to not do this, and results in the time accounted as hardware irq
time being artificially elevated.
Also this patch collapses 2 consecutive '#ifdef CONFIG_VIRT_CPU_ACCOUNTING'
checks in time.h into one for neatness.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
The problem was seen and reported by Johannes Berg and Frederik Himpe.
Paul, I think this is good for 2.6.24.
Changes since v1:
- I noticed that the #define was explictly using "current" rather than
the task passed in. Using tsk is the right thing to do.
- The whiteapce changes dirty-up the patch and are un-needed with the
change above.
arch/powerpc/kernel/process.c | 2 +-
include/asm-powerpc/time.h | 8 ++------
2 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 41e13f4..b9d8837 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -350,7 +350,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
local_irq_save(flags);
account_system_vtime(current);
- account_process_tick(current, 0);
+ account_process_vtime(current);
calculate_steal_time();
last = _switch(old_thread, new_thread);
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index 780f826..a7281e0 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -237,18 +237,14 @@ struct cpu_usage {
DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array);
-#ifdef CONFIG_VIRT_CPU_ACCOUNTING
-extern void account_process_vtime(struct task_struct *tsk);
-#else
-#define account_process_vtime(tsk) do { } while (0)
-#endif
-
#if defined(CONFIG_VIRT_CPU_ACCOUNTING)
extern void calculate_steal_time(void);
extern void snapshot_timebases(void);
+#define account_process_vtime(tsk) account_process_tick(tsk, 0);
#else
#define calculate_steal_time() do { } while (0)
#define snapshot_timebases() do { } while (0)
+#define account_process_vtime(tsk) do { } while (0)
#endif
extern void secondary_cpu_time_init(void);
--
1.5.3.6
^ permalink raw reply related
* [PATCH 7/7] powerpc: Remove incorrect panic() calls
From: Mark A. Greer @ 2007-12-04 5:50 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071204053736.GA27862@mag.az.mvista.com>
From: Mark A. Greer <mgreer@mvista.com>
Platform-specific restart routines should not call panic() when they
fail. Instead, they should return so the caller (machine_restart())
can halt the system more gracefully.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
arch/powerpc/platforms/82xx/pq2.c | 2 --
arch/powerpc/platforms/8xx/m8xx_setup.c | 1 -
arch/powerpc/platforms/embedded6xx/prpmc2800.c | 1 -
3 files changed, 4 deletions(-)
diff --git a/arch/powerpc/platforms/82xx/pq2.c b/arch/powerpc/platforms/82xx/pq2.c
index a497cba..16cd460 100644
--- a/arch/powerpc/platforms/82xx/pq2.c
+++ b/arch/powerpc/platforms/82xx/pq2.c
@@ -31,8 +31,6 @@ void pq2_restart(char *cmd)
/* Clear the ME,EE,IR & DR bits in MSR to cause checkstop */
mtmsr(mfmsr() & ~(MSR_ME | MSR_EE | MSR_IR | MSR_DR));
in_8(&cpm2_immr->im_clkrst.res[0]);
-
- panic("Restart failed\n");
}
#ifdef CONFIG_PCI
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c
index d35eda8..1014310 100644
--- a/arch/powerpc/platforms/8xx/m8xx_setup.c
+++ b/arch/powerpc/platforms/8xx/m8xx_setup.c
@@ -221,7 +221,6 @@ void mpc8xx_restart(char *cmd)
mtmsr(mfmsr() & ~0x1000);
in_8(&clk_r->res[0]);
- panic("Restart failed\n");
}
static void cpm_cascade(unsigned int irq, struct irq_desc *desc)
diff --git a/arch/powerpc/platforms/embedded6xx/prpmc2800.c b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
index 653a5eb..fe5920c 100644
--- a/arch/powerpc/platforms/embedded6xx/prpmc2800.c
+++ b/arch/powerpc/platforms/embedded6xx/prpmc2800.c
@@ -108,7 +108,6 @@ static void prpmc2800_restart(char *cmd)
prpmc2800_reset_board();
while (i-- > 0);
- panic("restart failed\n");
}
#ifdef CONFIG_NOT_COHERENT_CACHE
^ permalink raw reply related
* [PATCH 6/7] powerpc: Remove redundant power_off and halt routines
From: Mark A. Greer @ 2007-12-04 5:49 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071204053736.GA27862@mag.az.mvista.com>
From: Mark A. Greer <mgreer@mvista.com>
Remove platform-specific power_off and halt routines, and ppc_md
initializations that are not necessary.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
arch/powerpc/platforms/embedded6xx/holly.c | 12 ------------
arch/powerpc/platforms/embedded6xx/linkstation.c | 7 -------
arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c | 11 -----------
arch/powerpc/platforms/iseries/setup.c | 1 -
arch/powerpc/platforms/maple/setup.c | 6 ------
arch/powerpc/platforms/powermac/setup.c | 7 -------
6 files changed, 44 deletions(-)
diff --git a/arch/powerpc/platforms/embedded6xx/holly.c b/arch/powerpc/platforms/embedded6xx/holly.c
index b6de2b5..70cfd37 100644
--- a/arch/powerpc/platforms/embedded6xx/holly.c
+++ b/arch/powerpc/platforms/embedded6xx/holly.c
@@ -253,18 +253,6 @@ void holly_restart(char *cmd)
for (;;) ;
}
-void holly_power_off(void)
-{
- local_irq_disable();
- /* No way to shut power off with software */
- for (;;) ;
-}
-
-void holly_halt(void)
-{
- holly_power_off();
-}
-
/*
* Called very early, device-tree isn't unflattened
*/
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c
index 8792840..3382eef 100644
--- a/arch/powerpc/platforms/embedded6xx/linkstation.c
+++ b/arch/powerpc/platforms/embedded6xx/linkstation.c
@@ -162,12 +162,6 @@ static void linkstation_power_off(void)
/* NOTREACHED */
}
-static void linkstation_halt(void)
-{
- linkstation_power_off();
- /* NOTREACHED */
-}
-
static void linkstation_show_cpuinfo(struct seq_file *m)
{
seq_printf(m, "vendor\t\t: Buffalo Technology\n");
@@ -195,6 +189,5 @@ define_machine(linkstation){
.show_cpuinfo = linkstation_show_cpuinfo,
.get_irq = mpic_get_irq,
.restart = linkstation_restart,
- .halt = linkstation_halt,
.calibrate_decr = generic_calibrate_decr,
};
diff --git a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
index a2c04b9..557a6fe 100644
--- a/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
+++ b/arch/powerpc/platforms/embedded6xx/mpc7448_hpc2.c
@@ -179,17 +179,6 @@ void mpc7448_hpc2_restart(char *cmd)
for (;;) ; /* Spin until reset happens */
}
-void mpc7448_hpc2_power_off(void)
-{
- local_irq_disable();
- for (;;) ; /* No way to shut power off with software */
-}
-
-void mpc7448_hpc2_halt(void)
-{
- mpc7448_hpc2_power_off();
-}
-
/*
* Called very early, device-tree isn't unflattened
*/
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 362084e..0eabbc3 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -650,7 +650,6 @@ define_machine(iseries) {
.init_early = iSeries_init_early,
.pcibios_fixup = iSeries_pci_final_fixup,
.restart = mf_reboot,
- .halt = mf_power_off,
.get_boot_time = iSeries_get_boot_time,
.set_rtc_time = iSeries_set_rtc_time,
.get_rtc_time = iSeries_get_rtc_time,
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index d0eb901..ac5f99a 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -151,11 +151,6 @@ static void maple_power_off(void)
printk(KERN_EMERG "Maple: Manual Power-Down Required\n");
}
-static void maple_halt(void)
-{
- maple_power_off();
-}
-
#ifdef CONFIG_SMP
struct smp_ops_t maple_smp_ops = {
.probe = smp_mpic_probe,
@@ -329,7 +324,6 @@ define_machine(maple_md) {
.pci_irq_fixup = maple_pci_irq_fixup,
.pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq,
.restart = maple_restart,
- .halt = maple_halt,
.get_boot_time = maple_get_boot_time,
.set_rtc_time = maple_set_rtc_time,
.get_rtc_time = maple_get_rtc_time,
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 8429002..002b0b4 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -499,12 +499,6 @@ static void pmac_power_off(void)
}
}
-static void
-pmac_halt(void)
-{
- pmac_power_off();
-}
-
/*
* Early initialization.
*/
@@ -677,7 +671,6 @@ define_machine(powermac) {
.get_irq = NULL, /* changed later */
.pci_irq_fixup = pmac_pci_irq_fixup,
.restart = pmac_restart,
- .halt = pmac_halt,
.time_init = pmac_time_init,
.get_boot_time = pmac_get_boot_time,
.set_rtc_time = pmac_set_rtc_time,
^ permalink raw reply related
* [PATCH 5/7] powerpc: Replace ppc_md.power_off with pm_power_off
From: Mark A. Greer @ 2007-12-04 5:48 UTC (permalink / raw)
To: linuxppc-dev, Benjamin Herrenschmidt
In-Reply-To: <20071204053736.GA27862@mag.az.mvista.com>
From: Mark A. Greer <mgreer@mvista.com>
The ppc_md.power_off hook performs the same function that the
pm_power_off hook is supposed to. However, it is powerpc-specific
and prevents kernel drivers (e.g., IPMI) from changing how a platform
is powered off. So, get rid of ppc_md.power_off and replace it with
pm_power_off.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
arch/powerpc/kernel/setup-common.c | 14 +--
arch/powerpc/platforms/52xx/efika.c | 2
arch/powerpc/platforms/cell/setup.c | 2
arch/powerpc/platforms/celleb/setup.c | 2
arch/powerpc/platforms/chrp/setup.c | 2
arch/powerpc/platforms/embedded6xx/linkstation.c | 3
arch/powerpc/platforms/iseries/setup.c | 2
arch/powerpc/platforms/maple/setup.c | 4
arch/powerpc/platforms/powermac/setup.c | 2
arch/powerpc/platforms/ps3/setup.c | 2
arch/powerpc/platforms/pseries/setup.c | 59 ++++++-------
include/asm-powerpc/machdep.h | 1
12 files changed, 48 insertions(+), 47 deletions(-)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 1f8f9aa..d9f2e07 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -76,6 +76,9 @@ EXPORT_SYMBOL(ppc_md);
struct machdep_calls *machine_id;
EXPORT_SYMBOL(machine_id);
+void (*pm_power_off)(void);
+EXPORT_SYMBOL_GPL(pm_power_off);
+
unsigned long klimit = (unsigned long) _end;
char cmd_line[COMMAND_LINE_SIZE];
@@ -127,8 +130,8 @@ void machine_restart(char *cmd)
void machine_power_off(void)
{
machine_shutdown();
- if (ppc_md.power_off)
- ppc_md.power_off();
+ if (pm_power_off)
+ pm_power_off();
printk(KERN_EMERG "System not powered off; halting instead.\n");
if (ppc_md.halt)
ppc_md.halt();
@@ -137,17 +140,14 @@ void machine_power_off(void)
/* Used by the G5 thermal driver */
EXPORT_SYMBOL_GPL(machine_power_off);
-void (*pm_power_off)(void) = machine_power_off;
-EXPORT_SYMBOL_GPL(pm_power_off);
-
void machine_halt(void)
{
machine_shutdown();
if (ppc_md.halt)
ppc_md.halt();
- if (ppc_md.power_off) {
+ if (pm_power_off) {
printk(KERN_EMERG "System not halted; powering off instead.\n");
- ppc_md.power_off();
+ pm_power_off();
printk(KERN_EMERG "Poweroff failed.\n");
}
default_halt("OK to turn off power\n");
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index a0da70c..c2d5f06 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -205,6 +205,7 @@ static int __init efika_probe(void)
DMA_MODE_READ = 0x44;
DMA_MODE_WRITE = 0x48;
+ pm_power_off = rtas_power_off;
return 1;
}
@@ -218,7 +219,6 @@ define_machine(efika)
.init_IRQ = mpc52xx_init_irq,
.get_irq = mpc52xx_get_irq,
.restart = rtas_restart,
- .power_off = rtas_power_off,
.halt = rtas_halt,
.set_rtc_time = rtas_set_rtc_time,
.get_rtc_time = rtas_get_rtc_time,
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index 98e7ef8..06f44f5 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -191,6 +191,7 @@ static int __init cell_probe(void)
return 0;
hpte_init_native();
+ pm_power_off = rtas_power_off;
return 1;
}
@@ -201,7 +202,6 @@ define_machine(cell) {
.setup_arch = cell_setup_arch,
.show_cpuinfo = cell_show_cpuinfo,
.restart = rtas_restart,
- .power_off = rtas_power_off,
.halt = rtas_halt,
.get_boot_time = rtas_get_boot_time,
.get_rtc_time = rtas_get_rtc_time,
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c
index ddfb35a..450841a 100644
--- a/arch/powerpc/platforms/celleb/setup.c
+++ b/arch/powerpc/platforms/celleb/setup.c
@@ -116,6 +116,7 @@ static int __init celleb_probe(void)
powerpc_firmware_features |= FW_FEATURE_CELLEB_POSSIBLE;
hpte_init_beat_v3();
+ pm_power_off = beat_power_off;
return 1;
}
@@ -145,7 +146,6 @@ define_machine(celleb) {
.setup_arch = celleb_setup_arch,
.show_cpuinfo = celleb_show_cpuinfo,
.restart = beat_restart,
- .power_off = beat_power_off,
.halt = beat_halt,
.get_rtc_time = beat_get_rtc_time,
.set_rtc_time = beat_set_rtc_time,
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 5930626..99edb04 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -586,6 +586,7 @@ static int __init chrp_probe(void)
DMA_MODE_READ = 0x44;
DMA_MODE_WRITE = 0x48;
+ pm_power_off = rtas_power_off;
return 1;
}
@@ -597,7 +598,6 @@ define_machine(chrp) {
.show_cpuinfo = chrp_show_cpuinfo,
.init_IRQ = chrp_init_IRQ,
.restart = rtas_restart,
- .power_off = rtas_power_off,
.halt = rtas_halt,
.time_init = chrp_time_init,
.set_rtc_time = chrp_set_rtc_time,
diff --git a/arch/powerpc/platforms/embedded6xx/linkstation.c b/arch/powerpc/platforms/embedded6xx/linkstation.c
index eb5d74e..8792840 100644
--- a/arch/powerpc/platforms/embedded6xx/linkstation.c
+++ b/arch/powerpc/platforms/embedded6xx/linkstation.c
@@ -182,6 +182,8 @@ static int __init linkstation_probe(void)
if (!of_flat_dt_is_compatible(root, "linkstation"))
return 0;
+
+ pm_power_off = linkstation_power_off;
return 1;
}
@@ -193,7 +195,6 @@ define_machine(linkstation){
.show_cpuinfo = linkstation_show_cpuinfo,
.get_irq = mpic_get_irq,
.restart = linkstation_restart,
- .power_off = linkstation_power_off,
.halt = linkstation_halt,
.calibrate_decr = generic_calibrate_decr,
};
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index 2175a71..6051204 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -633,6 +633,7 @@ static int __init iseries_probe(void)
/* iSeries does not support 16M pages */
cur_cpu_spec->cpu_features &= ~CPU_FTR_16M_PAGE;
+ pm_power_off = mf_power_off;
return 1;
}
@@ -645,7 +646,6 @@ define_machine(iseries) {
.init_early = iSeries_init_early,
.pcibios_fixup = iSeries_pci_final_fixup,
.restart = mf_reboot,
- .power_off = mf_power_off,
.halt = mf_power_off,
.get_boot_time = iSeries_get_boot_time,
.set_rtc_time = iSeries_set_rtc_time,
diff --git a/arch/powerpc/platforms/maple/setup.c b/arch/powerpc/platforms/maple/setup.c
index 144177d..d0eb901 100644
--- a/arch/powerpc/platforms/maple/setup.c
+++ b/arch/powerpc/platforms/maple/setup.c
@@ -172,7 +172,7 @@ static void __init maple_use_rtas_reboot_and_halt_if_present(void)
if (rtas_service_present("system-reboot") &&
rtas_service_present("power-off")) {
ppc_md.restart = rtas_restart;
- ppc_md.power_off = rtas_power_off;
+ pm_power_off = rtas_power_off;
ppc_md.halt = rtas_halt;
}
}
@@ -315,6 +315,7 @@ static int __init maple_probe(void)
alloc_dart_table();
hpte_init_native();
+ pm_power_off = maple_power_off;
return 1;
}
@@ -328,7 +329,6 @@ define_machine(maple_md) {
.pci_irq_fixup = maple_pci_irq_fixup,
.pci_get_legacy_ide_irq = maple_pci_get_legacy_ide_irq,
.restart = maple_restart,
- .power_off = maple_power_off,
.halt = maple_halt,
.get_boot_time = maple_get_boot_time,
.set_rtc_time = maple_set_rtc_time,
diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c
index 02c5330..8429002 100644
--- a/arch/powerpc/platforms/powermac/setup.c
+++ b/arch/powerpc/platforms/powermac/setup.c
@@ -577,6 +577,7 @@ static int __init pmac_probe(void)
hpte_init_native();
#endif
+ pm_power_off = pmac_power_off;
#ifdef CONFIG_PPC32
/* isa_io_base gets set in pmac_pci_init */
@@ -676,7 +677,6 @@ define_machine(powermac) {
.get_irq = NULL, /* changed later */
.pci_irq_fixup = pmac_pci_irq_fixup,
.restart = pmac_restart,
- .power_off = pmac_power_off,
.halt = pmac_halt,
.time_init = pmac_time_init,
.get_boot_time = pmac_get_boot_time,
diff --git a/arch/powerpc/platforms/ps3/setup.c b/arch/powerpc/platforms/ps3/setup.c
index 5c2cbb0..74942d8 100644
--- a/arch/powerpc/platforms/ps3/setup.c
+++ b/arch/powerpc/platforms/ps3/setup.c
@@ -233,6 +233,7 @@ static int __init ps3_probe(void)
ps3_mm_init();
ps3_mm_vas_create(&htab_size);
ps3_hpte_init(htab_size);
+ pm_power_off = ps3_power_off;
DBG(" <- %s:%d\n", __func__, __LINE__);
return 1;
@@ -265,7 +266,6 @@ define_machine(ps3) {
.calibrate_decr = ps3_calibrate_decr,
.progress = ps3_progress,
.restart = ps3_restart,
- .power_off = ps3_power_off,
#if defined(CONFIG_KEXEC)
.kexec_cpu_down = ps3_kexec_cpu_down,
.machine_kexec = default_machine_kexec,
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index fdb9b1c..51ef84c 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -353,6 +353,34 @@ static int __init pSeries_probe_hypertas(unsigned long node,
return 1;
}
+/**
+ * pSeries_power_off - tell firmware about how to power off the system.
+ *
+ * This function calls either the power-off rtas token in normal cases
+ * or the ibm,power-off-ups token (if present & requested) in case of
+ * a power failure. If power-off token is used, power on will only be
+ * possible with power button press. If ibm,power-off-ups token is used
+ * it will allow auto poweron after power is restored.
+ */
+void pSeries_power_off(void)
+{
+ int rc;
+ int rtas_poweroff_ups_token = rtas_token("ibm,power-off-ups");
+
+ if (rtas_flash_term_hook)
+ rtas_flash_term_hook(SYS_POWER_OFF);
+
+ if (rtas_poweron_auto == 0 ||
+ rtas_poweroff_ups_token == RTAS_UNKNOWN_SERVICE) {
+ rc = rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1);
+ printk(KERN_INFO "RTAS power-off returned %d\n", rc);
+ } else {
+ rc = rtas_call(rtas_poweroff_ups_token, 0, 1, NULL);
+ printk(KERN_INFO "RTAS ibm,power-off-ups returned %d\n", rc);
+ }
+ for (;;);
+}
+
static int __init pSeries_probe(void)
{
unsigned long root = of_get_flat_dt_root();
@@ -380,6 +408,8 @@ static int __init pSeries_probe(void)
else
hpte_init_native();
+ pm_power_off = pSeries_power_off;
+
DBG("Machine is%s LPAR !\n",
(powerpc_firmware_features & FW_FEATURE_LPAR) ? "" : " not");
@@ -463,34 +493,6 @@ static int pSeries_pci_probe_mode(struct pci_bus *bus)
return PCI_PROBE_NORMAL;
}
-/**
- * pSeries_power_off - tell firmware about how to power off the system.
- *
- * This function calls either the power-off rtas token in normal cases
- * or the ibm,power-off-ups token (if present & requested) in case of
- * a power failure. If power-off token is used, power on will only be
- * possible with power button press. If ibm,power-off-ups token is used
- * it will allow auto poweron after power is restored.
- */
-void pSeries_power_off(void)
-{
- int rc;
- int rtas_poweroff_ups_token = rtas_token("ibm,power-off-ups");
-
- if (rtas_flash_term_hook)
- rtas_flash_term_hook(SYS_POWER_OFF);
-
- if (rtas_poweron_auto == 0 ||
- rtas_poweroff_ups_token == RTAS_UNKNOWN_SERVICE) {
- rc = rtas_call(rtas_token("power-off"), 2, 1, NULL, -1, -1);
- printk(KERN_INFO "RTAS power-off returned %d\n", rc);
- } else {
- rc = rtas_call(rtas_poweroff_ups_token, 0, 1, NULL);
- printk(KERN_INFO "RTAS ibm,power-off-ups returned %d\n", rc);
- }
- for (;;);
-}
-
#ifndef CONFIG_PCI
void pSeries_final_fixup(void) { }
#endif
@@ -505,7 +507,6 @@ define_machine(pseries) {
.pcibios_fixup = pSeries_final_fixup,
.pci_probe_mode = pSeries_pci_probe_mode,
.restart = rtas_restart,
- .power_off = pSeries_power_off,
.halt = rtas_halt,
.panic = rtas_os_term,
.get_boot_time = rtas_get_boot_time,
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 6968f43..bca57bc 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -129,7 +129,6 @@ struct machdep_calls {
#endif
void (*restart)(char *cmd);
- void (*power_off)(void);
void (*halt)(void);
void (*panic)(char *str);
void (*cpu_die)(void);
^ permalink raw reply related
* Re: [PATCH] powermac: proper sleep management
From: Paul Mackerras @ 2007-12-04 5:48 UTC (permalink / raw)
To: Johannes Berg; +Cc: linuxppc-dev list, linux-pm
In-Reply-To: <1194981933.6695.17.camel@johannes.berg>
Johannes Berg writes:
> + printk(KERN_INFO
> + "via-pmu: the PMU_IOC_SLEEP ioctl is deprecated.\n");
> + printk(KERN_INFO "via-pmu: use \"echo mem >"
> + " /sys/power/state\" instead!\n");
> + printk(KERN_INFO
> + "via-pmu: this ioctl will be removed soon.\n");
I don't like this. I would rather keep the ioctls indefinitely and
not make any noise about programs using them. The ioctls are part of
the kernel/user ABI, and thus need to be preserved, especially since
it only takes about 6 or 7 lines of code to implement them.
Paul.
^ permalink raw reply
* [PATCH 4/7] powerpc: Rework the machine_[restart|power_off|halt] routines
From: Mark A. Greer @ 2007-12-04 5:47 UTC (permalink / raw)
To: linuxppc-dev, Benjamin Herrenschmidt
In-Reply-To: <20071204053736.GA27862@mag.az.mvista.com>
From: Mark A. Greer <mgreer@mvista.com>
Factor out common code from the machine_xxx routines and make them better
handle a ppc_md hook that doesn't exist or fails better. In particular,
have machine_power_off() try ppc_md.halt if ppc_md.power_off is NULL or fails,
and have machine_halt() try to power off when ppc_md.halt is NULL or fails.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
arch/powerpc/kernel/setup-common.c | 40 ++++++++++++++-------------
1 file changed, 22 insertions(+), 18 deletions(-)
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 6adb5a1..1f8f9aa 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -105,17 +105,23 @@ void machine_shutdown(void)
ppc_md.machine_shutdown();
}
-void machine_restart(char *cmd)
+static void default_halt(const char *s)
{
- machine_shutdown();
- if (ppc_md.restart)
- ppc_md.restart(cmd);
#ifdef CONFIG_SMP
smp_send_stop();
#endif
- printk(KERN_EMERG "System Halted, OK to turn off power\n");
+ printk(KERN_EMERG "%s", s);
local_irq_disable();
- while (1) ;
+ while (1);
+}
+
+void machine_restart(char *cmd)
+{
+ machine_shutdown();
+ if (ppc_md.restart)
+ ppc_md.restart(cmd);
+ default_halt("System not restarted; halting instead.\n"
+ "OK to turn off power\n");
}
void machine_power_off(void)
@@ -123,12 +129,10 @@ void machine_power_off(void)
machine_shutdown();
if (ppc_md.power_off)
ppc_md.power_off();
-#ifdef CONFIG_SMP
- smp_send_stop();
-#endif
- printk(KERN_EMERG "System Halted, OK to turn off power\n");
- local_irq_disable();
- while (1) ;
+ printk(KERN_EMERG "System not powered off; halting instead.\n");
+ if (ppc_md.halt)
+ ppc_md.halt();
+ default_halt("OK to turn off power\n");
}
/* Used by the G5 thermal driver */
EXPORT_SYMBOL_GPL(machine_power_off);
@@ -141,12 +145,12 @@ void machine_halt(void)
machine_shutdown();
if (ppc_md.halt)
ppc_md.halt();
-#ifdef CONFIG_SMP
- smp_send_stop();
-#endif
- printk(KERN_EMERG "System Halted, OK to turn off power\n");
- local_irq_disable();
- while (1) ;
+ if (ppc_md.power_off) {
+ printk(KERN_EMERG "System not halted; powering off instead.\n");
+ ppc_md.power_off();
+ printk(KERN_EMERG "Poweroff failed.\n");
+ }
+ default_halt("OK to turn off power\n");
}
^ permalink raw reply related
* [PATCH 3/7] powerpc: ras.c should call machine_power_off()
From: Mark A. Greer @ 2007-12-04 5:45 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <20071204053736.GA27862@mag.az.mvista.com>
From: Mark A. Greer <mgreer@mvista.com>
machine_power_off() is the proper interface to use for powering
off a machine.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
arch/powerpc/platforms/pseries/ras.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c
index a1ab25c..64564b2 100644
--- a/arch/powerpc/platforms/pseries/ras.c
+++ b/arch/powerpc/platforms/pseries/ras.c
@@ -242,7 +242,7 @@ static irqreturn_t ras_error_interrupt(int irq, void *dev_id)
* without actually failing while injecting errors.
* Error data will not be logged to syslog.
*/
- ppc_md.power_off();
+ machine_power_off();
#endif
} else {
udbg_printf("Recoverable HW Error <0x%lx 0x%x>\n",
^ permalink raw reply related
* [PATCH 2/7] powerpc: xmon should call machine_xxx not ppc_md.xxx directly
From: Mark A. Greer @ 2007-12-04 5:44 UTC (permalink / raw)
To: Mark A. Greer; +Cc: linuxppc-dev
In-Reply-To: <20071204053736.GA27862@mag.az.mvista.com>
From: Mark A. Greer <mgreer@mvista.com>
xmon should call machine_[restart|halt|power_off] instead of
ppc_md.[restart|halt|power_off].
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
I'm not sure about this one. Does anyone see a problem with this?
arch/powerpc/xmon/xmon.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 121b04d..56267e3 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -908,11 +908,11 @@ static void bootcmds(void)
cmd = inchar();
if (cmd == 'r')
- ppc_md.restart(NULL);
+ machine_restart();
else if (cmd == 'h')
- ppc_md.halt();
+ machine_halt();
else if (cmd == 'p')
- ppc_md.power_off();
+ machine_power_off();
}
static int cpu_cmd(void)
^ permalink raw reply related
* [PATCH 1/7] powerpc: Drivers should call machine_power_off not pm_power_off
From: Mark A. Greer @ 2007-12-04 5:43 UTC (permalink / raw)
To: linuxppc-dev, Helge Deller
In-Reply-To: <20071204053736.GA27862@mag.az.mvista.com>
From: Mark A. Greer <mgreer@mvista.com>
Drivers should call machine_power_off() not pm_power_off to power off
a machine.
Signed-off-by: Mark A. Greer <mgreer@mvista.com>
---
drivers/parisc/power.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/parisc/power.c b/drivers/parisc/power.c
index 90cca5e..188a1ac 100644
--- a/drivers/parisc/power.c
+++ b/drivers/parisc/power.c
@@ -93,11 +93,9 @@ static void process_shutdown(void)
lcd_print(msg);
/* send kill signal */
- if (kill_cad_pid(SIGINT, 1)) {
+ if (kill_cad_pid(SIGINT, 1))
/* just in case killing init process failed */
- if (pm_power_off)
- pm_power_off();
- }
+ machine_power_off();
}
}
^ permalink raw reply related
* Re: [PATCH] Add IPIC MSI interrupt support
From: Michael Ellerman @ 2007-12-04 5:38 UTC (permalink / raw)
To: Li Li; +Cc: linuxppc-dev, Gala Kumar, Li Tony
In-Reply-To: <1196672870.14353.21.camel@Guyver>
[-- Attachment #1: Type: text/plain, Size: 3172 bytes --]
On Mon, 2007-12-03 at 17:07 +0800, Li Li wrote:
> Hi Michael,
>
> I emulate mpic to write this IPIC MSI routines. :)
>
>
> > > diff --git a/arch/powerpc/platforms/83xx/mpc837x_mds.c b/arch/powerpc/platforms/83xx/mpc837x_mds.c
> > > index 6048f1b..dbea34b 100644
> > > --- a/arch/powerpc/platforms/83xx/mpc837x_mds.c
> > > +++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
> > > +
> > > +#define ipic_msi_irq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq)
> >
> > What's wrong with virq_to_hw() ?
> >
>
> viqr_to_hw is not __inline__.
Hmm, ok. The three places you use it you also take a spin lock, so I'm
not sure the function call's really going to kill you performance wise.
> > > +
> > > +static void ipic_msi_compose_msg(struct ipic_msi *msi, int hwirq,
> > > + struct msi_msg *msg)
> > > +{
> > > + unsigned int srs;
> > > + unsigned int ibs;
> > > +
> > > + srs = hwirq / msi->int_per_msir;
> > > + ibs = hwirq - srs * msi->int_per_msir;
> > > +
> > > + msg->address_lo = msi->msi_addr_lo;
> > > + msg->address_hi = msi->msi_addr_hi;
> > > + msg->data = (srs << 5) | (ibs & 0x1F);
> > > +
> > > + pr_debug("%s: allocated srs: %d, ibs: %d\n",
> > > + __FUNCTION__, srs, ibs);
> > > +
> > > +}
> > > +
> > > +static int ipic_msi_setup_irqs(struct pci_dev *pdev, int nvec, int type)
> > > +{
> > > + struct ipic_msi *msi = ipic_msi;
> > > + irq_hw_number_t hwirq;
> > > + unsigned int virq;
> > > + struct msi_desc *entry;
> > > + struct msi_msg msg;
> > > +
> > > + list_for_each_entry(entry, &pdev->msi_list, list) {
> > > + hwirq = ipic_msi_alloc_hwirqs(msi, 1);
> > > + if (hwirq < 0) {
> > > + pr_debug("%s: fail allocating msi interrupt\n",
> > > + __FUNCTION__);
> > > + return hwirq;
> > > + }
> > > +
> > > + /* This hwirq belongs to the irq_host other than irq_host of IPIC
> > > + * So, it is independent to hwirq of IPIC */
> > > + virq = irq_create_mapping(msi->irqhost, hwirq);
> > > + if (virq == NO_IRQ) {
> > > + pr_debug("%s: fail mapping hwirq 0x%lx\n",
> > > + __FUNCTION__, hwirq);
> > > + ipic_msi_free_hwirqs(msi, hwirq, 1);
> > > + return -ENOSPC;
> > > + }
> > > + set_irq_msi(virq, entry);
> > > + ipic_msi_compose_msg(msi, hwirq, &msg);
> > > + write_msi_msg(virq, &msg);
> > > +
> > > + hwirq++;
> >
> > ^^^^ this looks like my bug
>
> I have a question here. Do we support more MSI interrupts on ONE pci
> device?
I'm not sure what you mean? For MSI there is only one MSI per device,
but this code is used also for MSI-X which supports > 1 MSI per device.
Either way we shouldn't be incrementing hwirq by hand, it's reassigned
at the top of the loop. I think that's left over from old code that
allocated nvec hwirqs in a block and then created virq mappings for each
one, whereas the new code allocates each hwirq separately.
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
* [RFC 0/7] powerpc: Rework pm_power_off & machine_[restart|power_off|halt]
From: Mark A. Greer @ 2007-12-04 5:37 UTC (permalink / raw)
To: linuxppc-dev
We seem to have the pm_power_off hook wrong in arch/powerpc. From the
other arches and from how its used by the rest of the kernel (e.g., ipmi),
it should point to the lowest-level power off function not to
machine_power_off(). Actually, machine_power_off() should call pm_power_off
since AFAICT it is the one and only interface used by the rest of the kernel
to power a machine off (with one exception which I believe to be a bug and
have a patch in this series to fix).
While looking at this, I found several bits of code that needed minor
rework and/or cleaning up. These bits include: refactoring some
common code used by the machine_xxx routines, having machine_power_off
call ppc_md.halt if there ppc_md.power_off is NULL or returns, having
machine_halt call ppc_md.power_off it ppc_md.halt is NULL or returns,
and removing some useless xxx_halt and xxx_power_off routines in
platform code.
With the new usage of pm_power_off, the ppc_md.power_off hook is
no longer needed and pm_power_off will be assigned in the platform
probe routine.
The end result of all of these patches should make the check of
pm_power_off being NULL in kernel/sys.c:sys_reboot useful for powerpc,
eliminate the need for platform halt routines to call the power off routine
(and vice versa), allow things like IPMI to take over pm_power_off
when they need to, and make the power off/halt related code a bit cleaner
& consistent.
I still have to make sure I didn't miss anything and I haven't compiled
all the files I've touched so these aren't submission candidates yet.
I'd appreciate any feedback.
Thanks,
Mark
^ permalink raw reply
* Re: [PATCH 1/5] PowerPC 74xx: Katana Qp device tree
From: Mark A. Greer @ 2007-12-04 5:34 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1196734483.13230.256.camel@pasglop>
On Tue, Dec 04, 2007 at 01:14:43PM +1100, Benjamin Herrenschmidt wrote:
>
> .../... (snip scary bunch of errata)
>
> > - "FEr PCI-#4" (Detailed by Application Note AN-84):
> >
> > [This isn't strictly a coherency issue but having coherency enabled
> > exacerbates the problem.] Basically, the bridge can let the cpu read
> > a pci device's registers before all of the data the PCI devices has
> > written has actually made it to memory. This and the fact that the
> > device's write data may be stuck in the PCI Slave Write Buffer
> > (which isn't checked for coherency), the cpu can get stale data.
> >
> > There are no plans to fix that erratum.
>
> So if I understand correctly, there's no plan to fix a major PCI spec
> violation which prevent any kind of reliable implementation whatsoever ?
That's just for that particular part (e.g., 64360). Newer parts like
the 64460 have it fixed.
> > So, the answer depends on what part & what rev of the part you have
> > (e.g., the pegasos doesn't use the MPSC and apparently has the other
> > issues worked around so it can turn on coherency but the prpmc2800
> > doesn't so it needs coherency off).
> >
> > BTW, I haven't forgotten the inherent bug you described when coherency
> > is off (/me too lazy to find link to the email) but AFAIK I've never run
> > into it. However, if I turn on coherency and stress the PCI bus, it
> > hangs (I can't even look at memory thru a bdi).
>
> Well, as it is today, the "classic" MMU code cannot deal with !coherent.
> The entire linear mapping is always mapped cacheable with BATs, so stuff
> may be brought into the cache at any time, potentially polluting DMA
> data.
>
> Dealing with that would be hard. It might be possible by using G on the
> entire linear mapping like we do on 4xx (yuck), and/or by not using
> D-BATs (the kernel will blow up in various areas without I-BATs).
Hrm, I didn't realize it was in such bad shape. I'll have to take a
closer look.
Mark
^ permalink raw reply
* RE: [PATCH] [POWERPC] [v2] Improved documentation of device tree'ranges'.
From: Stephen Neuendorffer @ 2007-12-04 5:27 UTC (permalink / raw)
To: David Gibson; +Cc: linuxppc-dev
In-Reply-To: <20071204024025.GG32577@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]
I'm actually a little embarrassed that I didn't pick that nit myself.. :)
-----Original Message-----
From: David Gibson [mailto:david@gibson.dropbear.id.au]
Sent: Mon 12/3/2007 6:40 PM
To: Stephen Neuendorffer
Cc: grant.likely@secretlab.ca; linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] [POWERPC] [v2] Improved documentation of device tree'ranges'.
On Mon, Dec 03, 2007 at 05:08:57PM -0800, Stephen Neuendorffer wrote:
> I was misled by the prior language. I've attempted to clarify how
> 'ranges' are used, in particular, how to get an identity mapping.
>
> Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Thanks for the update. I particularly dislike the "1:1" terminology,
because in maths-speak *any* ranges translation is 1:1, unless it
includes overlapping ranges.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: Type: text/html, Size: 2029 bytes --]
^ permalink raw reply
* Re: [PATCH 1/5] PowerPC 74xx: Katana Qp device tree
From: Mark A. Greer @ 2007-12-04 5:30 UTC (permalink / raw)
To: Mark A. Greer, Andrei Dolnikov, linuxppc-dev
In-Reply-To: <20071204025032.GH32577@localhost.localdomain>
On Tue, Dec 04, 2007 at 01:50:32PM +1100, David Gibson wrote:
> On Mon, Dec 03, 2007 at 07:10:26PM -0700, Mark A. Greer wrote:
> > On Mon, Dec 03, 2007 at 12:50:18PM +1100, David Gibson wrote:
> > > On Thu, Nov 29, 2007 at 06:28:36PM +0300, Andrei Dolnikov wrote:
> > > > + eth0 {
> > > > + device_type = "network";
> > > > + compatible = "marvell,mv64x60-eth";
> > > > + block-index = <0>;
> > >
> > > This block-index thing is crap. If you really need to subindex nodes
> > > like this, use "reg", with an appropriate #address-cells in the
> > > parent, then the nodes will also get sensible unit addresses.
> >
> > So how would that work for the "PHY Address Register 0x2000", say,
> > where bits 0-4 set the device addr for PHY 0; bits 5-9 set the device
> > addr for PHY 1; bts 10-14 set the devce addr for PHY 2?
>
> So use 'reg' to do the indexing. As long as you have no 'ranges'
> property in the parent 'ethernet' node, which you don't, you can use
> 'reg' as a private index. That's basically what non-translatable reg
> values are about.
>
> Incidentally you should probably call the subnodes "ethernet@0"
> etc. and the parent one "multiethernet" or something. It's the
> subnodes that represent an individual ethernet interface, so they
> should take the "ethernet" name and not the parent, by generic names
> conventions.
Okay, thanks for the advice. I'll fix the prpmc2800 dts file.
Presumably Andrei will fix his.
> [snip]
> > > > + sdma@4000 {
> > > > + compatible = "marvell,mv64x60-sdma";
> > > > + reg = <4000 c18>;
> > > > + virtual-reg = <f8104000>;
> > >
> > > Why does this node have virtual-reg?
> >
> > "virtual-reg" is a special property that doesn't get translated thru
> > the parent mappings. It should never be used in the kernel. Its
> > purpose is to give code in the bootwrapper the exact address that it
> > should use to access a register or block of registers or ...
> > Its needed here because the MPSC (serial) driver uses the SDMA unit
> > to perform console I/O in the bootwrapper (e.g., cmdline editing, printf's).
> >
> > Yes, this needs to be documented.
>
> Ok. "it's used for serial in the bootwrapper" would have sufficed - I
> questioned it because it wasn't obvious that this was needed to use
> the mpsc.
Sorry :)
> >
> > > > + mpsc@8000 {
> > > > + device_type = "serial";
> > > > + compatible = "marvell,mpsc";
> > > > + reg = <8000 38>;
> > > > + virtual-reg = <f8108000>;
> > > > + sdma = <&/mv64x60/sdma@4000>;
> > > > + brg = <&/mv64x60/brg@b200>;
> > > > + cunit = <&/mv64x60/cunit@f200>;
> > > > + mpscrouting = <&/mv64x60/mpscrouting@b400>;
> > > > + mpscintr = <&/mv64x60/mpscintr@b800>;
> > > > + block-index = <0>;
> > >
> > > What is this block-index thing about here? Since the devices are
> > > disambiguated by their register address, why do you need it?
> >
> > This particular one is needed to access the correct MPSC interrupt reg.
> > Maybe it would be better to make a new property for this but it was only
> > one reg and block-index was already there and basically served that
> > purpose so I used it. I'd be happy to use an alternative if you have
> > something you think is better.
>
> No, that's an acceptable use for something like this, except that
> "cell-index" seems to be the name we've standardised on for other
> similar cases.
Yeah, I realize that but block-index was here first!
More seriously, I don't like "cell" because it isn't a cell, its a
block or an instance or an...I dunno but its not a cell IMHO.
Anyway, I'll think about changing it to cell but I already feel
dirty just thinking about it.
Mark
^ permalink raw reply
* [PATCH] Fix hardware IRQ time accounting problem.
From: Tony Breeds @ 2007-12-04 4:43 UTC (permalink / raw)
To: Paul Mackerras, LinuxPPC-dev, Linux Kernel ML
Cc: Johannes Berg, Frederik Himpe, linux-usb-devel
The commit fa13a5a1f25f671d084d8884be96fc48d9b68275, unconditionally calls
update_process_tick() in system context. In the deterministic accounting case
this is the correct thing to do. However, in the non-deterministic accounting
case we need to not do this, and results in the time accounted as
hardware irq time being artificially elevated.
Also this patch collapses 2 consecutive '#ifdef CONFIG_VIRT_CPU_ACCOUNTING'
checks in time.h into for neatness.
Signed-off-by: Tony Breeds <tony@bakeyournoodle.com>
---
The problem was seen and reported by Johannes Berg and Frederik Himpe.
Paul, I think this is good for 2.6.24.
arch/powerpc/kernel/process.c | 2 +-
include/asm-powerpc/time.h | 12 ++++--------
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 41e13f4..b9d8837 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -350,7 +350,7 @@ struct task_struct *__switch_to(struct task_struct *prev,
local_irq_save(flags);
account_system_vtime(current);
- account_process_tick(current, 0);
+ account_process_vtime(current);
calculate_steal_time();
last = _switch(old_thread, new_thread);
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index 780f826..8a2c8db 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -237,18 +237,14 @@ struct cpu_usage {
DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array);
-#ifdef CONFIG_VIRT_CPU_ACCOUNTING
-extern void account_process_vtime(struct task_struct *tsk);
-#else
-#define account_process_vtime(tsk) do { } while (0)
-#endif
-
#if defined(CONFIG_VIRT_CPU_ACCOUNTING)
extern void calculate_steal_time(void);
extern void snapshot_timebases(void);
+#define account_process_vtime(tsk) account_process_tick(current, 0);
#else
-#define calculate_steal_time() do { } while (0)
-#define snapshot_timebases() do { } while (0)
+#define calculate_steal_time() do { } while (0)
+#define snapshot_timebases() do { } while (0)
+#define account_process_vtime(tsk) do { } while (0)
#endif
extern void secondary_cpu_time_init(void);
--
1.5.3.6
Yours Tony
linux.conf.au http://linux.conf.au/ || http://lca2008.linux.org.au/
Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!
^ permalink raw reply related
* [PATCH 2.6.24] pasemi_mac: Fix reuse of free'd skb
From: Olof Johansson @ 2007-12-04 3:34 UTC (permalink / raw)
To: jgarzik; +Cc: ranger, netdev, dwmw2, linuxppc-dev
Turns out we're freeing the skb when we detect CRC error, but we're
not clearing out info->skb. We could either clear it and have the stack
reallocate it, or just leave it and the rx ring refill code will reuse
the one that was allocated.
Reusing a freed skb obviously caused some nasty crashes of various kind,
as reported by Brent Baude and David Woodhouse.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
Jeff, I'd like to see this in 2.6.24, it's causing some real problems
out there. It's not needed in the 2.6.25 queue since the other changes
there have already covered these cases.
My test network at home is quiet enough to not cause CRC errors, we
mainly get those during interface bringup before speed is configured.
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index 09b4fde..6617e24 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -586,7 +586,7 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit)
/* CRC error flagged */
mac->netdev->stats.rx_errors++;
mac->netdev->stats.rx_crc_errors++;
- dev_kfree_skb_irq(skb);
+ /* No need to free skb, it'll be reused */
goto next;
}
^ permalink raw reply related
* dtc: Add may const qualifications
From: David Gibson @ 2007-12-04 3:26 UTC (permalink / raw)
To: Jon Loeliger; +Cc: linuxppc-dev
This adds 'const' qualifiers to many variables and functions. In
particular it's now used for passing names to the tree accesor
functions.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Index: dtc/data.c
===================================================================
--- dtc.orig/data.c 2007-12-04 11:49:54.000000000 +1100
+++ dtc/data.c 2007-12-04 14:11:35.000000000 +1100
@@ -64,7 +64,7 @@ struct data data_grow_for(struct data d,
return nd;
}
-struct data data_copy_mem(char *mem, int len)
+struct data data_copy_mem(const char *mem, int len)
{
struct data d;
@@ -76,7 +76,7 @@ struct data data_copy_mem(char *mem, int
return d;
}
-static char get_oct_char(char *s, int *i)
+static char get_oct_char(const char *s, int *i)
{
char x[4];
char *endx;
@@ -98,7 +98,7 @@ static char get_oct_char(char *s, int *i
return val;
}
-static char get_hex_char(char *s, int *i)
+static char get_hex_char(const char *s, int *i)
{
char x[3];
char *endx;
@@ -117,7 +117,7 @@ static char get_hex_char(char *s, int *i
return val;
}
-struct data data_copy_escape_string(char *s, int len)
+struct data data_copy_escape_string(const char *s, int len)
{
int i = 0;
struct data d;
@@ -194,7 +194,7 @@ struct data data_copy_file(FILE *f, size
return d;
}
-struct data data_append_data(struct data d, void *p, int len)
+struct data data_append_data(struct data d, const void *p, int len)
{
d = data_grow_for(d, len);
memcpy(d.val + d.len, p, len);
@@ -237,7 +237,7 @@ struct data data_append_cell(struct data
return data_append_data(d, &beword, sizeof(beword));
}
-struct data data_append_re(struct data d, struct fdt_reserve_entry *re)
+struct data data_append_re(struct data d, const struct fdt_reserve_entry *re)
{
struct fdt_reserve_entry bere;
Index: dtc/dtc.c
===================================================================
--- dtc.orig/dtc.c 2007-12-04 11:49:55.000000000 +1100
+++ dtc/dtc.c 2007-12-04 14:16:51.000000000 +1100
@@ -30,7 +30,7 @@ int quiet; /* Level of quietness */
int reservenum; /* Number of memory reservation slots */
int minsize; /* Minimum blob size */
-char *join_path(char *path, char *name)
+char *join_path(const char *path, const char *name)
{
int lenp = strlen(path);
int lenn = strlen(name);
@@ -54,10 +54,10 @@ char *join_path(char *path, char *name)
return str;
}
-void fill_fullpaths(struct node *tree, char *prefix)
+void fill_fullpaths(struct node *tree, const char *prefix)
{
struct node *child;
- char *unit;
+ const char *unit;
tree->fullpath = join_path(prefix, tree->name);
@@ -109,11 +109,11 @@ static void __attribute__ ((noreturn))
int main(int argc, char *argv[])
{
struct boot_info *bi;
- char *inform = "dts";
- char *outform = "dts";
- char *outname = "-";
+ const char *inform = "dts";
+ const char *outform = "dts";
+ const char *outname = "-";
int force = 0, check = 0;
- char *arg;
+ const char *arg;
int opt;
FILE *inf = NULL;
FILE *outf = NULL;
Index: dtc/flattree.c
===================================================================
--- dtc.orig/flattree.c 2007-12-04 11:49:54.000000000 +1100
+++ dtc/flattree.c 2007-12-04 14:22:47.000000000 +1100
@@ -51,9 +51,9 @@ struct emitter {
void (*string)(void *, char *, int);
void (*align)(void *, int);
void (*data)(void *, struct data);
- void (*beginnode)(void *, char *);
- void (*endnode)(void *, char *);
- void (*property)(void *, char *);
+ void (*beginnode)(void *, const char *);
+ void (*endnode)(void *, const char *);
+ void (*property)(void *, const char *);
};
static void bin_emit_cell(void *e, cell_t val)
@@ -88,17 +88,17 @@ static void bin_emit_data(void *e, struc
*dtbuf = data_append_data(*dtbuf, d.val, d.len);
}
-static void bin_emit_beginnode(void *e, char *label)
+static void bin_emit_beginnode(void *e, const char *label)
{
bin_emit_cell(e, FDT_BEGIN_NODE);
}
-static void bin_emit_endnode(void *e, char *label)
+static void bin_emit_endnode(void *e, const char *label)
{
bin_emit_cell(e, FDT_END_NODE);
}
-static void bin_emit_property(void *e, char *label)
+static void bin_emit_property(void *e, const char *label)
{
bin_emit_cell(e, FDT_PROP);
}
@@ -113,14 +113,14 @@ static struct emitter bin_emitter = {
.property = bin_emit_property,
};
-static void emit_label(FILE *f, char *prefix, char *label)
+static void emit_label(FILE *f, const char *prefix, const char *label)
{
fprintf(f, "\t.globl\t%s_%s\n", prefix, label);
fprintf(f, "%s_%s:\n", prefix, label);
fprintf(f, "_%s_%s:\n", prefix, label);
}
-static void emit_offset_label(FILE *f, char *label, int offset)
+static void emit_offset_label(FILE *f, const char *label, int offset)
{
fprintf(f, "\t.globl\t%s\n", label);
fprintf(f, "%s\t= . + %d\n", label, offset);
@@ -191,7 +191,7 @@ static void asm_emit_data(void *e, struc
assert(off == d.len);
}
-static void asm_emit_beginnode(void *e, char *label)
+static void asm_emit_beginnode(void *e, const char *label)
{
FILE *f = e;
@@ -202,7 +202,7 @@ static void asm_emit_beginnode(void *e,
fprintf(f, "\t.long\tFDT_BEGIN_NODE\n");
}
-static void asm_emit_endnode(void *e, char *label)
+static void asm_emit_endnode(void *e, const char *label)
{
FILE *f = e;
@@ -213,7 +213,7 @@ static void asm_emit_endnode(void *e, ch
}
}
-static void asm_emit_property(void *e, char *label)
+static void asm_emit_property(void *e, const char *label)
{
FILE *f = e;
@@ -234,7 +234,7 @@ static struct emitter asm_emitter = {
.property = asm_emit_property,
};
-static int stringtable_insert(struct data *d, char *str)
+static int stringtable_insert(struct data *d, const char *str)
{
int i;
@@ -432,7 +432,7 @@ void dt_to_blob(FILE *f, struct boot_inf
static void dump_stringtable_asm(FILE *f, struct data strbuf)
{
- char *p;
+ const char *p;
int len;
p = strbuf.val;
@@ -450,7 +450,7 @@ void dt_to_asm(FILE *f, struct boot_info
int i;
struct data strbuf = empty_data;
struct reserve_info *re;
- char *symprefix = "dt";
+ const char *symprefix = "dt";
for (i = 0; i < ARRAY_SIZE(version_table); i++) {
if (version_table[i].version == version)
@@ -594,7 +594,7 @@ static void flat_realign(struct inbuf *i
static char *flat_read_string(struct inbuf *inb)
{
int len = 0;
- char *p = inb->ptr;
+ const char *p = inb->ptr;
char *str;
do {
@@ -631,7 +631,7 @@ static struct data flat_read_data(struct
static char *flat_read_stringtable(struct inbuf *inb, int offset)
{
- char *p;
+ const char *p;
p = inb->base + offset;
while (1) {
@@ -673,7 +673,7 @@ static struct reserve_info *flat_read_me
{
struct reserve_info *reservelist = NULL;
struct reserve_info *new;
- char *p;
+ const char *p;
struct fdt_reserve_entry re;
/*
@@ -698,9 +698,9 @@ static struct reserve_info *flat_read_me
}
-static char *nodename_from_path(char *ppath, char *cpath)
+static char *nodename_from_path(const char *ppath, const char *cpath)
{
- char *lslash;
+ const char *lslash;
int plen;
lslash = strrchr(cpath, '/');
@@ -724,9 +724,9 @@ static char *nodename_from_path(char *pp
static const char PROPCHAR[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,._+*#?-";
static const char UNITCHAR[] = "0123456789abcdef,";
-static int check_node_name(char *name)
+static int check_node_name(const char *name)
{
- char *atpos;
+ const char *atpos;
int basenamelen;
atpos = strrchr(name, '@');
@@ -748,7 +748,7 @@ static int check_node_name(char *name)
static struct node *unflatten_tree(struct inbuf *dtbuf,
struct inbuf *strbuf,
- char *parent_path, int flags)
+ const char *parent_path, int flags)
{
struct node *node;
u32 val;
Index: dtc/livetree.c
===================================================================
--- dtc.orig/livetree.c 2007-12-04 11:49:54.000000000 +1100
+++ dtc/livetree.c 2007-12-04 14:13:56.000000000 +1100
@@ -180,7 +180,7 @@ struct boot_info *build_boot_info(struct
* Tree accessor functions
*/
-char *get_unitname(struct node *node)
+const char *get_unitname(struct node *node)
{
if (node->name[node->basenamelen] == '\0')
return "";
@@ -188,7 +188,7 @@ char *get_unitname(struct node *node)
return node->name + node->basenamelen + 1;
}
-struct property *get_property(struct node *node, char *propname)
+struct property *get_property(struct node *node, const char *propname)
{
struct property *prop;
@@ -205,7 +205,7 @@ cell_t propval_cell(struct property *pro
return be32_to_cpu(*((cell_t *)prop->val.val));
}
-struct node *get_subnode(struct node *node, char *nodename)
+struct node *get_subnode(struct node *node, const char *nodename)
{
struct node *child;
@@ -216,9 +216,9 @@ struct node *get_subnode(struct node *no
return NULL;
}
-struct node *get_node_by_path(struct node *tree, char *path)
+struct node *get_node_by_path(struct node *tree, const char *path)
{
- char *p;
+ const char *p;
struct node *child;
if (!path || ! (*path))
@@ -275,7 +275,7 @@ struct node *get_node_by_phandle(struct
return NULL;
}
-struct node *get_node_by_ref(struct node *tree, char *ref)
+struct node *get_node_by_ref(struct node *tree, const char *ref)
{
if (ref[0] == '/')
return get_node_by_path(tree, ref);
Index: dtc/dtc.h
===================================================================
--- dtc.orig/dtc.h 2007-12-04 11:49:55.000000000 +1100
+++ dtc/dtc.h 2007-12-04 14:17:24.000000000 +1100
@@ -133,14 +133,14 @@ void data_free(struct data d);
struct data data_grow_for(struct data d, int xlen);
-struct data data_copy_mem(char *mem, int len);
-struct data data_copy_escape_string(char *s, int len);
+struct data data_copy_mem(const char *mem, int len);
+struct data data_copy_escape_string(const char *s, int len);
struct data data_copy_file(FILE *f, size_t len);
-struct data data_append_data(struct data d, void *p, int len);
+struct data data_append_data(struct data d, const void *p, int len);
struct data data_merge(struct data d1, struct data d2);
struct data data_append_cell(struct data d, cell_t word);
-struct data data_append_re(struct data d, struct fdt_reserve_entry *re);
+struct data data_append_re(struct data d, const struct fdt_reserve_entry *re);
struct data data_append_addr(struct data d, u64 addr);
struct data data_append_byte(struct data d, uint8_t byte);
struct data data_append_zeroes(struct data d, int len);
@@ -199,14 +199,14 @@ struct node *chain_node(struct node *fir
void add_property(struct node *node, struct property *prop);
void add_child(struct node *parent, struct node *child);
-char *get_unitname(struct node *node);
-struct property *get_property(struct node *node, char *propname);
+const char *get_unitname(struct node *node);
+struct property *get_property(struct node *node, const char *propname);
cell_t propval_cell(struct property *prop);
-struct node *get_subnode(struct node *node, char *nodename);
-struct node *get_node_by_path(struct node *tree, char *path);
+struct node *get_subnode(struct node *node, const char *nodename);
+struct node *get_node_by_path(struct node *tree, const char *path);
struct node *get_node_by_label(struct node *tree, const char *label);
struct node *get_node_by_phandle(struct node *tree, cell_t phandle);
-struct node *get_node_by_ref(struct node *tree, char *ref);
+struct node *get_node_by_ref(struct node *tree, const char *ref);
cell_t get_node_phandle(struct node *root, struct node *node);
/* Boot info (tree plus memreserve information */
@@ -255,11 +255,11 @@ struct boot_info *dt_from_source(const c
/* FS trees */
-struct boot_info *dt_from_fs(char *dirname);
+struct boot_info *dt_from_fs(const char *dirname);
/* misc */
-char *join_path(char *path, char *name);
-void fill_fullpaths(struct node *tree, char *prefix);
+char *join_path(const char *path, const char *name);
+void fill_fullpaths(struct node *tree, const char *prefix);
#endif /* _DTC_H */
Index: dtc/fstree.c
===================================================================
--- dtc.orig/fstree.c 2007-12-04 14:17:03.000000000 +1100
+++ dtc/fstree.c 2007-12-04 14:17:34.000000000 +1100
@@ -23,7 +23,7 @@
#include <dirent.h>
#include <sys/stat.h>
-static struct node *read_fstree(char *dirname)
+static struct node *read_fstree(const char *dirname)
{
DIR *d;
struct dirent *de;
@@ -80,7 +80,7 @@ static struct node *read_fstree(char *di
return tree;
}
-struct boot_info *dt_from_fs(char *dirname)
+struct boot_info *dt_from_fs(const char *dirname)
{
struct node *tree;
Index: dtc/treesource.c
===================================================================
--- dtc.orig/treesource.c 2007-12-04 14:18:20.000000000 +1100
+++ dtc/treesource.c 2007-12-04 14:18:46.000000000 +1100
@@ -58,7 +58,7 @@ int isstring(char c)
static void write_propval_string(FILE *f, struct data val)
{
- char *str = val.val;
+ const char *str = val.val;
int i;
int newchunk = 1;
struct marker *m = val.markers;
@@ -161,7 +161,7 @@ static void write_propval_cells(FILE *f,
static void write_propval_bytes(FILE *f, struct data val)
{
void *propend = val.val + val.len;
- char *bp = val.val;
+ const char *bp = val.val;
struct marker *m = val.markers;
fprintf(f, "[");
@@ -189,7 +189,7 @@ static void write_propval_bytes(FILE *f,
static void write_propval(FILE *f, struct property *prop)
{
int len = prop->val.len;
- char *p = prop->val.val;
+ const char *p = prop->val.val;
struct marker *m = prop->val.markers;
int nnotstring = 0, nnul = 0;
int nnotstringlbl = 0, nnotcelllbl = 0;
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply
* Re: [PATCH] [POWERPC] [v2] Improved documentation of device tree 'ranges'.
From: Grant Likely @ 2007-12-04 3:22 UTC (permalink / raw)
To: Stephen Neuendorffer, grant.likely, linuxppc-dev
In-Reply-To: <20071204024025.GG32577@localhost.localdomain>
On 12/3/07, David Gibson <david@gibson.dropbear.id.au> wrote:
>
> On Mon, Dec 03, 2007 at 05:08:57PM -0800, Stephen Neuendorffer wrote:
> > I was misled by the prior language. I've attempted to clarify how
> > 'ranges' are used, in particular, how to get an identity mapping.
> >
> > Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
>
> Acked-by: David Gibson <david@gibson.dropbear.id.au>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
>
> Thanks for the update. I particularly dislike the "1:1" terminology,
> because in maths-speak *any* ranges translation is 1:1, unless it
> includes overlapping ranges.
>
> --
> David Gibson | I'll have my music baroque, and my code
> david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
> | _way_ _around_!
> http://www.ozlabs.org/~dgibson
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* Re: [PATCH 2/2] [POWERPC] Use of_register_driver to implement of_register_platform_driver
From: Stephen Rothwell @ 2007-12-04 3:11 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
[-- Attachment #1: Type: text/plain, Size: 221 bytes --]
Hi Paul,
Is there some reason http://patchwork.ozlabs.org/linuxppc/patch?id=14223
should not be in 2.6.25?
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: Merge dtc
From: David Gibson @ 2007-12-04 3:10 UTC (permalink / raw)
To: David Woodhouse; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <1196733544.13978.201.camel@pmac.infradead.org>
On Tue, Dec 04, 2007 at 01:59:04AM +0000, David Woodhouse wrote:
>
> On Tue, 2007-10-16 at 15:02 +1000, David Gibson wrote:
> > This very large patch incorporates a copy of dtc into the kernel
> > source, in arch/powerpc/boot/dtc-src. This means that dtc is no
> > longer an external dependency to build kernels with configurations
> > which need a dtb file.
> >
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> >
> > Too big for the list, full patch at
> > http://ozlabs.org/~dgibson/home/merge-dtc.patch
>
> I think this is a bad idea -- it's hardly a difficult for those people
> who _do_ need dts to obtain it separately.
>
> It's bad enough that I have to separate out the bootwrapper code, which
> probably ought to live outside the kernel. We shouldn't be merging
> _more_ stuff in.
We've been back and forth on this several times, Paul and I finally
concluded this was the better option.
It means we can feel free to use dtc for whatever new platforms we
wish to without people whinging about having to install a new tool.
And it means as dtc evolves to have new useful features, we just need
to ensure that the dts files in the kernel are buildable with the dtc
in the kernel, rather than requireing people to keep updating their
dtc to match what the kernel build needs.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply
* iSeries_defconfig update
From: Stephen Rothwell @ 2007-12-04 3:06 UTC (permalink / raw)
To: paulus; +Cc: ppc-dev
[-- Attachment #1: Type: text/plain, Size: 248 bytes --]
Hi Paul,
I think http://patchwork.ozlabs.org/linuxppc/patch?id=14835 should go
into 2.6.24 (along with some other defconfig updates).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH 1/5] PowerPC 74xx: Katana Qp device tree
From: David Gibson @ 2007-12-04 2:50 UTC (permalink / raw)
To: Mark A. Greer; +Cc: linuxppc-dev
In-Reply-To: <20071204021026.GB18903@mag.az.mvista.com>
On Mon, Dec 03, 2007 at 07:10:26PM -0700, Mark A. Greer wrote:
> On Mon, Dec 03, 2007 at 12:50:18PM +1100, David Gibson wrote:
> > On Thu, Nov 29, 2007 at 06:28:36PM +0300, Andrei Dolnikov wrote:
[snip]
> > > + ethernet@2000 {
> > > + reg = <2000 2000>;
> >
> > Are the registers for the 3 ethernets really all together? This bank
> > can't be subdivided into seperate register blocks for each MAC?
>
> Unfortunately there are some registers that are shared so you can't
> divide them up nicely.
Ok, fair enough then. But, see below..
> > > + eth0 {
> > > + device_type = "network";
> > > + compatible = "marvell,mv64x60-eth";
> > > + block-index = <0>;
> >
> > This block-index thing is crap. If you really need to subindex nodes
> > like this, use "reg", with an appropriate #address-cells in the
> > parent, then the nodes will also get sensible unit addresses.
>
> So how would that work for the "PHY Address Register 0x2000", say,
> where bits 0-4 set the device addr for PHY 0; bits 5-9 set the device
> addr for PHY 1; bts 10-14 set the devce addr for PHY 2?
So use 'reg' to do the indexing. As long as you have no 'ranges'
property in the parent 'ethernet' node, which you don't, you can use
'reg' as a private index. That's basically what non-translatable reg
values are about.
Incidentally you should probably call the subnodes "ethernet@0"
etc. and the parent one "multiethernet" or something. It's the
subnodes that represent an individual ethernet interface, so they
should take the "ethernet" name and not the parent, by generic names
conventions.
[snip]
> > > + sdma@4000 {
> > > + compatible = "marvell,mv64x60-sdma";
> > > + reg = <4000 c18>;
> > > + virtual-reg = <f8104000>;
> >
> > Why does this node have virtual-reg?
>
> "virtual-reg" is a special property that doesn't get translated thru
> the parent mappings. It should never be used in the kernel. Its
> purpose is to give code in the bootwrapper the exact address that it
> should use to access a register or block of registers or ...
> Its needed here because the MPSC (serial) driver uses the SDMA unit
> to perform console I/O in the bootwrapper (e.g., cmdline editing, printf's).
>
> Yes, this needs to be documented.
Ok. "it's used for serial in the bootwrapper" would have sufficed - I
questioned it because it wasn't obvious that this was needed to use
the mpsc.
>
> > > + mpsc@8000 {
> > > + device_type = "serial";
> > > + compatible = "marvell,mpsc";
> > > + reg = <8000 38>;
> > > + virtual-reg = <f8108000>;
> > > + sdma = <&/mv64x60/sdma@4000>;
> > > + brg = <&/mv64x60/brg@b200>;
> > > + cunit = <&/mv64x60/cunit@f200>;
> > > + mpscrouting = <&/mv64x60/mpscrouting@b400>;
> > > + mpscintr = <&/mv64x60/mpscintr@b800>;
> > > + block-index = <0>;
> >
> > What is this block-index thing about here? Since the devices are
> > disambiguated by their register address, why do you need it?
>
> This particular one is needed to access the correct MPSC interrupt reg.
> Maybe it would be better to make a new property for this but it was only
> one reg and block-index was already there and basically served that
> purpose so I used it. I'd be happy to use an alternative if you have
> something you think is better.
No, that's an acceptable use for something like this, except that
"cell-index" seems to be the name we've standardised on for other
similar cases.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply
* Re: [PATCH] [POWERPC] [v2] Improved documentation of device tree 'ranges'.
From: David Gibson @ 2007-12-04 2:40 UTC (permalink / raw)
To: Stephen Neuendorffer; +Cc: linuxppc-dev
In-Reply-To: <20071204010818.AD4231798062@mail212-sin.bigfish.com>
On Mon, Dec 03, 2007 at 05:08:57PM -0800, Stephen Neuendorffer wrote:
> I was misled by the prior language. I've attempted to clarify how
> 'ranges' are used, in particular, how to get an identity mapping.
>
> Signed-off-by: Stephen Neuendorffer <stephen.neuendorffer@xilinx.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Thanks for the update. I particularly dislike the "1:1" terminology,
because in maths-speak *any* ranges translation is 1:1, unless it
includes overlapping ranges.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply
* RE: [PATCH] ipic: change ack operation that register is accessedonly when needed
From: Benjamin Herrenschmidt @ 2007-12-04 2:15 UTC (permalink / raw)
To: Li Yang; +Cc: linuxppc-dev
In-Reply-To: <989B956029373F45A0B8AF029708189001B4D2DE@zch01exm26.fsl.freescale.net>
On Tue, 2007-12-04 at 10:06 +0800, Li Yang wrote:
> > That should be handled by the higher level flow handler. The
> > generic edge one calls ack and the level one mask_and_ack.
> > Just make them do the right thing, no need to test for the
> > flow type in the low level function.
>
> But actually ack is called by edge and per cpu handlers. Mask_and_ack
> is also called by edge handler when the same interrupt is already in
> progress. So I don't think that ack/mask_and_ack implicates flow type
> by design.
They do and you can pass different irq_chip with different mask/ack
routines if necessary.
Ben.
^ permalink raw reply
* Re: [PATCH 1/5] PowerPC 74xx: Katana Qp device tree
From: Benjamin Herrenschmidt @ 2007-12-04 2:14 UTC (permalink / raw)
To: Mark A. Greer; +Cc: linuxppc-dev
In-Reply-To: <20071204012329.GA18903@mag.az.mvista.com>
.../... (snip scary bunch of errata)
> - "FEr PCI-#4" (Detailed by Application Note AN-84):
>
> [This isn't strictly a coherency issue but having coherency enabled
> exacerbates the problem.] Basically, the bridge can let the cpu read
> a pci device's registers before all of the data the PCI devices has
> written has actually made it to memory. This and the fact that the
> device's write data may be stuck in the PCI Slave Write Buffer
> (which isn't checked for coherency), the cpu can get stale data.
>
> There are no plans to fix that erratum.
So if I understand correctly, there's no plan to fix a major PCI spec
violation which prevent any kind of reliable implementation whatsoever ?
Or rather... the part just doesn't work, period. Don't use it. If you
do, you're on your own.
> - "FEr PCI-#5" (Detailed by Application Note AN-85):
>
> With certain PCI devices and with coherency enabled, some combinations
> of PCI transactions can cause a deadlock. There is a workaround
> documented but I've tried it and it didn't work for me (but I can't be
> sure that was the erratum I was bumping into).
>
> There are no plans to fix that erratum.
Yeah... great. Oh well, Paul, what about we just don't support people
using that chip ?
> So, the answer depends on what part & what rev of the part you have
> (e.g., the pegasos doesn't use the MPSC and apparently has the other
> issues worked around so it can turn on coherency but the prpmc2800
> doesn't so it needs coherency off).
>
> BTW, I haven't forgotten the inherent bug you described when coherency
> is off (/me too lazy to find link to the email) but AFAIK I've never run
> into it. However, if I turn on coherency and stress the PCI bus, it
> hangs (I can't even look at memory thru a bdi).
Well, as it is today, the "classic" MMU code cannot deal with !coherent.
The entire linear mapping is always mapped cacheable with BATs, so stuff
may be brought into the cache at any time, potentially polluting DMA
data.
Dealing with that would be hard. It might be possible by using G on the
entire linear mapping like we do on 4xx (yuck), and/or by not using
D-BATs (the kernel will blow up in various areas without I-BATs).
Ben.
^ 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