--- a/arch/mips/include/asm/mips-cps.h
+++ b/arch/mips/include/asm/mips-cps.h
-@@ -10,6 +10,8 @@
+@@ -11,6 +11,8 @@
#include <linux/io.h>
#include <linux/types.h>
extern unsigned long __cps_access_bad_size(void)
__compiletime_error("Bad size for CPS accessor");
-@@ -165,11 +167,30 @@ static inline uint64_t mips_cps_cluster_
+@@ -162,12 +164,31 @@ static inline uint64_t mips_cps_cluster_
*/
static inline unsigned int mips_cps_numcores(unsigned int cluster)
{
return 0;
/* Add one before masking to handle 0xff indicating no cores */
-- return (mips_cps_cluster_config(cluster) + 1) & CM_GCR_CONFIG_PCORES;
-+ ncores = (mips_cps_cluster_config(cluster) + 1) & CM_GCR_CONFIG_PCORES;
+- return FIELD_GET(CM_GCR_CONFIG_PCORES,
++ ncores = FIELD_GET(CM_GCR_CONFIG_PCORES,
+ mips_cps_cluster_config(cluster) + 1);
+
+ if (IS_ENABLED(CONFIG_SOC_MT7621)) {
+ struct cpulaunch *launch;