diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 1dbe93232030..2dcb6c18a16f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -635,9 +635,11 @@ static void sdhci_adma_table_post(struct sdhci_host *host, } } - if (!data->host_cookie) + if (!data->host_cookie) { + pr_info("%s: unmapping %p phys=%pad size=%u\n", __func__, data->sg, &sg_dma_address(data->sg), data->sg_len); dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, direction); + } } static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd) @@ -949,11 +951,13 @@ static void sdhci_finish_data(struct sdhci_host *host) if (host->flags & SDHCI_USE_ADMA) sdhci_adma_table_post(host, data); else { - if (!data->host_cookie) + if (!data->host_cookie) { + pr_info("%s: unmapping %p phys=%pad size=%u\n", __func__, data->sg, &sg_dma_address(data->sg), data->sg_len); dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, (data->flags & MMC_DATA_READ) ? DMA_FROM_DEVICE : DMA_TO_DEVICE); + } } } @@ -2097,10 +2101,12 @@ static void sdhci_post_req(struct mmc_host *mmc, struct mmc_request *mrq, struct mmc_data *data = mrq->data; if (host->flags & SDHCI_REQ_USE_DMA) { - if (data->host_cookie) + if (data->host_cookie) { + pr_info("%s: unmapping %p phys=%pad size=%u\n", __func__, data->sg, &sg_dma_address(data->sg), data->sg_len); dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, data->flags & MMC_DATA_WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE); + } mrq->data->host_cookie = 0; } } @@ -2113,7 +2119,7 @@ static int sdhci_pre_dma_transfer(struct sdhci_host *host, if (!next && data->host_cookie && data->host_cookie != host->next_data.cookie) { - pr_debug(DRIVER_NAME "[%s] invalid cookie: %d, next-cookie %d\n", + pr_info(DRIVER_NAME "[%s] invalid cookie: %d, next-cookie %d\n", __func__, data->host_cookie, host->next_data.cookie); data->host_cookie = 0; } @@ -2125,6 +2131,9 @@ static int sdhci_pre_dma_transfer(struct sdhci_host *host, data->sg_len, data->flags & MMC_DATA_WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE); + pr_info("%s: mapped %p %pad (wanted=%u, got=%d), next=%p, hcook=%d, ncook=%d\n", + __func__, data->sg, &sg_dma_address(data->sg), data->sg_len, sg_count, next, data->host_cookie, + host->next_data.cookie); } else { sg_count = host->next_data.sg_count;