From: Greg Kroah-Hartman Date: Mon, 11 Apr 2022 13:36:00 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v4.9.310~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9baf51ec57ec134cbc0bde2c9b6d62256e7f1492;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: dmaengine-revert-dmaengine-shdma-fix-runtime-pm-imbalance-on-error.patch mmc-mmci-stm32-correctly-check-all-elements-of-sg-list.patch mmc-mmci_sdmmc-replace-sg_dma_xxx-macros.patch --- diff --git a/queue-5.4/dmaengine-revert-dmaengine-shdma-fix-runtime-pm-imbalance-on-error.patch b/queue-5.4/dmaengine-revert-dmaengine-shdma-fix-runtime-pm-imbalance-on-error.patch new file mode 100644 index 00000000000..55997c153d4 --- /dev/null +++ b/queue-5.4/dmaengine-revert-dmaengine-shdma-fix-runtime-pm-imbalance-on-error.patch @@ -0,0 +1,33 @@ +From d143f939a95696d38ff800ada14402fa50ebbd6c Mon Sep 17 00:00:00 2001 +From: Vinod Koul +Date: Thu, 10 Mar 2022 10:13:20 +0530 +Subject: dmaengine: Revert "dmaengine: shdma: Fix runtime PM imbalance on error" + +From: Vinod Koul + +commit d143f939a95696d38ff800ada14402fa50ebbd6c upstream. + +This reverts commit 455896c53d5b ("dmaengine: shdma: Fix runtime PM +imbalance on error") as the patch wrongly reduced the count on error and +did not bail out. So drop the count by reverting the patch . + +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman +--- + drivers/dma/sh/shdma-base.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/dma/sh/shdma-base.c ++++ b/drivers/dma/sh/shdma-base.c +@@ -115,10 +115,8 @@ static dma_cookie_t shdma_tx_submit(stru + ret = pm_runtime_get(schan->dev); + + spin_unlock_irq(&schan->chan_lock); +- if (ret < 0) { ++ if (ret < 0) + dev_err(schan->dev, "%s(): GET = %d\n", __func__, ret); +- pm_runtime_put(schan->dev); +- } + + pm_runtime_barrier(schan->dev); + diff --git a/queue-5.4/mmc-mmci-stm32-correctly-check-all-elements-of-sg-list.patch b/queue-5.4/mmc-mmci-stm32-correctly-check-all-elements-of-sg-list.patch new file mode 100644 index 00000000000..31d848b857a --- /dev/null +++ b/queue-5.4/mmc-mmci-stm32-correctly-check-all-elements-of-sg-list.patch @@ -0,0 +1,46 @@ +From 0d319dd5a27183b75d984e3dc495248e59f99334 Mon Sep 17 00:00:00 2001 +From: Yann Gautier +Date: Thu, 17 Mar 2022 12:19:43 +0100 +Subject: mmc: mmci: stm32: correctly check all elements of sg list + +From: Yann Gautier + +commit 0d319dd5a27183b75d984e3dc495248e59f99334 upstream. + +Use sg and not data->sg when checking sg list elements. Else only the +first element alignment is checked. +The last element should be checked the same way, for_each_sg already set +sg to sg_next(sg). + +Fixes: 46b723dd867d ("mmc: mmci: add stm32 sdmmc variant") +Cc: stable@vger.kernel.org +Signed-off-by: Yann Gautier +Link: https://lore.kernel.org/r/20220317111944.116148-2-yann.gautier@foss.st.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/mmci_stm32_sdmmc.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/mmc/host/mmci_stm32_sdmmc.c ++++ b/drivers/mmc/host/mmci_stm32_sdmmc.c +@@ -36,8 +36,8 @@ int sdmmc_idma_validate_data(struct mmci + * excepted the last element which has no constraint on idmasize + */ + for_each_sg(data->sg, sg, data->sg_len - 1, i) { +- if (!IS_ALIGNED(data->sg->offset, sizeof(u32)) || +- !IS_ALIGNED(data->sg->length, SDMMC_IDMA_BURST)) { ++ if (!IS_ALIGNED(sg->offset, sizeof(u32)) || ++ !IS_ALIGNED(sg->length, SDMMC_IDMA_BURST)) { + dev_err(mmc_dev(host->mmc), + "unaligned scatterlist: ofst:%x length:%d\n", + data->sg->offset, data->sg->length); +@@ -45,7 +45,7 @@ int sdmmc_idma_validate_data(struct mmci + } + } + +- if (!IS_ALIGNED(data->sg->offset, sizeof(u32))) { ++ if (!IS_ALIGNED(sg->offset, sizeof(u32))) { + dev_err(mmc_dev(host->mmc), + "unaligned last scatterlist: ofst:%x length:%d\n", + data->sg->offset, data->sg->length); diff --git a/queue-5.4/mmc-mmci_sdmmc-replace-sg_dma_xxx-macros.patch b/queue-5.4/mmc-mmci_sdmmc-replace-sg_dma_xxx-macros.patch new file mode 100644 index 00000000000..1113c2db9cc --- /dev/null +++ b/queue-5.4/mmc-mmci_sdmmc-replace-sg_dma_xxx-macros.patch @@ -0,0 +1,44 @@ +From 127e6e98ca9b8ac4f87698ebce1508e3449bb791 Mon Sep 17 00:00:00 2001 +From: Ludovic Barre +Date: Tue, 28 Jan 2020 10:06:28 +0100 +Subject: mmc: mmci_sdmmc: Replace sg_dma_xxx macros + +From: Ludovic Barre + +commit 127e6e98ca9b8ac4f87698ebce1508e3449bb791 upstream. + +sg_dma_xxx should be used after a dma_map_sg call has been done to get bus +addresses of each of the SG entries and their lengths. But mmci_host_ops +validate_data can be called before dma_map_sg. This patch replaces theses +macros by sg->offset and sg->length which are always defined. + +Signed-off-by: Ludovic Barre +Link: https://lore.kernel.org/r/20200128090636.13689-2-ludovic.barre@st.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/mmci_stm32_sdmmc.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/mmc/host/mmci_stm32_sdmmc.c ++++ b/drivers/mmc/host/mmci_stm32_sdmmc.c +@@ -36,8 +36,8 @@ int sdmmc_idma_validate_data(struct mmci + * excepted the last element which has no constraint on idmasize + */ + for_each_sg(data->sg, sg, data->sg_len - 1, i) { +- if (!IS_ALIGNED(sg_dma_address(data->sg), sizeof(u32)) || +- !IS_ALIGNED(sg_dma_len(data->sg), SDMMC_IDMA_BURST)) { ++ if (!IS_ALIGNED(data->sg->offset, sizeof(u32)) || ++ !IS_ALIGNED(data->sg->length, SDMMC_IDMA_BURST)) { + dev_err(mmc_dev(host->mmc), + "unaligned scatterlist: ofst:%x length:%d\n", + data->sg->offset, data->sg->length); +@@ -45,7 +45,7 @@ int sdmmc_idma_validate_data(struct mmci + } + } + +- if (!IS_ALIGNED(sg_dma_address(data->sg), sizeof(u32))) { ++ if (!IS_ALIGNED(data->sg->offset, sizeof(u32))) { + dev_err(mmc_dev(host->mmc), + "unaligned last scatterlist: ofst:%x length:%d\n", + data->sg->offset, data->sg->length); diff --git a/queue-5.4/series b/queue-5.4/series index dd37c8adba8..955026df8b7 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -457,3 +457,6 @@ perf-qcom_l2_pmu-fix-an-incorrect-null-check-on-list-iterator.patch irqchip-gic-v3-fix-gicr_ctlr.rwp-polling.patch tools-build-filter-out-options-and-warnings-not-supported-by-clang.patch tools-build-use-shell-instead-of-to-get-embedded-libperl-s-ccopts.patch +dmaengine-revert-dmaengine-shdma-fix-runtime-pm-imbalance-on-error.patch +mmc-mmci_sdmmc-replace-sg_dma_xxx-macros.patch +mmc-mmci-stm32-correctly-check-all-elements-of-sg-list.patch