Skip to contentSkip to conversation

ep93xx: clear devcfg bits before setting them

PATCH New H Hartley Sweeten 2 participants 2 messages Jun 12, 2010 – Jun 13, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ep93xx: clear devcfg bits before setting them

The ep93xx core helper function ep93xx_devcfg_set_clear should mask the clear_bits before setting the new set_bits in case the clear_bits are a mask value that also includes the set_bits.

---

arch/arm/mach-ep93xx/core.c +1 -1
index 9092677..92f2ebb 100644
@@ -215,8 +215,8 @@ void ep93xx_devcfg_set_clear(unsigned int set_bits, unsigned int clear_bits)
 	spin_lock_irqsave(&syscon_swlock, flags);
 
 	val = __raw_readl(EP93XX_SYSCON_DEVCFG);
-	val |= set_bits;
 	val &= ~clear_bits;
+	val |= set_bits;
 	__raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
 	__raw_writel(val, EP93XX_SYSCON_DEVCFG);
 
#1 lore raw

PATCH 1/1 ep93xx: clear devcfg bits before setting them

Quoted 6 lines · H Hartley Sweeten

The ep93xx core helper function ep93xx_devcfg_set_clear should mask the clear_bits before setting the new set_bits in case the clear_bits are a mask value that also includes the set_bits.

Quoted 16 lines

---

arch/arm/mach-ep93xx/core.c +1 -1
index 9092677..92f2ebb 100644
@@ -215,8 +215,8 @@ void ep93xx_devcfg_set_clear(unsigned int set_bits, unsigned int clear_bits)
 	spin_lock_irqsave(&syscon_swlock, flags);
 
 	val = __raw_readl(EP93XX_SYSCON_DEVCFG);
-	val |= set_bits;
 	val &= ~clear_bits;
+	val |= set_bits;
 	__raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
 	__raw_writel(val, EP93XX_SYSCON_DEVCFG);
 
Signature · 7 lines
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan at bluewatersys.com         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751
Fax:   +64 3 3779135			  USA 1800 261 2934