Skip to content

Commit e9f3fb5

Browse files
smaeulUlf Hansson
authored andcommitted
mmc: sunxi-mmc: Fix DMA descriptors allocated above 32 bits
Newer variants of the MMC controller support a 34-bit physical address space by using word addresses instead of byte addresses. However, the code truncates the DMA descriptor address to 32 bits before applying the shift. This breaks DMA for descriptors allocated above the 32-bit limit. Fixes: 3536b82 ("mmc: sunxi: add support for A100 mmc controller") Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Andre Przywara <andre.przywara@arm.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20220424231751.32053-1-samuel@sholland.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 4bc31ed commit e9f3fb5

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/mmc/host/sunxi-mmc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,9 @@ static void sunxi_mmc_init_idma_des(struct sunxi_mmc_host *host,
377377
pdes[i].buf_addr_ptr1 =
378378
cpu_to_le32(sg_dma_address(&data->sg[i]) >>
379379
host->cfg->idma_des_shift);
380-
pdes[i].buf_addr_ptr2 = cpu_to_le32((u32)next_desc >>
381-
host->cfg->idma_des_shift);
380+
pdes[i].buf_addr_ptr2 =
381+
cpu_to_le32(next_desc >>
382+
host->cfg->idma_des_shift);
382383
}
383384

384385
pdes[0].config |= cpu_to_le32(SDXC_IDMAC_DES0_FD);

0 commit comments

Comments
 (0)