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

Commit 1814b3c0 authored by Konstantin Dorfman's avatar Konstantin Dorfman
Browse files

sdhci: sdhci_stop_request() returns error when no request



There is race between sdhci_tasklet_finish()
and sdhci_stop_request(): when the request is finished before
stop flow called, error returned.

Change-Id: Iac43e6af2498bc75bc8cc959c680a92f9dd5ee7a
Signed-off-by: default avatarKonstantin Dorfman <kdorfman@codeaurora.org>
parent 0f059515
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -2515,10 +2515,13 @@ static int sdhci_stop_request(struct mmc_host *mmc)
	struct sdhci_host *host = mmc_priv(mmc);
	unsigned long flags;
	struct mmc_data *data;
	int ret = 0;

	spin_lock_irqsave(&host->lock, flags);
	if (!host->mrq || !host->data)
	if (!host->mrq || !host->data) {
		ret = MMC_BLK_NO_REQ_TO_STOP;
		goto out;
	}

	data = host->data;

@@ -2544,7 +2547,7 @@ static int sdhci_stop_request(struct mmc_host *mmc)
	host->data = NULL;
out:
	spin_unlock_irqrestore(&host->lock, flags);
	return 0;
	return ret;
}

static unsigned int sdhci_get_xfer_remain(struct mmc_host *mmc)
+1 −0
Original line number Diff line number Diff line
@@ -207,6 +207,7 @@ enum mmc_blk_status {
	MMC_BLK_NEW_REQUEST,
	MMC_BLK_URGENT,
	MMC_BLK_URGENT_DONE,
	MMC_BLK_NO_REQ_TO_STOP,
};

enum mmc_packed_stop_reasons {