]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2022 06:45:29 +0000 (07:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2022 06:45:29 +0000 (07:45 +0100)
added patches:
counter-microchip-tcb-capture-handle-signal1-read-and-synapse.patch
mmc-core-fix-kernel-panic-when-remove-non-standard-sdio-card.patch
mmc-sdhci_am654-select-not-depends-regmap_mmio.patch

queue-5.10/counter-microchip-tcb-capture-handle-signal1-read-and-synapse.patch [new file with mode: 0644]
queue-5.10/mmc-core-fix-kernel-panic-when-remove-non-standard-sdio-card.patch [new file with mode: 0644]
queue-5.10/mmc-sdhci_am654-select-not-depends-regmap_mmio.patch [new file with mode: 0644]
queue-5.10/series

diff --git a/queue-5.10/counter-microchip-tcb-capture-handle-signal1-read-and-synapse.patch b/queue-5.10/counter-microchip-tcb-capture-handle-signal1-read-and-synapse.patch
new file mode 100644 (file)
index 0000000..2dce19a
--- /dev/null
@@ -0,0 +1,75 @@
+From d917a62af81b133f35f627e7936e193c842a7947 Mon Sep 17 00:00:00 2001
+From: William Breathitt Gray <william.gray@linaro.org>
+Date: Tue, 18 Oct 2022 08:10:14 -0400
+Subject: counter: microchip-tcb-capture: Handle Signal1 read and Synapse
+
+From: William Breathitt Gray <william.gray@linaro.org>
+
+commit d917a62af81b133f35f627e7936e193c842a7947 upstream.
+
+The signal_read(), action_read(), and action_write() callbacks have been
+assuming Signal0 is requested without checking. This results in requests
+for Signal1 returning data for Signal0. This patch fixes these
+oversights by properly checking for the Signal's id in the respective
+callbacks and handling accordingly based on the particular Signal
+requested. The trig_inverted member of the mchp_tc_data is removed as
+superfluous.
+
+Fixes: 106b104137fd ("counter: Add microchip TCB capture counter")
+Cc: stable@vger.kernel.org
+Reviewed-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
+Link: https://lore.kernel.org/r/20221018121014.7368-1-william.gray@linaro.org/
+Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/counter/microchip-tcb-capture.c |   18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
+
+--- a/drivers/counter/microchip-tcb-capture.c
++++ b/drivers/counter/microchip-tcb-capture.c
+@@ -29,7 +29,6 @@ struct mchp_tc_data {
+       int qdec_mode;
+       int num_channels;
+       int channel[2];
+-      bool trig_inverted;
+ };
+ enum mchp_tc_count_function {
+@@ -163,7 +162,7 @@ static int mchp_tc_count_signal_read(str
+       regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], SR), &sr);
+-      if (priv->trig_inverted)
++      if (signal->id == 1)
+               sigstatus = (sr & ATMEL_TC_MTIOB);
+       else
+               sigstatus = (sr & ATMEL_TC_MTIOA);
+@@ -181,6 +180,17 @@ static int mchp_tc_count_action_get(stru
+       struct mchp_tc_data *const priv = counter->priv;
+       u32 cmr;
++      if (priv->qdec_mode) {
++              *action = COUNTER_SYNAPSE_ACTION_BOTH_EDGES;
++              return 0;
++      }
++
++      /* Only TIOA signal is evaluated in non-QDEC mode */
++      if (synapse->signal->id != 0) {
++              *action = COUNTER_SYNAPSE_ACTION_NONE;
++              return 0;
++      }
++
+       regmap_read(priv->regmap, ATMEL_TC_REG(priv->channel[0], CMR), &cmr);
+       switch (cmr & ATMEL_TC_ETRGEDG) {
+@@ -209,8 +219,8 @@ static int mchp_tc_count_action_set(stru
+       struct mchp_tc_data *const priv = counter->priv;
+       u32 edge = ATMEL_TC_ETRGEDG_NONE;
+-      /* QDEC mode is rising edge only */
+-      if (priv->qdec_mode)
++      /* QDEC mode is rising edge only; only TIOA handled in non-QDEC mode */
++      if (priv->qdec_mode || synapse->signal->id != 0)
+               return -EINVAL;
+       switch (action) {
diff --git a/queue-5.10/mmc-core-fix-kernel-panic-when-remove-non-standard-sdio-card.patch b/queue-5.10/mmc-core-fix-kernel-panic-when-remove-non-standard-sdio-card.patch
new file mode 100644 (file)
index 0000000..498a5a4
--- /dev/null
@@ -0,0 +1,39 @@
+From 9972e6b404884adae9eec7463e30d9b3c9a70b18 Mon Sep 17 00:00:00 2001
+From: Matthew Ma <mahongwei@zeku.com>
+Date: Fri, 14 Oct 2022 11:49:51 +0800
+Subject: mmc: core: Fix kernel panic when remove non-standard SDIO card
+
+From: Matthew Ma <mahongwei@zeku.com>
+
+commit 9972e6b404884adae9eec7463e30d9b3c9a70b18 upstream.
+
+SDIO tuple is only allocated for standard SDIO card, especially it causes
+memory corruption issues when the non-standard SDIO card has removed, which
+is because the card device's reference counter does not increase for it at
+sdio_init_func(), but all SDIO card device reference counter gets decreased
+at sdio_release_func().
+
+Fixes: 6f51be3d37df ("sdio: allow non-standard SDIO cards")
+Signed-off-by: Matthew Ma <mahongwei@zeku.com>
+Reviewed-by: Weizhao Ouyang <ouyangweizhao@zeku.com>
+Reviewed-by: John Wang <wangdayu@zeku.com>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20221014034951.2300386-1-ouyangweizhao@zeku.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mmc/core/sdio_bus.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/mmc/core/sdio_bus.c
++++ b/drivers/mmc/core/sdio_bus.c
+@@ -292,7 +292,8 @@ static void sdio_release_func(struct dev
+ {
+       struct sdio_func *func = dev_to_sdio_func(dev);
+-      sdio_free_func_cis(func);
++      if (!(func->card->quirks & MMC_QUIRK_NONSTD_SDIO))
++              sdio_free_func_cis(func);
+       kfree(func->info);
+       kfree(func->tmpbuf);
diff --git a/queue-5.10/mmc-sdhci_am654-select-not-depends-regmap_mmio.patch b/queue-5.10/mmc-sdhci_am654-select-not-depends-regmap_mmio.patch
new file mode 100644 (file)
index 0000000..119c729
--- /dev/null
@@ -0,0 +1,39 @@
+From 8d280b1df87e0b3d1355aeac7e62b62214b93f1c Mon Sep 17 00:00:00 2001
+From: Brian Norris <briannorris@chromium.org>
+Date: Mon, 24 Oct 2022 11:02:59 -0700
+Subject: mmc: sdhci_am654: 'select', not 'depends' REGMAP_MMIO
+
+From: Brian Norris <briannorris@chromium.org>
+
+commit 8d280b1df87e0b3d1355aeac7e62b62214b93f1c upstream.
+
+REGMAP_MMIO is not user-configurable, so we can only satisfy this
+dependency by enabling some other Kconfig symbol that properly 'select's
+it. Use select like everybody else.
+
+Noticed when trying to enable this driver for compile testing.
+
+Fixes: 59592cc1f593 ("mmc: sdhci_am654: Add dependency on MMC_SDHCI_AM654")
+Signed-off-by: Brian Norris <briannorris@chromium.org>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20221024180300.2292208-1-briannorris@chromium.org
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mmc/host/Kconfig |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/mmc/host/Kconfig
++++ b/drivers/mmc/host/Kconfig
+@@ -1079,9 +1079,10 @@ config MMC_SDHCI_OMAP
+ config MMC_SDHCI_AM654
+       tristate "Support for the SDHCI Controller in TI's AM654 SOCs"
+-      depends on MMC_SDHCI_PLTFM && OF && REGMAP_MMIO
++      depends on MMC_SDHCI_PLTFM && OF
+       select MMC_SDHCI_IO_ACCESSORS
+       select MMC_CQHCI
++      select REGMAP_MMIO
+       help
+         This selects the Secure Digital Host Controller Interface (SDHCI)
+         support present in TI's AM654 SOCs. The controller supports
index 2e030164fc34ef827ed6ac79fc0590c77ac38ccd..1604488f671f80291714114f428e8d9b2e1f3da6 100644 (file)
@@ -22,3 +22,6 @@ scsi-qla2xxx-use-transport-defined-speed-mask-for-supported_speeds.patch
 drm-msm-dsi-fix-memory-corruption-with-too-many-bridges.patch
 drm-msm-hdmi-fix-memory-corruption-with-too-many-bridges.patch
 drm-msm-dp-fix-irq-lifetime.patch
+mmc-sdhci_am654-select-not-depends-regmap_mmio.patch
+mmc-core-fix-kernel-panic-when-remove-non-standard-sdio-card.patch
+counter-microchip-tcb-capture-handle-signal1-read-and-synapse.patch