diff -r 9aca3be14c27 -r 75252ea6123b kernel/eka/drivers/dma/dma2_pil.cpp --- a/kernel/eka/drivers/dma/dma2_pil.cpp Mon Jul 12 14:24:01 2010 +0100 +++ b/kernel/eka/drivers/dma/dma2_pil.cpp Mon Jul 26 10:52:56 2010 +0100 @@ -1863,11 +1863,14 @@ iChannel.Wait(); TUint32 req_count = iChannel.iQueuedRequests++; - if (req_count == 0) + if (iChannel.iCallQueuedRequestFn) { - iChannel.Signal(); - iChannel.QueuedRequestCountChanged(); - iChannel.Wait(); + if (req_count == 0) + { + iChannel.Signal(); + iChannel.QueuedRequestCountChanged(); + iChannel.Wait(); + } } TInt r = KErrGeneral; @@ -1883,9 +1886,12 @@ req_count = --iChannel.iQueuedRequests; __DMA_INVARIANT(); iChannel.Signal(); - if (req_count == 0) + if (iChannel.iCallQueuedRequestFn) { - iChannel.QueuedRequestCountChanged(); + if (req_count == 0) + { + iChannel.QueuedRequestCountChanged(); + } } } else if (iIsrCb && !iChannel.IsQueueEmpty()) @@ -1899,9 +1905,12 @@ req_count = --iChannel.iQueuedRequests; __DMA_INVARIANT(); iChannel.Signal(); - if (req_count == 0) + if (iChannel.iCallQueuedRequestFn) { - iChannel.QueuedRequestCountChanged(); + if (req_count == 0) + { + iChannel.QueuedRequestCountChanged(); + } } } else if (iChannel.iIsrDfc & (TUint32)TDmaChannel::KCancelFlagMask) @@ -1911,9 +1920,12 @@ req_count = --iChannel.iQueuedRequests; __DMA_INVARIANT(); iChannel.Signal(); - if (req_count == 0) + if (iChannel.iCallQueuedRequestFn) { - iChannel.QueuedRequestCountChanged(); + if (req_count == 0) + { + iChannel.QueuedRequestCountChanged(); + } } } else @@ -2275,6 +2287,7 @@ iReqQ(), iReqCount(0), iQueuedRequests(0), + iCallQueuedRequestFn(ETrue), iCancelInfo(NULL), iRedoRequest(EFalse), iIsrCbRequest(EFalse) @@ -2476,9 +2489,12 @@ // Only call PSL if there were requests queued when we entered AND there // are now no requests left on the queue. - if ((req_count_before != 0) && (req_count_after == 0)) + if (iCallQueuedRequestFn) { - QueuedRequestCountChanged(); + if ((req_count_before != 0) && (req_count_after == 0)) + { + QueuedRequestCountChanged(); + } } __DMA_INVARIANT(); @@ -2790,9 +2806,12 @@ // Only call PSL if there were requests queued when we entered AND there // are now no requests left on the queue (after also having executed all // client callbacks). - if ((req_count_before != 0) && (req_count_after == 0)) + if (iCallQueuedRequestFn) { - QueuedRequestCountChanged(); + if ((req_count_before != 0) && (req_count_after == 0)) + { + QueuedRequestCountChanged(); + } } __DMA_INVARIANT(); @@ -2849,14 +2868,11 @@ /** PSL may override */ void TDmaChannel::QueuedRequestCountChanged() { -#ifdef _DEBUG + __KTRACE_OPT(KDMA, Kern::Printf("TDmaChannel::QueuedRequestCountChanged(): " + "disabling further calls")); Wait(); - __KTRACE_OPT(KDMA, - Kern::Printf("TDmaChannel::QueuedRequestCountChanged() %d", - iQueuedRequests)); - __DMA_ASSERTA(iQueuedRequests >= 0); + iCallQueuedRequestFn = EFalse; Signal(); -#endif }