From: Greg Kroah-Hartman Date: Mon, 31 Oct 2022 06:45:29 +0000 (+0100) Subject: 5.10-stable patches X-Git-Tag: v4.19.263~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=40850b3d427beaa794b9daedddac7eb76dca6ad0;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches 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 --- 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 index 00000000000..2dce19a6027 --- /dev/null +++ b/queue-5.10/counter-microchip-tcb-capture-handle-signal1-read-and-synapse.patch @@ -0,0 +1,75 @@ +From d917a62af81b133f35f627e7936e193c842a7947 Mon Sep 17 00:00:00 2001 +From: William Breathitt Gray +Date: Tue, 18 Oct 2022 08:10:14 -0400 +Subject: counter: microchip-tcb-capture: Handle Signal1 read and Synapse + +From: William Breathitt Gray + +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 +Link: https://lore.kernel.org/r/20221018121014.7368-1-william.gray@linaro.org/ +Signed-off-by: William Breathitt Gray +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..498a5a47dbb --- /dev/null +++ b/queue-5.10/mmc-core-fix-kernel-panic-when-remove-non-standard-sdio-card.patch @@ -0,0 +1,39 @@ +From 9972e6b404884adae9eec7463e30d9b3c9a70b18 Mon Sep 17 00:00:00 2001 +From: Matthew Ma +Date: Fri, 14 Oct 2022 11:49:51 +0800 +Subject: mmc: core: Fix kernel panic when remove non-standard SDIO card + +From: Matthew Ma + +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 +Reviewed-by: Weizhao Ouyang +Reviewed-by: John Wang +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20221014034951.2300386-1-ouyangweizhao@zeku.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..119c72967ca --- /dev/null +++ b/queue-5.10/mmc-sdhci_am654-select-not-depends-regmap_mmio.patch @@ -0,0 +1,39 @@ +From 8d280b1df87e0b3d1355aeac7e62b62214b93f1c Mon Sep 17 00:00:00 2001 +From: Brian Norris +Date: Mon, 24 Oct 2022 11:02:59 -0700 +Subject: mmc: sdhci_am654: 'select', not 'depends' REGMAP_MMIO + +From: Brian Norris + +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 +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20221024180300.2292208-1-briannorris@chromium.org +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + 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 diff --git a/queue-5.10/series b/queue-5.10/series index 2e030164fc3..1604488f671 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -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