lkml.org 
[lkml]   [2009]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/2] Add COH 901 318 DMA block driver
From
Then a quick comment in addition to the COH 901 318 v2...

2009/9/30 Sosnowski, Maciej <maciej.sosnowski@intel.com>:

>> + 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-10-09 11:13    [W:1.549 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site