diff --git a/root/target/linux/brcm2708/image/config-bcm2711-arm64.txt b/root/target/linux/brcm2708/image/config-bcm2711-arm64.txt deleted file mode 100644 index 1af8ed0d..00000000 --- a/root/target/linux/brcm2708/image/config-bcm2711-arm64.txt +++ /dev/null @@ -1,11 +0,0 @@ -################################################################################ -# Bootloader configuration - config.txt -################################################################################ - -################################################################################ -# For overclocking and various other settings, see: -# https://www.raspberrypi.org/documentation/configuration/config-txt/README.md -################################################################################ - -# Force aarch64 -arm_64bit=1 diff --git a/root/target/linux/brcm2708/patches-4.19/960-fix-DMA-leaks-bcm2835-arm64.patch b/root/target/linux/brcm2708/patches-4.19/960-fix-DMA-leaks-bcm2835-arm64.patch new file mode 100644 index 00000000..58217c1e --- /dev/null +++ b/root/target/linux/brcm2708/patches-4.19/960-fix-DMA-leaks-bcm2835-arm64.patch @@ -0,0 +1,68 @@ +From d9aa3902c1fb7163edf1812dd0e03ed5a7e129ed Mon Sep 17 00:00:00 2001 +From: Yaroslav Rosomakho +Date: Mon, 19 Aug 2019 01:26:13 +0200 +Subject: [PATCH] This should fix DMA leaks that lead to swiotlb buffer + overflow errors on bcm2835-mmc under ARM64. + +Signed-off-by: Yaroslav Rosomakho +--- + drivers/mmc/host/bcm2835-mmc.c | 21 ++++++++++++++------- + 1 file changed, 14 insertions(+), 7 deletions(-) + +diff --git a/drivers/mmc/host/bcm2835-mmc.c b/drivers/mmc/host/bcm2835-mmc.c +index 68daa59d313b4..1311c8268e83e 100644 +--- a/drivers/mmc/host/bcm2835-mmc.c ++++ b/drivers/mmc/host/bcm2835-mmc.c +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #include "sdhci.h" + +@@ -344,16 +345,17 @@ static void bcm2835_mmc_dma_complete(void *param) + + host->use_dma = false; + +- if (host->data && !(host->data->flags & MMC_DATA_WRITE)) { +- /* otherwise handled in SDHCI IRQ */ ++ if (host->data) { + dma_chan = host->dma_chan_rxtx; +- dir_data = DMA_FROM_DEVICE; +- ++ if (host->data->flags & MMC_DATA_WRITE) ++ dir_data = DMA_TO_DEVICE; ++ else ++ dir_data = DMA_FROM_DEVICE; + dma_unmap_sg(dma_chan->device->dev, + host->data->sg, host->data->sg_len, + dir_data); +- +- bcm2835_mmc_finish_data(host); ++ if (! (host->data->flags & MMC_DATA_WRITE)) ++ bcm2835_mmc_finish_data(host); + } else if (host->wait_for_dma) { + host->wait_for_dma = false; + tasklet_schedule(&host->finish_tasklet); +@@ -539,6 +541,8 @@ static void bcm2835_mmc_transfer_dma(struct bcm2835_host *host) + spin_unlock_irqrestore(&host->lock, flags); + dmaengine_submit(desc); + dma_async_issue_pending(dma_chan); ++ } else { ++ dma_unmap_sg(dma_chan->device->dev, host->data->sg, len, dir_data); + } + + } +@@ -1374,7 +1378,10 @@ static int bcm2835_mmc_add_host(struct bcm2835_host *host) + } + #endif + mmc->max_segs = 128; +- mmc->max_req_size = 524288; ++ if (swiotlb_max_segment()) ++ mmc->max_req_size = (1 << IO_TLB_SHIFT) * IO_TLB_SEGSIZE; ++ else ++ mmc->max_req_size = 524288; + mmc->max_seg_size = mmc->max_req_size; + mmc->max_blk_size = 512; + mmc->max_blk_count = 65535;