Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fce9d33f authored by Andrew Gabbasov's avatar Andrew Gabbasov Committed by Ulf Hansson
Browse files

mmc: sdhci: fix error conditions for controller reset



Add the case of SET_BLOCK_COUNT command error to the error conditions
check for making a controller reset at request handling finish.
Otherwise, if the SET_BLOCK_COUNT command failed, e.g. with a timeout,
the controller state was not reset, and the next command failed too.

In the case of data error the controller reset is already done in
finish_data() function before sending stop command (if present),
so the finish tasklet should make a reset after data error only
if no stop command existed in the request.

Also, fix the indentation of this condition check to make it more logical.

Signed-off-by: default avatarAndrew Gabbasov <andrew_gabbasov@mentor.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent fbfaf032
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2144,7 +2144,8 @@ static void sdhci_tasklet_finish(unsigned long param)
	 */
	if (!(host->flags & SDHCI_DEVICE_DEAD) &&
	    ((mrq->cmd && mrq->cmd->error) ||
		 (mrq->data && (mrq->data->error ||
	     (mrq->sbc && mrq->sbc->error) ||
	     (mrq->data && ((mrq->data->error && !mrq->data->stop) ||
			    (mrq->data->stop && mrq->data->stop->error))) ||
	     (host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) {