Skip to contentSkip to conversation

Alchemy: override loops_per_jiffy detection

PATCH Applied Manuel Lauss 2 participants 2 messages Aug 27, 2009 – Aug 28, 2009 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Alchemy: override loops_per_jiffy detection

loops_per_jiffy depends on coreclk speed; preset it instead of letting the kernel waste precious microseconds trying to approximate it.

---
V2: no need to exclude MACH_ALCHEMY from GENERIC_CALIBRATE_DELAY
setting preset_lpj early is enough.

As always, run-tested on DB1200 and another Au1200 system.

 arch/mips/alchemy/common/setup.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/mips/alchemy/common/setup.c +4 -0
index 3f036b3..6184baa 100644
@@ -27,6 +27,7 @@
 
 #include <linux/init.h>
 #include <linux/ioport.h>
+#include <linux/jiffies.h>
 #include <linux/module.h>
 #include <linux/pm.h>
 
@@ -53,6 +54,9 @@ void __init plat_mem_setup(void)
 	printk(KERN_INFO "(PRId %08x) @ %lu.%02lu MHz\n", read_c0_prid(),
 	       est_freq / 1000000, ((est_freq % 1000000) * 100) / 1000000);
 
+	/* this is faster than wasting cycles trying to approximate it */
+	preset_lpj = (est_freq >> 1) / HZ;
+
 	_machine_restart = au1000_restart;
 	_machine_halt = au1000_halt;
 	pm_power_off = au1000_power_off;
Signature · 1 line
1.6.4
Applied
#1 lore raw
Quoted 4 lines · Manuel Lauss

loops_per_jiffy depends on coreclk speed; preset it instead of letting the kernel waste precious microseconds trying to approximate it.

Thanks, applied.

Ralf