|
@@ -146,11 +146,8 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host,
|
|
WARN_ON(host->sg_len > 1);
|
|
WARN_ON(host->sg_len > 1);
|
|
|
|
|
|
/* This DMAC cannot handle if buffer is not 8-bytes alignment */
|
|
/* This DMAC cannot handle if buffer is not 8-bytes alignment */
|
|
- if (!IS_ALIGNED(sg->offset, 8)) {
|
|
|
|
- host->force_pio = true;
|
|
|
|
- renesas_sdhi_internal_dmac_enable_dma(host, false);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
|
|
+ if (!IS_ALIGNED(sg->offset, 8))
|
|
|
|
+ goto force_pio;
|
|
|
|
|
|
if (data->flags & MMC_DATA_READ) {
|
|
if (data->flags & MMC_DATA_READ) {
|
|
dtran_mode |= DTRAN_MODE_CH_NUM_CH1;
|
|
dtran_mode |= DTRAN_MODE_CH_NUM_CH1;
|
|
@@ -163,8 +160,8 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host,
|
|
}
|
|
}
|
|
|
|
|
|
ret = dma_map_sg(&host->pdev->dev, sg, host->sg_len, dir);
|
|
ret = dma_map_sg(&host->pdev->dev, sg, host->sg_len, dir);
|
|
- if (ret < 0)
|
|
|
|
- return;
|
|
|
|
|
|
+ if (ret == 0)
|
|
|
|
+ goto force_pio;
|
|
|
|
|
|
renesas_sdhi_internal_dmac_enable_dma(host, true);
|
|
renesas_sdhi_internal_dmac_enable_dma(host, true);
|
|
|
|
|
|
@@ -176,6 +173,12 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host,
|
|
dtran_mode);
|
|
dtran_mode);
|
|
renesas_sdhi_internal_dmac_dm_write(host, DM_DTRAN_ADDR,
|
|
renesas_sdhi_internal_dmac_dm_write(host, DM_DTRAN_ADDR,
|
|
sg->dma_address);
|
|
sg->dma_address);
|
|
|
|
+
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+force_pio:
|
|
|
|
+ host->force_pio = true;
|
|
|
|
+ renesas_sdhi_internal_dmac_enable_dma(host, false);
|
|
}
|
|
}
|
|
|
|
|
|
static void renesas_sdhi_internal_dmac_issue_tasklet_fn(unsigned long arg)
|
|
static void renesas_sdhi_internal_dmac_issue_tasklet_fn(unsigned long arg)
|