linux/arch/mips
Maciej W. Rozycki f0a6c68f69 MIPS: Fix CP0 counter erratum detection for R4k CPUs
Fix the discrepancy between the two places we check for the CP0 counter
erratum in along with the incorrect comparison of the R4400 revision
number against 0x30 which matches none and consistently consider all
R4000 and R4400 processors affected, as documented in processor errata
publications[1][2][3], following the mapping between CP0 PRId register
values and processor models:

  PRId   |  Processor Model
---------+--------------------
00000422 | R4000 Revision 2.2
00000430 | R4000 Revision 3.0
00000440 | R4400 Revision 1.0
00000450 | R4400 Revision 2.0
00000460 | R4400 Revision 3.0

No other revision of either processor has ever been spotted.

Contrary to what has been stated in commit ce202cbb9e ("[MIPS] Assume
R4000/R4400 newer than 3.0 don't have the mfc0 count bug") marking the
CP0 counter as buggy does not preclude it from being used as either a
clock event or a clock source device.  It just cannot be used as both at
a time, because in that case clock event interrupts will be occasionally
lost, and the use as a clock event device takes precedence.

Compare against 0x4ff in `can_use_mips_counter' so that a single machine
instruction is produced.

References:

[1] "MIPS R4000PC/SC Errata, Processor Revision 2.2 and 3.0", MIPS
    Technologies Inc., May 10, 1994, Erratum 53, p.13

[2] "MIPS R4400PC/SC Errata, Processor Revision 1.0", MIPS Technologies
    Inc., February 9, 1994, Erratum 21, p.4

[3] "MIPS R4400PC/SC Errata, Processor Revision 2.0 & 3.0", MIPS
    Technologies Inc., January 24, 1995, Erratum 14, p.3

Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Fixes: ce202cbb9e ("[MIPS] Assume R4000/R4400 newer than 3.0 don't have the mfc0 count bug")
Cc: stable@vger.kernel.org # v2.6.24+
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2022-04-29 15:52:00 +02:00
..
alchemy mips: alchemy: remove historic comment on gpio build constraints 2021-12-16 15:48:32 +01:00
ar7
ath25 MIPS: ath25: Constify static irq_domain_ops 2022-02-22 09:39:03 +01:00
ath79 MIPS: Remove redundant definitions of device_tree_init() 2022-03-14 15:09:02 +01:00
bcm47xx MIPS: BCM47XX: Add support for Netgear WN2500RP v1 & v2 2022-01-09 15:41:50 +01:00
bcm63xx linux-watchdog 5.17-rc1 tag 2022-01-17 08:07:57 +02:00
bmips MIPS: bmips: Remove obsolete DMA mapping support 2022-01-11 11:55:41 +01:00
boot Staging driver update for 5.18-rc1 2022-03-28 12:50:50 -07:00
cavium-octeon MIPS: OCTEON: Constify static irq_domain_ops 2022-02-22 09:38:50 +01:00
cobalt
configs - added support for QCN550x (ath79) 2022-03-25 09:35:19 -07:00
crypto MIPS: crypto: Fix CRC32 code 2022-04-01 10:19:03 +02:00
dec DEC: Limit PMAX memory probing to R3k systems 2022-03-07 13:10:44 +01:00
fw
generic MIPS: new Kconfig option ZBOOT_LOAD_ADDRESS 2022-01-02 14:17:30 +01:00
include MIPS: Fix CP0 counter erratum detection for R4k CPUs 2022-04-29 15:52:00 +02:00
ingenic
jazz
kernel MIPS: Fix CP0 counter erratum detection for R4k CPUs 2022-04-29 15:52:00 +02:00
kvm ARM: 2022-02-05 09:55:59 -08:00
lantiq MIPS: lantiq: check the return value of kzalloc() 2022-03-30 20:25:48 +02:00
lib MIPS: Only use current_stack_pointer on GCC 2022-03-14 15:02:53 +01:00
loongson2ef MIPS: Loongson{2ef,64}: Wrap -mno-branch-likely with cc-option 2022-02-07 18:30:12 +01:00
loongson32
loongson64 MIPS: Fix build error for loongson64 and sgi-ip27 2022-03-24 09:45:15 +01:00
math-emu
mm MIPS: Sanitise Cavium switch cases in TLB handler synthesizers 2022-03-07 13:11:03 +01:00
mti-malta MIPS: Remove redundant definitions of device_tree_init() 2022-03-14 15:09:02 +01:00
n64
net Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2021-12-10 15:56:13 -08:00
pci pci-v5.18-changes 2022-03-25 13:02:05 -07:00
pic32 MIPS: Remove redundant definitions of device_tree_init() 2022-03-14 15:09:02 +01:00
power
ralink Staging driver update for 5.18-rc1 2022-03-28 12:50:50 -07:00
rb532 MIPS: rb532: move GPIOD definition into C-files 2022-03-30 20:26:26 +02:00
sgi-ip22 mips: sgi-ip22: add a check for the return of kzalloc() 2022-03-30 20:25:11 +02:00
sgi-ip27 MIPS: Fix build error for loongson64 and sgi-ip27 2022-03-24 09:45:15 +01:00
sgi-ip30 memblock: rename memblock_free to memblock_phys_free 2021-11-06 13:30:41 -07:00
sgi-ip32 MIPS: Allow modules to set board_be_handler 2021-11-09 16:07:26 +01:00
sibyte MIPS: sibyte: Add missing __user annotations in sb_tbprof.c 2022-02-22 09:36:04 +01:00
sni MIPS: sni: Fix the build 2021-10-18 18:09:54 +02:00
tools
txx9 MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
vdso mips: Enable KCSAN 2022-02-07 18:31:57 +01:00
vr41xx
Kbuild kbuild: use more subdir- for visiting subdirectories while cleaning 2021-10-24 13:49:46 +09:00
Kbuild.platforms MIPS: Remove TX39XX support 2022-03-01 10:07:22 +01:00
Kconfig MIPS: Fix build error for loongson64 and sgi-ip27 2022-03-24 09:45:15 +01:00
Kconfig.debug
Makefile mips: Always permit to build u-boot images 2022-03-07 13:11:20 +01:00
Makefile.postlink