[alsa-devel] [PATCH v3 08/11] ASoC: fsl: make fsl_ssi driver compilable on ARM/IMX

Timur Tabi timur at freescale.com
Thu Mar 8 21:13:04 CET 2012


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



More information about the Alsa-devel mailing list