Skip to content

Commit eeeeaaf

Browse files
committed
LoongArch: Use correct accessor to read FWPC/MWPC
CSR.FWPC and CSR.MWPC are 32bit registers, so use csr_read32() rather than csr_read64() to read the values of FWPC/MWPC. Cc: stable@vger.kernel.org Fixes: edffa33 ("LoongArch: Add hardware breakpoints/watchpoints support") Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
1 parent 4c8a7c9 commit eeeeaaf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/loongarch/include/asm/hw_breakpoint.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@ static inline void hw_breakpoint_thread_switch(struct task_struct *next)
134134
/* Determine number of BRP registers available. */
135135
static inline int get_num_brps(void)
136136
{
137-
return csr_read64(LOONGARCH_CSR_FWPC) & CSR_FWPC_NUM;
137+
return csr_read32(LOONGARCH_CSR_FWPC) & CSR_FWPC_NUM;
138138
}
139139

140140
/* Determine number of WRP registers available. */
141141
static inline int get_num_wrps(void)
142142
{
143-
return csr_read64(LOONGARCH_CSR_MWPC) & CSR_MWPC_NUM;
143+
return csr_read32(LOONGARCH_CSR_MWPC) & CSR_MWPC_NUM;
144144
}
145145

146146
#endif /* __KERNEL__ */

0 commit comments

Comments
 (0)