.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright 2001 MontaVista Software Inc. |
---|
3 | 4 | * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net |
---|
4 | 5 | * Copyright (c) 2003, 2004 Maciej W. Rozycki |
---|
5 | 6 | * |
---|
6 | 7 | * 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. |
---|
12 | 8 | */ |
---|
13 | 9 | #include <linux/bug.h> |
---|
14 | 10 | #include <linux/clockchips.h> |
---|
.. | .. |
---|
40 | 36 | static int cpufreq_callback(struct notifier_block *nb, |
---|
41 | 37 | unsigned long val, void *data) |
---|
42 | 38 | { |
---|
43 | | - int cpu; |
---|
44 | 39 | struct cpufreq_freqs *freq = data; |
---|
| 40 | + struct cpumask *cpus = freq->policy->cpus; |
---|
| 41 | + unsigned long lpj; |
---|
| 42 | + int cpu; |
---|
45 | 43 | |
---|
46 | 44 | /* |
---|
47 | 45 | * Skip lpj numbers adjustment if the CPU-freq transition is safe for |
---|
.. | .. |
---|
62 | 60 | } |
---|
63 | 61 | } |
---|
64 | 62 | |
---|
65 | | - cpu = freq->cpu; |
---|
66 | 63 | /* |
---|
67 | 64 | * Adjust global lpj variable and per-CPU udelay_val number in |
---|
68 | 65 | * accordance with the new CPU frequency. |
---|
.. | .. |
---|
73 | 70 | glb_lpj_ref_freq, |
---|
74 | 71 | freq->new); |
---|
75 | 72 | |
---|
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 | + } |
---|
78 | 79 | } |
---|
79 | 80 | |
---|
80 | 81 | return NOTIFY_OK; |
---|
.. | .. |
---|
140 | 141 | case CPU_R4400MC: |
---|
141 | 142 | /* |
---|
142 | 143 | * 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. |
---|
144 | 146 | */ |
---|
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; |
---|
152 | 148 | } |
---|
153 | 149 | |
---|
154 | 150 | return 0; |
---|