From: Greg Kroah-Hartman Date: Mon, 31 Oct 2022 06:45:35 +0000 (+0100) Subject: 5.15-stable patches X-Git-Tag: v4.19.263~48 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6aeca3e728c9ad1cbf50b9c9aa504844fb2ae796;p=thirdparty%2Fkernel%2Fstable-queue.git 5.15-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-esdhc-imx-propagate-esdhc_flag_hs400-only-on-8bit-bus.patch mmc-sdhci-pci-core-disable-es-for-asus-bios-on-jasper-lake.patch mmc-sdhci_am654-select-not-depends-regmap_mmio.patch --- diff --git a/queue-5.15/counter-microchip-tcb-capture-handle-signal1-read-and-synapse.patch b/queue-5.15/counter-microchip-tcb-capture-handle-signal1-read-and-synapse.patch new file mode 100644 index 00000000000..7076f5f2eda --- /dev/null +++ b/queue-5.15/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 { +@@ -166,7 +165,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); +@@ -184,6 +183,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) { +@@ -212,8 +222,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.15/mmc-core-fix-kernel-panic-when-remove-non-standard-sdio-card.patch b/queue-5.15/mmc-core-fix-kernel-panic-when-remove-non-standard-sdio-card.patch new file mode 100644 index 00000000000..1ae95d538fa --- /dev/null +++ b/queue-5.15/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 +@@ -290,7 +290,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.15/mmc-sdhci-esdhc-imx-propagate-esdhc_flag_hs400-only-on-8bit-bus.patch b/queue-5.15/mmc-sdhci-esdhc-imx-propagate-esdhc_flag_hs400-only-on-8bit-bus.patch new file mode 100644 index 00000000000..ff4139eace2 --- /dev/null +++ b/queue-5.15/mmc-sdhci-esdhc-imx-propagate-esdhc_flag_hs400-only-on-8bit-bus.patch @@ -0,0 +1,67 @@ +From 1ed5c3b22fc78735c539e4767832aea58db6761c Mon Sep 17 00:00:00 2001 +From: Sascha Hauer +Date: Thu, 13 Oct 2022 11:32:48 +0200 +Subject: mmc: sdhci-esdhc-imx: Propagate ESDHC_FLAG_HS400* only on 8bit bus + +From: Sascha Hauer + +commit 1ed5c3b22fc78735c539e4767832aea58db6761c upstream. + +The core issues the warning "drop HS400 support since no 8-bit bus" when +one of the ESDHC_FLAG_HS400* flags is set on a non 8bit capable host. To +avoid this warning set these flags only on hosts that actually can do +8bit, i.e. have bus-width = <8> set in the device tree. + +Signed-off-by: Sascha Hauer +Reviewed-by: Haibo Chen +Fixes: 029e2476f9e6 ("mmc: sdhci-esdhc-imx: add HS400_ES support for i.MX8QXP") +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20221013093248.2220802-1-s.hauer@pengutronix.de +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/sdhci-esdhc-imx.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +--- a/drivers/mmc/host/sdhci-esdhc-imx.c ++++ b/drivers/mmc/host/sdhci-esdhc-imx.c +@@ -1643,6 +1643,10 @@ static int sdhci_esdhc_imx_probe(struct + host->mmc_host_ops.execute_tuning = usdhc_execute_tuning; + } + ++ err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data); ++ if (err) ++ goto disable_ahb_clk; ++ + if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) + sdhci_esdhc_ops.platform_execute_tuning = + esdhc_executing_tuning; +@@ -1650,13 +1654,15 @@ static int sdhci_esdhc_imx_probe(struct + if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536) + host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; + +- if (imx_data->socdata->flags & ESDHC_FLAG_HS400) ++ if (host->caps & MMC_CAP_8_BIT_DATA && ++ imx_data->socdata->flags & ESDHC_FLAG_HS400) + host->mmc->caps2 |= MMC_CAP2_HS400; + + if (imx_data->socdata->flags & ESDHC_FLAG_BROKEN_AUTO_CMD23) + host->quirks2 |= SDHCI_QUIRK2_ACMD23_BROKEN; + +- if (imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) { ++ if (host->caps & MMC_CAP_8_BIT_DATA && ++ imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) { + host->mmc->caps2 |= MMC_CAP2_HS400_ES; + host->mmc_host_ops.hs400_enhanced_strobe = + esdhc_hs400_enhanced_strobe; +@@ -1678,10 +1684,6 @@ static int sdhci_esdhc_imx_probe(struct + goto disable_ahb_clk; + } + +- err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data); +- if (err) +- goto disable_ahb_clk; +- + sdhci_esdhc_imx_hwinit(host); + + err = sdhci_add_host(host); diff --git a/queue-5.15/mmc-sdhci-pci-core-disable-es-for-asus-bios-on-jasper-lake.patch b/queue-5.15/mmc-sdhci-pci-core-disable-es-for-asus-bios-on-jasper-lake.patch new file mode 100644 index 00000000000..6004665bb7b --- /dev/null +++ b/queue-5.15/mmc-sdhci-pci-core-disable-es-for-asus-bios-on-jasper-lake.patch @@ -0,0 +1,58 @@ +From 9dc0033e4658d6f9d9952c3c0c6be3ec25bc2985 Mon Sep 17 00:00:00 2001 +From: Patrick Thompson +Date: Thu, 13 Oct 2022 17:00:17 -0400 +Subject: mmc: sdhci-pci-core: Disable ES for ASUS BIOS on Jasper Lake + +From: Patrick Thompson + +commit 9dc0033e4658d6f9d9952c3c0c6be3ec25bc2985 upstream. + +Enhanced Strobe (ES) does not work correctly on the ASUS 1100 series of +devices. Jasper Lake eMMCs (pci_id 8086:4dc4) are supposed to support +ES. There are also two system families under the series, thus this is +being scoped to the ASUS BIOS. + +The failing ES prevents the installer from writing to disk. Falling back +to HS400 without ES fixes the issue. + +Signed-off-by: Patrick Thompson +Fixes: 315e3bd7ac19 ("mmc: sdhci-pci: Add support for Intel JSL") +Acked-by: Adrian Hunter +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20221013210017.3751025-1-ptf@google.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/sdhci-pci-core.c | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +--- a/drivers/mmc/host/sdhci-pci-core.c ++++ b/drivers/mmc/host/sdhci-pci-core.c +@@ -978,6 +978,12 @@ static bool glk_broken_cqhci(struct sdhc + dmi_match(DMI_SYS_VENDOR, "IRBIS")); + } + ++static bool jsl_broken_hs400es(struct sdhci_pci_slot *slot) ++{ ++ return slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_JSL_EMMC && ++ dmi_match(DMI_BIOS_VENDOR, "ASUSTeK COMPUTER INC."); ++} ++ + static int glk_emmc_probe_slot(struct sdhci_pci_slot *slot) + { + int ret = byt_emmc_probe_slot(slot); +@@ -986,9 +992,11 @@ static int glk_emmc_probe_slot(struct sd + slot->host->mmc->caps2 |= MMC_CAP2_CQE; + + if (slot->chip->pdev->device != PCI_DEVICE_ID_INTEL_GLK_EMMC) { +- slot->host->mmc->caps2 |= MMC_CAP2_HS400_ES; +- slot->host->mmc_host_ops.hs400_enhanced_strobe = +- intel_hs400_enhanced_strobe; ++ if (!jsl_broken_hs400es(slot)) { ++ slot->host->mmc->caps2 |= MMC_CAP2_HS400_ES; ++ slot->host->mmc_host_ops.hs400_enhanced_strobe = ++ intel_hs400_enhanced_strobe; ++ } + slot->host->mmc->caps2 |= MMC_CAP2_CQE_DCMD; + } + diff --git a/queue-5.15/mmc-sdhci_am654-select-not-depends-regmap_mmio.patch b/queue-5.15/mmc-sdhci_am654-select-not-depends-regmap_mmio.patch new file mode 100644 index 00000000000..59b7ce8f868 --- /dev/null +++ b/queue-5.15/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 +@@ -1069,9 +1069,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.15/series b/queue-5.15/series index 8eb4bd0c485..499eca98339 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -33,3 +33,8 @@ 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 coresight-cti-fix-hang-in-cti_disable_hw.patch +mmc-sdhci_am654-select-not-depends-regmap_mmio.patch +mmc-core-fix-kernel-panic-when-remove-non-standard-sdio-card.patch +mmc-sdhci-pci-core-disable-es-for-asus-bios-on-jasper-lake.patch +mmc-sdhci-esdhc-imx-propagate-esdhc_flag_hs400-only-on-8bit-bus.patch +counter-microchip-tcb-capture-handle-signal1-read-and-synapse.patch