We could quickly reproduce this bug by decrease IO_TLB_DEFAULT_SIZE
and manually disable mmc DTO interrupt which can make driver fall into
post_tmo all the time.
So, some of these dump for swiotlb we can get here due to no enough
IO_TLB can be used to map page for kernel space:
DMA: Out of SW-IOMMU space for 128 bytes at device
ff0f0000.rksdmmc
DMA: Out of SW-IOMMU space for 128 bytes at device
ff0f0000.rksdmmc
...
DMA: Out of SW-IOMMU space for 128 bytes at device
ff0f0000.rksdmmc
DMA: Out of SW-IOMMU space for 128 bytes at device
ff0f0000.rksdmmc
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reported-and-tested-by: Jianhong Chen <chenjh@rock-chips.com>
Cc: Yao Xiao <xy@rock-chips.com>
{
struct dw_mci_slot *slot = mmc_priv(mmc);
struct dw_mci *host = slot->host;
- struct mmc_data *data;
u32 i, regs, cmd_flags;
u32 sdio_int;
unsigned long timeout = 0;
bool ret_timeout = true, is_retry = false;
u32 opcode, offset;
+ if (host->cur_slot->mrq->data)
+ dw_mci_stop_dma(host);
+
offset = host->cru_reset_offset;
opcode = host->mrq->cmd->opcode;
host->cur_slot->mrq = NULL;
host->mrq = NULL;
host->state = STATE_IDLE;
-
- data = host->data;
+ host->data = NULL;
if ((opcode == MMC_SEND_TUNING_BLOCK_HS200) ||
(opcode == MMC_SEND_TUNING_BLOCK))