mmc: core: Call cmdq_post_req with tag info instead of mrq
Call mmc_/cmdq_post_req with tag number instead of mrq. This is needed in error handling as part of multiple request error handling. Change-Id: I175432639d28378ec74669e31deb4d1667c49bb8 Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
This commit is contained in:
parent
fc272f2bf2
commit
84de99e1de
5 changed files with 19 additions and 13 deletions
|
@ -3200,7 +3200,7 @@ void mmc_blk_cmdq_complete_rq(struct request *rq)
|
|||
BUG_ON(!test_and_clear_bit(cmdq_req->tag,
|
||||
&ctx_info->data_active_reqs));
|
||||
|
||||
mmc_cmdq_post_req(host, mrq, err);
|
||||
mmc_cmdq_post_req(host, cmdq_req->tag, err);
|
||||
if (err) {
|
||||
pr_err("%s: %s: txfr error: %d\n", mmc_hostname(mrq->host),
|
||||
__func__, err);
|
||||
|
|
|
@ -1512,13 +1512,13 @@ EXPORT_SYMBOL(mmc_cmdq_discard_queue);
|
|||
/**
|
||||
* mmc_cmdq_post_req - post process of a completed request
|
||||
* @host: host instance
|
||||
* @mrq: the request to be processed
|
||||
* @tag: the request tag.
|
||||
* @err: non-zero is error, success otherwise
|
||||
*/
|
||||
void mmc_cmdq_post_req(struct mmc_host *host, struct mmc_request *mrq, int err)
|
||||
void mmc_cmdq_post_req(struct mmc_host *host, int tag, int err)
|
||||
{
|
||||
if (likely(host->cmdq_ops->post_req))
|
||||
host->cmdq_ops->post_req(host, mrq, err);
|
||||
host->cmdq_ops->post_req(host, tag, err);
|
||||
}
|
||||
EXPORT_SYMBOL(mmc_cmdq_post_req);
|
||||
|
||||
|
|
|
@ -992,15 +992,23 @@ static int cmdq_halt(struct mmc_host *mmc, bool halt)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void cmdq_post_req(struct mmc_host *host, struct mmc_request *mrq,
|
||||
int err)
|
||||
static void cmdq_post_req(struct mmc_host *mmc, int tag, int err)
|
||||
{
|
||||
struct mmc_data *data = mrq->data;
|
||||
struct sdhci_host *sdhci_host = mmc_priv(host);
|
||||
struct cmdq_host *cq_host;
|
||||
struct mmc_request *mrq;
|
||||
struct mmc_data *data;
|
||||
struct sdhci_host *sdhci_host = mmc_priv(mmc);
|
||||
|
||||
if (WARN_ON(!mmc))
|
||||
return;
|
||||
|
||||
cq_host = (struct cmdq_host *)mmc_cmdq_private(mmc);
|
||||
mrq = get_req_by_tag(cq_host, tag);
|
||||
data = mrq->data;
|
||||
|
||||
if (data) {
|
||||
data->error = err;
|
||||
dma_unmap_sg(mmc_dev(host), data->sg, data->sg_len,
|
||||
dma_unmap_sg(mmc_dev(mmc), data->sg, data->sg_len,
|
||||
(data->flags & MMC_DATA_READ) ?
|
||||
DMA_FROM_DEVICE : DMA_TO_DEVICE);
|
||||
if (err)
|
||||
|
|
|
@ -136,8 +136,7 @@ struct mmc_cmdq_req;
|
|||
extern int mmc_cmdq_discard_queue(struct mmc_host *host, u32 tasks);
|
||||
extern int mmc_cmdq_halt(struct mmc_host *host, bool enable);
|
||||
extern int mmc_cmdq_halt_on_empty_queue(struct mmc_host *host);
|
||||
extern void mmc_cmdq_post_req(struct mmc_host *host, struct mmc_request *mrq,
|
||||
int err);
|
||||
extern void mmc_cmdq_post_req(struct mmc_host *host, int tag, int err);
|
||||
extern int mmc_cmdq_start_req(struct mmc_host *host,
|
||||
struct mmc_cmdq_req *cmdq_req);
|
||||
extern int mmc_cmdq_prepare_flush(struct mmc_command *cmd);
|
||||
|
|
|
@ -95,8 +95,7 @@ struct mmc_cmdq_host_ops {
|
|||
int (*enable)(struct mmc_host *host);
|
||||
void (*disable)(struct mmc_host *host, bool soft);
|
||||
int (*request)(struct mmc_host *host, struct mmc_request *mrq);
|
||||
void (*post_req)(struct mmc_host *host, struct mmc_request *mrq,
|
||||
int err);
|
||||
void (*post_req)(struct mmc_host *host, int tag, int err);
|
||||
int (*halt)(struct mmc_host *host, bool halt);
|
||||
void (*reset)(struct mmc_host *host, bool soft);
|
||||
void (*dumpstate)(struct mmc_host *host);
|
||||
|
|
Loading…
Add table
Reference in a new issue