Re: [PATCH 1/2] Add COH 901 318 DMA block driver
From: Linus Walleij
Date: Fri Oct 09 2009 - 05:11:48 EST
Then a quick comment in addition to the COH 901 318 v2...
2009/9/30 Sosnowski, Maciej <maciej.sosnowski@xxxxxxxxx>:
>> + coh901318_stop(chan);
>> +
>> + spin_lock_irqsave(&cohc->lock, flags);
>> +
>> + /* Clear any pending BE or TC interrupt */
>> + if (cohc->id < 32) {
>> + writel(1 << cohc->id, virtbase + COH901318_BE_INT_CLEAR1);
>> + writel(1 << cohc->id, virtbase + COH901318_TC_INT_CLEAR1);
>> + } else {
>> + writel(1 << (cohc->id - 32), virtbase +
>> + COH901318_BE_INT_CLEAR2);
>> + writel(1 << (cohc->id - 32), virtbase +
>> + COH901318_TC_INT_CLEAR2);
>> + }
>> +
>> + enable_powersave(cohc);
>
> enable_powersave() has been called in coh901318_stop() already
Yes, however an IRQ can come in between coh901318_stop() and
spin_lock_irqsave(), disabling powersave. So to avoid a possible race,
we enable it again. We cannot move coh901318_stop() after the spinlock
either, because the coh901318_stop() use the same spinlock, and then it
deadlocks. And I cannot require the lock to be held while calling
coh901318_stop() because it is an exported symbol.
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/