hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/mips/kernel/time.c
....@@ -1,14 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright 2001 MontaVista Software Inc.
34 * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
45 * Copyright (c) 2003, 2004 Maciej W. Rozycki
56 *
67 * Common time service routines for MIPS machines.
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the
10
- * Free Software Foundation; either version 2 of the License, or (at your
11
- * option) any later version.
128 */
139 #include <linux/bug.h>
1410 #include <linux/clockchips.h>
....@@ -40,8 +36,10 @@
4036 static int cpufreq_callback(struct notifier_block *nb,
4137 unsigned long val, void *data)
4238 {
43
- int cpu;
4439 struct cpufreq_freqs *freq = data;
40
+ struct cpumask *cpus = freq->policy->cpus;
41
+ unsigned long lpj;
42
+ int cpu;
4543
4644 /*
4745 * Skip lpj numbers adjustment if the CPU-freq transition is safe for
....@@ -62,7 +60,6 @@
6260 }
6361 }
6462
65
- cpu = freq->cpu;
6663 /*
6764 * Adjust global lpj variable and per-CPU udelay_val number in
6865 * accordance with the new CPU frequency.
....@@ -73,8 +70,12 @@
7370 glb_lpj_ref_freq,
7471 freq->new);
7572
76
- cpu_data[cpu].udelay_val = cpufreq_scale(per_cpu(pcp_lpj_ref, cpu),
77
- per_cpu(pcp_lpj_ref_freq, cpu), freq->new);
73
+ for_each_cpu(cpu, cpus) {
74
+ lpj = cpufreq_scale(per_cpu(pcp_lpj_ref, cpu),
75
+ per_cpu(pcp_lpj_ref_freq, cpu),
76
+ freq->new);
77
+ cpu_data[cpu].udelay_val = (unsigned int)lpj;
78
+ }
7879 }
7980
8081 return NOTIFY_OK;
....@@ -140,15 +141,10 @@
140141 case CPU_R4400MC:
141142 /*
142143 * The published errata for the R4400 up to 3.0 say the CPU
143
- * has the mfc0 from count bug.
144
+ * has the mfc0 from count bug. This seems the last version
145
+ * produced.
144146 */
145
- if ((current_cpu_data.processor_id & 0xff) <= 0x30)
146
- return 1;
147
-
148
- /*
149
- * we assume newer revisions are ok
150
- */
151
- return 0;
147
+ return 1;
152148 }
153149
154150 return 0;