MIPS: disable MMID when not supported by the hardware
authorGregory CLEMENT <gregory.clement@bootlin.com>
Thu, 10 Jul 2025 14:54:42 +0000 (16:54 +0200)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Wed, 16 Jul 2025 16:34:36 +0000 (18:34 +0200)
commit07f8888ee7df5189e64839abb26842dc6c2da371
tree3a9e9e124302fff919ceec0471f1a1c791d20fe2
parentca943354f2ccb82bb7c73c2e8d5eb355b102f75e
MIPS: disable MMID when not supported by the hardware

It is possible that MMID is supported at the CPU level, but its
integration in a SoC prevents its usage. For instance, if the
System-level Interconnect (also known as Network on Chip) does not
support global invalidation, then the MMID feature is not usable. The
current implementation of MMID relies on the GINV* instructions.

This patch allows the disabling of MMID based on a device tree
property, as this issue cannot be detected at runtime.

MMID is set up very early during the boot process, even before device
tree data can be accessed. Therefore, when we determine whether MMID
needs to be disabled, some MMID setup has already been performed for
the boot CPU. Consequently, we must revert the MMID setup on the first
CPU before disabling the feature for the subsequent CPUs that will be
initialized later.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/include/asm/cpu-info.h
arch/mips/kernel/cpu-probe.c
arch/mips/kernel/mips-cm.c