Skip to content

Commit

Permalink
dwcmshc: Clear status before tuning
Browse files Browse the repository at this point in the history
This fixes a bug where the driver tries to retune while a sdport-issued
tuning request is already in progress.

Signed-off-by: Mario Bălănică <[email protected]>
  • Loading branch information
mariobalanica committed Jun 22, 2024
1 parent 7ef5269 commit 13e66b0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/sd/dwcmshc/dwcmshc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1442,10 +1442,6 @@ MshcResetHost(
if ((ResetType == SdResetTypeDat) &&
MshcExtension->TuningPerformed &&
(MshcExtension->DataCrcErrorsSinceLastTuning >= MSHC_DCRC_ERROR_RETUNING_THRESHOLD)) {

MshcExtension->TuningPerformed = FALSE;
MshcExtension->DataCrcErrorsSinceLastTuning = 0;

MSHC_LOG_WARN(
MshcExtension->LogHandle,
MshcExtension,
Expand Down Expand Up @@ -1817,6 +1813,9 @@ MshcExecuteTuning(
Status = STATUS_NOT_IMPLEMENTED;
PlatformOperations = MshcExtension->PlatformOperations;

MshcExtension->TuningPerformed = FALSE;
MshcExtension->DataCrcErrorsSinceLastTuning = 0;

if (PlatformOperations->ExecuteTuning != NULL) {
Status = PlatformOperations->ExecuteTuning(MshcExtension);
}
Expand Down

0 comments on commit 13e66b0

Please sign in to comment.