[PATCH] ARM: cti: fix manipulation of debug lock registers

Will Deacon will.deacon at arm.com
Tue Nov 20 08:55:10 EST 2012


On Mon, Nov 19, 2012 at 06:21:34PM +0000, Jon Hunter wrote:
> On 11/15/2012 03:40 PM, Will Deacon wrote:
> > diff --git a/arch/arm/include/asm/cti.h b/arch/arm/include/asm/cti.h
> > index a0ada3e..f2e5cad 100644
> > --- a/arch/arm/include/asm/cti.h
> > +++ b/arch/arm/include/asm/cti.h
> > @@ -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);
> >  }
> >  
> >  /**
> > @@ -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
> 
> I gave this a whirl on omap4430 and PMU is working fine with this, so ...
> 
> Tested-by: Jon Hunter <jon-hunter at ti.com>

Cheers Jon,

Will



More information about the linux-arm-kernel mailing list