--- a/kernel/eka/include/drivers/dma_v1.h Tue Jul 06 15:50:07 2010 +0300
+++ b/kernel/eka/include/drivers/dma_v1.h Wed Aug 18 11:08:29 2010 +0300
@@ -279,13 +279,7 @@
TUint32 iCookie;
/** Number of descriptors this channel can use */
TInt iDesCount;
- /** DFC queue used to service DMA interrupts. The DFC thread
- priority must be higher than any client thread priority to
- avoid a situation where a transfer completes while being
- cancelled and another transfer is started before the DFC
- thread gets a chance to run. This would lead to a stray
- DFC.
- */
+ /** DFC queue used to service DMA interrupts */
TDfcQue* iDfcQ;
/** DFC priority */
TUint8 iDfcPriority;
@@ -393,15 +387,16 @@
void TFooDmaChannel::QueuedRequestCountChanged()
{
Kern::MutexWait(*iDmaMutex);
- if ((iQueuedRequests > 0) && (iPrevQueuedRequests == 0))
+ const TInt queued_now = __e32_atomic_load_acq32(&iQueuedRequests);
+ if ((queued_now > 0) && (iPrevQueuedRequests == 0))
{
IncreasePowerCount(); // Base port specific
}
- else if ((iQueuedRequests == 0) && (iPrevQueuedRequests > 0))
+ else if ((queued_now == 0) && (iPrevQueuedRequests > 0))
{
DecreasePowerCount(); // Base port specific
}
- iPrevQueuedRequests = iQueuedRequests;
+ iPrevQueuedRequests = queued_now;
Kern::MutexSignal(*iDmaMutex);
}
@@ -436,6 +431,7 @@
SDblQue iReqQ; // being/about to be transferred request queue
TInt iReqCount; // number of requests attached to this channel
TInt iQueuedRequests; // number of requests currently queued on this channel
+ TBool iCallQueuedRequestFn; // call QueuedRequestCountChanged? (default: true)
private:
TDmaCancelInfo* iCancelInfo;
__DMA_DECLARE_INVARIANT