diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index aef1185f383d..ba9cf888aa87 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -1595,6 +1595,8 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, struct mmc_blk_data *md = mq->blkdata; bool do_rel_wr, do_data_tag; + brq->mrq.rq = req; + mmc_blk_data_prep(mq, mqrq, disable_multi, &do_rel_wr, &do_data_tag); brq->mrq.cmd = &brq->cmd; diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index eba9bcc92ad3..40e8424d8eaf 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2842,6 +2842,31 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask, u32 *intmask_p) sdhci_finish_command(host); } +#include +static void sdhci_dump_sg(struct sdhci_host *host) +{ + struct scatterlist *sg; + struct request *rq = host->data->mrq->rq; + struct req_iterator rq_iter; + struct bio_vec tmp; + int i = 0; + + printk("%s: dump sg list\n", __func__); + for (sg = host->data->sg; sg; sg = sg_next(sg)) + printk("\t %d: %lu %u %u\n", + i++, + (unsigned long)page_to_pfn(sg_page(sg)), + sg->offset, sg->length); + + printk("%s: dump request bvec\n", __func__); + i = 0; + rq_for_each_bvec(tmp, rq, rq_iter) + printk("\t %d: %lu %u %u\n", + i++, + (unsigned long)page_to_pfn(tmp.bv_page), + tmp.bv_offset, tmp.bv_len); +} + static void sdhci_adma_show_error(struct sdhci_host *host) { void *desc = host->adma_table; @@ -2941,6 +2966,7 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) else if (intmask & SDHCI_INT_ADMA_ERROR) { pr_err("%s: ADMA error\n", mmc_hostname(host->mmc)); sdhci_adma_show_error(host); + sdhci_dump_sg(host); host->data->error = -EIO; if (host->ops->adma_workaround) host->ops->adma_workaround(host, intmask); diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h index 134a6483347a..25565e640bfa 100644 --- a/include/linux/mmc/core.h +++ b/include/linux/mmc/core.h @@ -168,6 +168,7 @@ struct mmc_request { bool cap_cmd_during_tfr; int tag; + struct request *rq; }; struct mmc_card;