]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Apr 2022 13:36:00 +0000 (15:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Apr 2022 13:36:00 +0000 (15:36 +0200)
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

queue-5.4/dmaengine-revert-dmaengine-shdma-fix-runtime-pm-imbalance-on-error.patch [new file with mode: 0644]
queue-5.4/mmc-mmci-stm32-correctly-check-all-elements-of-sg-list.patch [new file with mode: 0644]
queue-5.4/mmc-mmci_sdmmc-replace-sg_dma_xxx-macros.patch [new file with mode: 0644]
queue-5.4/series

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 (file)
index 0000000..55997c1
--- /dev/null
@@ -0,0 +1,33 @@
+From d143f939a95696d38ff800ada14402fa50ebbd6c Mon Sep 17 00:00:00 2001
+From: Vinod Koul <vkoul@kernel.org>
+Date: Thu, 10 Mar 2022 10:13:20 +0530
+Subject: dmaengine: Revert "dmaengine: shdma: Fix runtime PM imbalance on error"
+
+From: Vinod Koul <vkoul@kernel.org>
+
+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 <vkoul@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 (file)
index 0000000..31d848b
--- /dev/null
@@ -0,0 +1,46 @@
+From 0d319dd5a27183b75d984e3dc495248e59f99334 Mon Sep 17 00:00:00 2001
+From: Yann Gautier <yann.gautier@foss.st.com>
+Date: Thu, 17 Mar 2022 12:19:43 +0100
+Subject: mmc: mmci: stm32: correctly check all elements of sg list
+
+From: Yann Gautier <yann.gautier@foss.st.com>
+
+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 <yann.gautier@foss.st.com>
+Link: https://lore.kernel.org/r/20220317111944.116148-2-yann.gautier@foss.st.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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 (file)
index 0000000..1113c2d
--- /dev/null
@@ -0,0 +1,44 @@
+From 127e6e98ca9b8ac4f87698ebce1508e3449bb791 Mon Sep 17 00:00:00 2001
+From: Ludovic Barre <ludovic.barre@st.com>
+Date: Tue, 28 Jan 2020 10:06:28 +0100
+Subject: mmc: mmci_sdmmc: Replace sg_dma_xxx macros
+
+From: Ludovic Barre <ludovic.barre@st.com>
+
+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 <ludovic.barre@st.com>
+Link: https://lore.kernel.org/r/20200128090636.13689-2-ludovic.barre@st.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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);
index dd37c8adba87ba38cb5237a71a1f9cf456116b75..955026df8b71191f0907bb19c852b393c3ba8ce1 100644 (file)
@@ -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