“5fdc4feffe0f6cc4cb550dc849fa6d34c2a69578”上不存在“src/git@gitcode.net:mxj588love/VueJS.git”
提交 e38cdccf 编写于 作者: H Hang Xiaoqian 提交者: guzitao

sw64: switch to generic calibrate_delay()

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG

--------------------------------

There is no need to use per cpu loops_per_jiffy, so we
remove loops_per_jiffy from struct cpuinfo_sw64.
Signed-off-by: NHang Xiaoqian <hangxiaoqian@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 50f49674
...@@ -142,6 +142,10 @@ config ARCH_HAS_ILOG2_U64 ...@@ -142,6 +142,10 @@ config ARCH_HAS_ILOG2_U64
config GENERIC_GPIO config GENERIC_GPIO
bool bool
config GENERIC_CALIBRATE_DELAY
bool
default y
config ZONE_DMA32 config ZONE_DMA32
bool bool
default y default y
......
...@@ -18,7 +18,6 @@ struct cache_desc { ...@@ -18,7 +18,6 @@ struct cache_desc {
}; };
struct cpuinfo_sw64 { struct cpuinfo_sw64 {
unsigned long loops_per_jiffy;
unsigned long last_asn; unsigned long last_asn;
unsigned long ipi_count; unsigned long ipi_count;
struct cache_desc icache; /* Primary I-cache */ struct cache_desc icache; /* Primary I-cache */
......
...@@ -143,7 +143,6 @@ EXPORT_SYMBOL(screen_info); ...@@ -143,7 +143,6 @@ EXPORT_SYMBOL(screen_info);
*/ */
void store_cpu_data(int cpu) void store_cpu_data(int cpu)
{ {
cpu_data[cpu].loops_per_jiffy = loops_per_jiffy;
cpu_data[cpu].last_asn = ASN_FIRST_VERSION; cpu_data[cpu].last_asn = ASN_FIRST_VERSION;
} }
......
...@@ -374,18 +374,8 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle) ...@@ -374,18 +374,8 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
void __init native_smp_cpus_done(unsigned int max_cpus) void __init native_smp_cpus_done(unsigned int max_cpus)
{ {
int cpu;
unsigned long bogosum = 0;
for (cpu = 0; cpu < NR_CPUS; cpu++)
if (cpu_online(cpu))
bogosum += cpu_data[cpu].loops_per_jiffy;
smp_booted = 1; smp_booted = 1;
pr_info("SMP: Total of %d processors activated (%lu.%02lu BogoMIPS).\n", pr_info("SMP: Total of %d processors activated.\n", num_online_cpus());
num_online_cpus(),
(bogosum + 2500) / (500000/HZ),
((bogosum + 2500) / (5000/HZ)) % 100);
} }
int setup_profiling_timer(unsigned int multiplier) int setup_profiling_timer(unsigned int multiplier)
......
...@@ -111,14 +111,8 @@ time_init(void) ...@@ -111,14 +111,8 @@ time_init(void)
of_clk_init(NULL); of_clk_init(NULL);
/* Startup the timer source. */ /* Startup the timer source. */
setup_timer(); setup_timer();
} /* Calibrate the delay loop directly */
lpj_fine = cycle_freq / HZ;
void calibrate_delay(void)
{
loops_per_jiffy = get_cpu_freq() / HZ;
pr_info("Clock rate yields %lu.%02lu BogoMIPS (lpj=%lu)\n",
loops_per_jiffy / (500000 / HZ),
(loops_per_jiffy / (5000 / HZ)) % 100, loops_per_jiffy);
} }
static void __init calibrate_sched_clock(void) static void __init calibrate_sched_clock(void)
......
...@@ -28,12 +28,6 @@ void __delay(unsigned long loops) ...@@ -28,12 +28,6 @@ void __delay(unsigned long loops)
} }
EXPORT_SYMBOL(__delay); EXPORT_SYMBOL(__delay);
#ifdef CONFIG_SMP
#define LPJ cpu_data[smp_processor_id()].loops_per_jiffy
#else
#define LPJ loops_per_jiffy
#endif
void udelay(unsigned long usecs) void udelay(unsigned long usecs)
{ {
unsigned long loops = usecs * get_cpu_freq() / 1000000; unsigned long loops = usecs * get_cpu_freq() / 1000000;
......
...@@ -40,10 +40,8 @@ static int sw64_cpu_freq_notifier(struct notifier_block *nb, ...@@ -40,10 +40,8 @@ static int sw64_cpu_freq_notifier(struct notifier_block *nb,
unsigned long cpu; unsigned long cpu;
for_each_online_cpu(cpu) { for_each_online_cpu(cpu) {
if (val == CPUFREQ_POSTCHANGE) { if (val == CPUFREQ_POSTCHANGE)
sw64_update_clockevents(cpu, freqs->new * 1000); sw64_update_clockevents(cpu, freqs->new * 1000);
current_cpu_data.loops_per_jiffy = loops_per_jiffy;
}
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册