In order to support commands during data transfer, it will be possible to
need to reset the command circuit while the data circuit is in use, and
vice versa. It is now easy to determine whether the command or data circuit
is in use, and so just skip the corresponding reset if it is.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
static void sdhci_finish_data(struct sdhci_host *host)
{
static void sdhci_finish_data(struct sdhci_host *host)
{
+ struct mmc_command *data_cmd = host->data_cmd;
+ struct mmc_data *data = host->data;
host->data = NULL;
host->data_cmd = NULL;
host->data = NULL;
host->data_cmd = NULL;
* upon error conditions.
*/
if (data->error) {
* upon error conditions.
*/
if (data->error) {
- sdhci_do_reset(host, SDHCI_RESET_CMD);
+ if (!host->cmd || host->cmd == data_cmd)
+ sdhci_do_reset(host, SDHCI_RESET_CMD);
sdhci_do_reset(host, SDHCI_RESET_DATA);
}
sdhci_do_reset(host, SDHCI_RESET_DATA);
}
/* Spec says we should do both at the same time, but Ricoh
controllers do not like that. */
/* Spec says we should do both at the same time, but Ricoh
controllers do not like that. */
- sdhci_do_reset(host, SDHCI_RESET_CMD);
- sdhci_do_reset(host, SDHCI_RESET_DATA);
+ if (!host->cmd)
+ sdhci_do_reset(host, SDHCI_RESET_CMD);
+ if (!host->data_cmd)
+ sdhci_do_reset(host, SDHCI_RESET_DATA);
host->pending_reset = false;
}
host->pending_reset = false;
}