Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: cti: fix manipulation of debug lock registers

The LOCKSTATUS register for memory-mapped coresight devices indicates
whether or not the device in question implements hardware locking. If
not, locking is not present (i.e. LSR.SLI == 0) and LAR is write-ignore,
so software doesn't actually need to check the status register at all.

This patch removes the broken LSR checks.

Cc: Ming Lei <ming.lei@canonical.com>
Reported-by: Mike Williams <michael.williams@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>

+2 -18
+2 -18
arch/arm/include/asm/cti.h
··· 146 146 */ 147 147 static inline void cti_unlock(struct cti *cti) 148 148 { 149 - void __iomem *base = cti->base; 150 - unsigned long val; 151 - 152 - val = __raw_readl(base + LOCKSTATUS); 153 - 154 - if (val & 1) { 155 - val = LOCKCODE; 156 - __raw_writel(val, base + LOCKACCESS); 157 - } 149 + __raw_writel(LOCKCODE, cti->base + LOCKACCESS); 158 150 } 159 151 160 152 /** ··· 158 166 */ 159 167 static inline void cti_lock(struct cti *cti) 160 168 { 161 - void __iomem *base = cti->base; 162 - unsigned long val; 163 - 164 - val = __raw_readl(base + LOCKSTATUS); 165 - 166 - if (!(val & 1)) { 167 - val = ~LOCKCODE; 168 - __raw_writel(val, base + LOCKACCESS); 169 - } 169 + __raw_writel(~LOCKCODE, cti->base + LOCKACCESS); 170 170 } 171 171 #endif