Re: [PATCH 2/3] ARM: MXC: mxcmmc: Teach the driver SDIO operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/3/31 Daniel Mack <daniel@xxxxxxxx>:
> On Wed, Mar 31, 2010 at 03:03:39PM +0200, Sascha Hauer wrote:
>> On Tue, Mar 30, 2010 at 08:32:00PM +0200, Daniel Mack wrote:
>> > +static void mxcmci_enable_sdio_irq(struct mmc_host *mmc, int enable)
>> > +{
>> > +   struct mxcmci_host *host = mmc_priv(mmc);
>> > +   unsigned long flags;
>> > +   u32 int_cntr;
>> > +
>> > +   spin_lock_irqsave(&host->lock, flags);
>> > +   host->use_sdio = enable;
>> > +   int_cntr = readl(host->base + MMC_REG_INT_CNTR);
>> > +
>> > +   if (enable)
>> > +           int_cntr |= INT_SDIO_IRQ_EN;
>> > +   else
>> > +           int_cntr &= ~INT_SDIO_IRQ_EN;
>> > +
>> > +   writel(int_cntr, host->base + MMC_REG_INT_CNTR);
>> > +   spin_unlock_irqrestore(&host->lock, flags);
>>
>> The other places where MMC_REG_INT_CNTR is touched should be protected
>> by this spinlock aswell.
> Hmm, all other place don't do a read/modify/write cycle, so I'd say the
> don't need protection?

If you miss spinlocks around the unconditional writes they might
happen between your readl() and writel().

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux