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

Commit 48f0cccb authored by Veerabhadrarao Badiganti's avatar Veerabhadrarao Badiganti Committed by Gerrit - the friendly Code Review server
Browse files

mmc: core: Return the error if command queue request fails



command-queue request may fail during preparation/issuing in some
cases. In case if it fails, the error code needs to be propagated back
to the function which initiated the request so that the request can be
handled appropriately.

Change-Id: Ia6946c14f0c106fb30bd70ca5c9e600c516fdf55
Signed-off-by: default avatarVeerabhadrarao Badiganti <vbadigan@codeaurora.org>
parent 17f54d16
Loading
Loading
Loading
Loading
+19 −8
Original line number Diff line number Diff line
@@ -1166,9 +1166,11 @@ static int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
	return 0;
}

static void mmc_start_cmdq_request(struct mmc_host *host,
static int mmc_start_cmdq_request(struct mmc_host *host,
				   struct mmc_request *mrq)
{
	int ret = 0;

	if (mrq->data) {
		pr_debug("%s:     blksz %d blocks %d flags %08x tsac %lu ms nsac %d\n",
			mmc_hostname(host), mrq->data->blksz,
@@ -1190,11 +1192,21 @@ static void mmc_start_cmdq_request(struct mmc_host *host,
	}

	mmc_host_clk_hold(host);
	if (likely(host->cmdq_ops->request))
		host->cmdq_ops->request(host, mrq);
	else
		pr_err("%s: %s: issue request failed\n", mmc_hostname(host),
				__func__);
	if (likely(host->cmdq_ops->request)) {
		ret = host->cmdq_ops->request(host, mrq);
	} else {
		ret = -ENOENT;
		pr_err("%s: %s: cmdq request host op is not available\n",
			mmc_hostname(host), __func__);
	}

	if (ret) {
		mmc_host_clk_release(host);
		pr_err("%s: %s: issue request failed, err=%d\n",
			mmc_hostname(host), __func__, ret);
	}

	return ret;
}

/**
@@ -1681,8 +1693,7 @@ int mmc_cmdq_start_req(struct mmc_host *host, struct mmc_cmdq_req *cmdq_req)
		mrq->cmd->error = -ENOMEDIUM;
		return -ENOMEDIUM;
	}
	mmc_start_cmdq_request(host, mrq);
	return 0;
	return mmc_start_cmdq_request(host, mrq);
}
EXPORT_SYMBOL(mmc_cmdq_start_req);