Skip to content

Commit c171186

Browse files
FlyGoattsbogend
authored andcommitted
MIPS: csrc-r4k: Refine rating computation
Increase frequency addend dividend to 10000000 (10MHz) to reasonably accommodate multi GHz level mips_hpt_frequency. Cap rating of csrc-r4k into 299 to ensure it doesn't go into "Desired" range, given all the drama we have with CP0 count registers (SMP sync, behaviour on wait etc). Signed-off-by: Jiaxun Yang <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 04f38d1 commit c171186

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/mips/kernel/csrc-r4k.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ int __init init_r4k_clocksource(void)
111111
return -ENXIO;
112112

113113
/* Calculate a somewhat reasonable rating value */
114-
clocksource_mips.rating = 200 + mips_hpt_frequency / 10000000;
114+
clocksource_mips.rating = 200;
115+
clocksource_mips.rating += clamp(mips_hpt_frequency / 10000000, 0, 99);
115116

116117
/*
117118
* R2 onwards makes the count accessible to user mode so it can be used

0 commit comments

Comments
 (0)