From: Masahiro Yamada Date: Fri, 12 Oct 2018 14:57:38 +0000 (+0900) Subject: mmc: uniphier-sd: avoid using broken DMA RX channel X-Git-Tag: v4.20-rc1~183^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90f835414067b104d9249e279413dfa65abb99b6;p=thirdparty%2Fkernel%2Flinux.git mmc: uniphier-sd: avoid using broken DMA RX channel host->chan_rx is NULL when UNIPHIER_SD_CAP_BROKEN_DMA_RX quirk flag is set. In this case, it should not set up DMA. Signed-off-by: Masahiro Yamada Acked-by: Wolfram Sang Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/uniphier-sd.c b/drivers/mmc/host/uniphier-sd.c index df854a33c81cd..91a2be41edf61 100644 --- a/drivers/mmc/host/uniphier-sd.c +++ b/drivers/mmc/host/uniphier-sd.c @@ -252,6 +252,9 @@ static void uniphier_sd_internal_dma_start(struct tmio_mmc_host *host, u32 dma_mode; int sg_len; + if ((data->flags & MMC_DATA_READ) && !host->chan_rx) + goto force_pio; + if (WARN_ON(host->sg_len != 1)) goto force_pio;