8 Mar
2012
8 Mar
'12
9:13 p.m.
Shawn Guo wrote:
+static DEFINE_SPINLOCK(ssi_reg_lock); +static inline void write_ssi_mask(u32 __iomem *addr, u32 clear, u32 set) +{
- u32 val;
- unsigned long flags;
- spin_lock_irqsave(&ssi_reg_lock, flags);
- val = readl(addr);
- val = (val & ~clear) | set;
- writel(val, addr);
- spin_unlock_irqrestore(&ssi_reg_lock, flags);
+} +#endif
I think this spinlock is the wrong approach. The problem with read-modify-write is on the function level, not the register level.
--
Timur Tabi
Linux kernel developer at Freescale