Skip to content

Commit

Permalink
ARM: cti: fix manipulation of debug lock registers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Will Deacon committed Nov 15, 2012
1 parent f435ab7 commit f600b9f
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions arch/arm/include/asm/cti.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,7 @@ static inline void cti_irq_ack(struct cti *cti)
*/
static inline void cti_unlock(struct cti *cti)
{
void __iomem *base = cti->base;
unsigned long val;

val = __raw_readl(base + LOCKSTATUS);

if (val & 1) {
val = LOCKCODE;
__raw_writel(val, base + LOCKACCESS);
}
__raw_writel(LOCKCODE, cti->base + LOCKACCESS);
}

/**
Expand All @@ -166,14 +158,6 @@ static inline void cti_unlock(struct cti *cti)
*/
static inline void cti_lock(struct cti *cti)
{
void __iomem *base = cti->base;
unsigned long val;

val = __raw_readl(base + LOCKSTATUS);

if (!(val & 1)) {
val = ~LOCKCODE;
__raw_writel(val, base + LOCKACCESS);
}
__raw_writel(~LOCKCODE, cti->base + LOCKACCESS);
}
#endif

0 comments on commit f600b9f

Please sign in to comment.