mmu: always wait for a request's expected response

If a planned request is activated when the current status is finished
then the firmware must wait for the response when the request
is expecting it

An example is a register read or a register write.

manage_response not return unless the register has been read or
written. And we must see the response to know if an error should be
reported.

Step to reproduce issue:
1. Fail selector homing
2. Select 'Tune' item
3. Observe issue. In this situation you can see the value
for the previous register read is shown. Which is 0. This very timing dependent and does not always happen.
4. Repeat step 2 until the issue appears. It may take a few times.
This commit is contained in:
gudnimg 2023-09-23 17:11:18 +00:00
parent 3c64874e20
commit c384524877
1 changed files with 2 additions and 5 deletions

View File

@ -809,15 +809,12 @@ StepStatus ProtocolLogic::Step() {
// We are ok, switching to Idle if there is no potential next request planned.
// But the trouble is we must report a finished command if the previous command has just been finished
// i.e. only try to find some planned command if we just finished the Idle cycle
bool previousCommandFinished = currentScope == Scope::Command; // @@TODO this is a nasty hack :(
if (!ActivatePlannedRequest()) { // if nothing is planned, switch to Idle
SwitchToIdle();
} else {
} else if (ExpectsResponse()) {
// if the previous cycle was Idle and now we have planned a new command -> avoid returning Finished
if (!previousCommandFinished && currentScope == Scope::Command) {
currentStatus = Processing;
}
}
} break;
case CommandRejected:
// we have to repeat it - that's the only thing we can do