Skip to content

Commit 315abd1

Browse files
committed
[bench-dma] Adjust TF detection
1 parent 972f609 commit 315abd1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/CommandLineUtilities/ProgramDmaBench.cxx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,6 @@ class ProgramDmaBench : public Program
800800
bool checkTimeFrameAlignment(uintptr_t pageAddress, bool atStartOfSuperpage)
801801
{
802802
static bool overflowGuard = false;
803-
static uint32_t mNextTFOrbit = 0x0;
804803
static uint32_t prevOrbit = 0x0;
805804

806805
// check that the TimeFrame starts at the beginning of the superpage
@@ -822,9 +821,11 @@ class ProgramDmaBench : public Program
822821
if (!atStartOfSuperpage) {
823822
return false;
824823
}
825-
// Update next TF orbit expected
826-
overflowGuard = (mNextTFOrbit + mTimeFrameLength) & 0x100000000; // next TF orbit overflown, need to wait for orbit to overflow as well
827-
mNextTFOrbit = mNextTFOrbit + mTimeFrameLength;
824+
while (mNextTFOrbit <= mOrbit) { // If we end up on an orbit that is more than a TF length away
825+
// Update next TF orbit expected
826+
overflowGuard = (mNextTFOrbit + mTimeFrameLength) & 0x100000000; // next TF orbit overflown, need to wait for orbit to overflow as well
827+
mNextTFOrbit = mNextTFOrbit + mTimeFrameLength;
828+
}
828829
}
829830

830831
return true;

0 commit comments

Comments
 (0)