Skip to content

Commit 577c8e9

Browse files
committed
fix starting with bad DMA state (eg previous process interrupted while DMA active
1 parent e4d6a58 commit 577c8e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Cru/CruDmaChannel.cxx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ void CruDmaChannel::deviceStartDma()
142142
log("Did not set data source, feature not supported by firmware", LogWarningDevel_(4254));
143143
}
144144

145+
if (dataSourceSelection == Cru::Registers::DATA_SOURCE_SELECT_GBT) {
146+
getBar2()->disableDataTaking(); // Make sure we don't start from a bad state - shall be done before reset
147+
}
148+
145149
// Reset CRU (should be done after link mask set)
146150
resetCru();
147151

@@ -162,7 +166,6 @@ void CruDmaChannel::deviceStartDma()
162166

163167
// Enable data taking
164168
if (dataSourceSelection == Cru::Registers::DATA_SOURCE_SELECT_GBT) {
165-
getBar2()->disableDataTaking(); // Make sure we don't start from a bad state
166169
getBar2()->enableDataTaking();
167170
}
168171
}

0 commit comments

Comments
 (0)