LoongArch: Correct the definitions related to CSR_CPUID_COREID{_WIDTH}
PATCH 1/1 LoongArch: Correct the definitions related to CSR_CPUID_COREID{_WIDTH}
The valid bits of CPU Identity (CPUID) are 0 to 8 according to LoongArch Reference Manual, so change 11 to 9 for the related code.
--- arch/loongarch/include/asm/loongarch.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/loongarch/include/asm/loongarch.h +2 -2
@@ -429,8 +429,8 @@/* Config CSR registers */ #define LOONGARCH_CSR_CPUID 0x20/* CPU core id */ -#define CSR_CPUID_COREID_WIDTH 11 -#define CSR_CPUID_COREID _ULCAST_(0x7ff) +#define CSR_CPUID_COREID_WIDTH 9 +#define CSR_CPUID_COREID _ULCAST_(0x1ff)#define LOONGARCH_CSR_PRCFG1 0x21/* Config1 */ #define CSR_CONF1_VSMAX_SHIFT 12
Signature · 1 line
2.20.1
Huacai Chen
maintainerCan you do some investigation about the history before coding? 9559d5806319a9254d9053b22a31324e1929aac ("LoongArch: Increase max supported CPUs up to 2048")
Huacai
Quoted 30 lines · Qiang Ma
The valid bits of CPU Identity (CPUID) are 0 to 8 according to LoongArch Reference Manual, so change 11 to 9 for the related code.
Signed-off-by Qiang Ma <[email protected]>--- arch/loongarch/include/asm/loongarch.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/loongarch/include/asm/loongarch.h +2
-3@@ -429,8 +429,8 @@/* Config CSR registers */ #define LOONGARCH_CSR_CPUID 0x20/* CPU core id */ -#define CSR_CPUID_COREID_WIDTH 11 -#define CSR_CPUID_COREID _ULCAST_(0x7ff) +#define CSR_CPUID_COREID_WIDTH 9 +#define CSR_CPUID_COREID _ULCAST_(0x1ff)#define LOONGARCH_CSR_PRCFG1 0x21/* Config1 */ #define CSR_CONF1_VSMAX_SHIFT 12 --2.20.1
Quoted 3 lines · Huacai Chen
Can you do some investigation about the history before coding?
9559d5806319a9254d9053b22a31324e1929aac("LoongArch: Increase max supported CPUs up to 2048")
Uh, uh, uh, my fault. I'll be more careful next time. Besides the document, there's also the code history submission.
Quoted 33 lines
Huacai
Quoted 29 lines · Qiang Ma
The valid bits of CPU Identity (CPUID) are 0 to 8 according to LoongArch Reference Manual, so change 11 to 9 for the related code.
Signed-off-by Qiang Ma <[email protected]>--- arch/loongarch/include/asm/loongarch.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/loongarch/include/asm/loongarch.h +2
-3@@ -429,8 +429,8 @@/* Config CSR registers */ #define LOONGARCH_CSR_CPUID 0x20/* CPU core id */ -#define CSR_CPUID_COREID_WIDTH 11 -#define CSR_CPUID_COREID _ULCAST_(0x7ff) +#define CSR_CPUID_COREID_WIDTH 9 +#define CSR_CPUID_COREID _ULCAST_(0x1ff)#define LOONGARCH_CSR_PRCFG1 0x21/* Config1 */ #define CSR_CONF1_VSMAX_SHIFT 12 --2.20.1