Skip to content

Commit

Permalink
mmc: sdhci: Reorganize sdhci_finish_mrq() and __sdhci_finish_mrq()
Browse files Browse the repository at this point in the history
In preparation for removing finish_tasklet, reorganize sdhci_finish_mrq()
and __sdhci_finish_mrq() to separate the tasklet scheduling from other
processing.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Reviewed-by: Faiz Abbas <faiz_abbas@ti.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Adrian Hunter authored and Ulf Hansson committed Apr 15, 2019
1 parent ade024f commit 2e72ab9
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions drivers/mmc/host/sdhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,18 @@ static void __sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq)
{
int i;

if (host->cmd && host->cmd->mrq == mrq)
host->cmd = NULL;

if (host->data_cmd && host->data_cmd->mrq == mrq)
host->data_cmd = NULL;

if (host->data && host->data->mrq == mrq)
host->data = NULL;

if (sdhci_needs_reset(host, mrq))
host->pending_reset = true;

for (i = 0; i < SDHCI_MAX_MRQS; i++) {
if (host->mrqs_done[i] == mrq) {
WARN_ON(1);
Expand All @@ -1236,25 +1248,13 @@ static void __sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq)
}

WARN_ON(i >= SDHCI_MAX_MRQS);

tasklet_schedule(&host->finish_tasklet);
}

static void sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq)
{
if (host->cmd && host->cmd->mrq == mrq)
host->cmd = NULL;

if (host->data_cmd && host->data_cmd->mrq == mrq)
host->data_cmd = NULL;

if (host->data && host->data->mrq == mrq)
host->data = NULL;

if (sdhci_needs_reset(host, mrq))
host->pending_reset = true;

__sdhci_finish_mrq(host, mrq);

tasklet_schedule(&host->finish_tasklet);
}

static void sdhci_finish_data(struct sdhci_host *host)
Expand Down

0 comments on commit 2e72ab9

Please sign in to comment.