Skip to content

Commit 87cdc58

Browse files
committed
[dma] Don't block superpage push on dma stop; return unfilled pages not ready
1 parent 74b2920 commit 87cdc58

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/Cru/CruDmaChannel.cxx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ void CruDmaChannel::setBufferNonReady()
159159

160160
void CruDmaChannel::deviceStopDma()
161161
{
162-
// Block further pushes; transfer queue has no available place anymore
163-
mLinkQueuesTotalAvailable = 0;
164-
165162
// Disable data taking
166163
setBufferNonReady();
167164
getBar2()->disableDataTaking();
@@ -178,7 +175,7 @@ void CruDmaChannel::deviceStopDma()
178175
}
179176

180177
if (!link.queue.empty()) {
181-
transferSuperpageFromLinkToReady(link, true);
178+
transferSuperpageFromLinkToReady(link);
182179
moved++;
183180
}
184181
amountAvailable--;
@@ -189,7 +186,7 @@ void CruDmaChannel::deviceStopDma()
189186
for (auto& link : mLinks) {
190187
while (!link.queue.empty()) {
191188
link.queue.front().setReceived(0);
192-
link.queue.front().setReady(true);
189+
link.queue.front().setReady(false);
193190
mReadyQueue.push_back(link.queue.front());
194191
link.queue.pop_front();
195192
}
@@ -295,7 +292,7 @@ void CruDmaChannel::pushSuperpageToLink(Link& link, const Superpage& superpage)
295292
link.queue.push_back(superpage);
296293
}
297294

298-
void CruDmaChannel::transferSuperpageFromLinkToReady(Link& link, bool stopping)
295+
void CruDmaChannel::transferSuperpageFromLinkToReady(Link& link)
299296
{
300297
if (link.queue.empty()) {
301298
BOOST_THROW_EXCEPTION(Exception() << ErrorInfo::Message("Could not transfer Superpage from link to ready queue, link queue is empty"));
@@ -313,9 +310,7 @@ void CruDmaChannel::transferSuperpageFromLinkToReady(Link& link, bool stopping)
313310
mReadyQueue.push_back(link.queue.front());
314311
link.queue.pop_front();
315312
link.superpageCounter++;
316-
if (!stopping) {
317-
mLinkQueuesTotalAvailable++;
318-
}
313+
mLinkQueuesTotalAvailable++;
319314
}
320315

321316
void CruDmaChannel::fillSuperpages()

src/Cru/CruDmaChannel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class CruDmaChannel final : public DmaChannelPdaBase
115115
void pushSuperpageToLink(Link& link, const Superpage& superpage);
116116

117117
/// Mark the front superpage of a link ready and transfer it to the ready queue
118-
void transferSuperpageFromLinkToReady(Link& link, bool stopping = false);
118+
void transferSuperpageFromLinkToReady(Link& link);
119119

120120
/// Enable debug mode by writing to the appropriate CRU register
121121
void enableDebugMode();

0 commit comments

Comments
 (0)