From: Greg Kroah-Hartman Date: Sat, 21 Oct 2023 09:17:40 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v4.14.328~65 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1be425e852e859cad813fb58f315329b966c2390;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: acpi-irq-fix-incorrect-return-value-in-acpi_register_gsi.patch mmc-core-capture-correct-oemid-bits-for-emmc-cards.patch mmc-core-sdio-hold-retuning-if-sdio-in-1-bit-mode.patch mtd-physmap-core-restore-map_rom-fallback.patch mtd-rawnand-qcom-unmap-the-right-resource-upon-probe-failure.patch mtd-spinand-micron-correct-bitmask-for-ecc-status.patch revert-pinctrl-avoid-unsafe-code-pattern-in-find_pinctrl.patch --- diff --git a/queue-5.4/acpi-irq-fix-incorrect-return-value-in-acpi_register_gsi.patch b/queue-5.4/acpi-irq-fix-incorrect-return-value-in-acpi_register_gsi.patch new file mode 100644 index 00000000000..a312dc4f36b --- /dev/null +++ b/queue-5.4/acpi-irq-fix-incorrect-return-value-in-acpi_register_gsi.patch @@ -0,0 +1,48 @@ +From 0c21a18d5d6c6a73d098fb9b4701572370942df9 Mon Sep 17 00:00:00 2001 +From: Sunil V L +Date: Mon, 16 Oct 2023 22:39:39 +0530 +Subject: ACPI: irq: Fix incorrect return value in acpi_register_gsi() + +From: Sunil V L + +commit 0c21a18d5d6c6a73d098fb9b4701572370942df9 upstream. + +acpi_register_gsi() should return a negative value in case of failure. + +Currently, it returns the return value from irq_create_fwspec_mapping(). +However, irq_create_fwspec_mapping() returns 0 for failure. Fix the +issue by returning -EINVAL if irq_create_fwspec_mapping() returns zero. + +Fixes: d44fa3d46079 ("ACPI: Add support for ResourceSource/IRQ domain mapping") +Cc: 4.11+ # 4.11+ +Signed-off-by: Sunil V L +[ rjw: Rename a new local variable ] +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/acpi/irq.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/drivers/acpi/irq.c ++++ b/drivers/acpi/irq.c +@@ -52,6 +52,7 @@ int acpi_register_gsi(struct device *dev + int polarity) + { + struct irq_fwspec fwspec; ++ unsigned int irq; + + if (WARN_ON(!acpi_gsi_domain_id)) { + pr_warn("GSI: No registered irqchip, giving up\n"); +@@ -63,7 +64,11 @@ int acpi_register_gsi(struct device *dev + fwspec.param[1] = acpi_dev_get_irq_type(trigger, polarity); + fwspec.param_count = 2; + +- return irq_create_fwspec_mapping(&fwspec); ++ irq = irq_create_fwspec_mapping(&fwspec); ++ if (!irq) ++ return -EINVAL; ++ ++ return irq; + } + EXPORT_SYMBOL_GPL(acpi_register_gsi); + diff --git a/queue-5.4/mmc-core-capture-correct-oemid-bits-for-emmc-cards.patch b/queue-5.4/mmc-core-capture-correct-oemid-bits-for-emmc-cards.patch new file mode 100644 index 00000000000..db38f48ac8d --- /dev/null +++ b/queue-5.4/mmc-core-capture-correct-oemid-bits-for-emmc-cards.patch @@ -0,0 +1,39 @@ +From 84ee19bffc9306128cd0f1c650e89767079efeff Mon Sep 17 00:00:00 2001 +From: Avri Altman +Date: Wed, 27 Sep 2023 10:15:00 +0300 +Subject: mmc: core: Capture correct oemid-bits for eMMC cards + +From: Avri Altman + +commit 84ee19bffc9306128cd0f1c650e89767079efeff upstream. + +The OEMID is an 8-bit binary number rather than 16-bit as the current code +parses for. The OEMID occupies bits [111:104] in the CID register, see the +eMMC spec JESD84-B51 paragraph 7.2.3. It seems that the 16-bit comes from +the legacy MMC specs (v3.31 and before). + +Let's fix the parsing by simply move to use 8-bit instead of 16-bit. This +means we ignore the impact on some of those old MMC cards that may be out +there, but on the other hand this shouldn't be a problem as the OEMID seems +not be an important feature for these cards. + +Signed-off-by: Avri Altman +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20230927071500.1791882-1-avri.altman@wdc.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/core/mmc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mmc/core/mmc.c ++++ b/drivers/mmc/core/mmc.c +@@ -95,7 +95,7 @@ static int mmc_decode_cid(struct mmc_car + case 3: /* MMC v3.1 - v3.3 */ + case 4: /* MMC v4 */ + card->cid.manfid = UNSTUFF_BITS(resp, 120, 8); +- card->cid.oemid = UNSTUFF_BITS(resp, 104, 16); ++ card->cid.oemid = UNSTUFF_BITS(resp, 104, 8); + card->cid.prod_name[0] = UNSTUFF_BITS(resp, 96, 8); + card->cid.prod_name[1] = UNSTUFF_BITS(resp, 88, 8); + card->cid.prod_name[2] = UNSTUFF_BITS(resp, 80, 8); diff --git a/queue-5.4/mmc-core-sdio-hold-retuning-if-sdio-in-1-bit-mode.patch b/queue-5.4/mmc-core-sdio-hold-retuning-if-sdio-in-1-bit-mode.patch new file mode 100644 index 00000000000..2e696b4f4f9 --- /dev/null +++ b/queue-5.4/mmc-core-sdio-hold-retuning-if-sdio-in-1-bit-mode.patch @@ -0,0 +1,45 @@ +From 32a9cdb8869dc111a0c96cf8e1762be9684af15b Mon Sep 17 00:00:00 2001 +From: Haibo Chen +Date: Wed, 30 Aug 2023 17:39:22 +0800 +Subject: mmc: core: sdio: hold retuning if sdio in 1-bit mode + +From: Haibo Chen + +commit 32a9cdb8869dc111a0c96cf8e1762be9684af15b upstream. + +tuning only support in 4-bit mode or 8 bit mode, so in 1-bit mode, +need to hold retuning. + +Find this issue when use manual tuning method on imx93. When system +resume back, SDIO WIFI try to switch back to 4 bit mode, first will +trigger retuning, and all tuning command failed. + +Signed-off-by: Haibo Chen +Acked-by: Adrian Hunter +Fixes: dfa13ebbe334 ("mmc: host: Add facility to support re-tuning") +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20230830093922.3095850-1-haibo.chen@nxp.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/core/sdio.c | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +--- a/drivers/mmc/core/sdio.c ++++ b/drivers/mmc/core/sdio.c +@@ -1014,8 +1014,14 @@ static int mmc_sdio_resume(struct mmc_ho + } + err = mmc_sdio_reinit_card(host); + } else if (mmc_card_wake_sdio_irq(host)) { +- /* We may have switched to 1-bit mode during suspend */ ++ /* ++ * We may have switched to 1-bit mode during suspend, ++ * need to hold retuning, because tuning only supprt ++ * 4-bit mode or 8 bit mode. ++ */ ++ mmc_retune_hold_now(host); + err = sdio_enable_4bit_bus(host->card); ++ mmc_retune_release(host); + } + + if (err) diff --git a/queue-5.4/mtd-physmap-core-restore-map_rom-fallback.patch b/queue-5.4/mtd-physmap-core-restore-map_rom-fallback.patch new file mode 100644 index 00000000000..f5ddb337453 --- /dev/null +++ b/queue-5.4/mtd-physmap-core-restore-map_rom-fallback.patch @@ -0,0 +1,43 @@ +From 6792b7fce610bcd1cf3e07af3607fe7e2c38c1d8 Mon Sep 17 00:00:00 2001 +From: Geert Uytterhoeven +Date: Wed, 30 Aug 2023 17:00:34 +0200 +Subject: mtd: physmap-core: Restore map_rom fallback + +From: Geert Uytterhoeven + +commit 6792b7fce610bcd1cf3e07af3607fe7e2c38c1d8 upstream. + +When the exact mapping type driver was not available, the old +physmap_of_core driver fell back to mapping the region as ROM. +Unfortunately this feature was lost when the DT and pdata cases were +merged. Revive this useful feature. + +Fixes: 642b1e8dbed7bbbf ("mtd: maps: Merge physmap_of.c into physmap-core.c") +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Miquel Raynal +Link: https://lore.kernel.org/linux-mtd/550e8c8c1da4c4baeb3d71ff79b14a18d4194f9e.1693407371.git.geert+renesas@glider.be +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mtd/maps/physmap-core.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/mtd/maps/physmap-core.c ++++ b/drivers/mtd/maps/physmap-core.c +@@ -533,6 +533,17 @@ static int physmap_flash_probe(struct pl + if (info->probe_type) { + info->mtds[i] = do_map_probe(info->probe_type, + &info->maps[i]); ++ ++ /* Fall back to mapping region as ROM */ ++ if (!info->mtds[i] && IS_ENABLED(CONFIG_MTD_ROM) && ++ strcmp(info->probe_type, "map_rom")) { ++ dev_warn(&dev->dev, ++ "map_probe() failed for type %s\n", ++ info->probe_type); ++ ++ info->mtds[i] = do_map_probe("map_rom", ++ &info->maps[i]); ++ } + } else { + int j; + diff --git a/queue-5.4/mtd-rawnand-qcom-unmap-the-right-resource-upon-probe-failure.patch b/queue-5.4/mtd-rawnand-qcom-unmap-the-right-resource-upon-probe-failure.patch new file mode 100644 index 00000000000..78bc5ac7463 --- /dev/null +++ b/queue-5.4/mtd-rawnand-qcom-unmap-the-right-resource-upon-probe-failure.patch @@ -0,0 +1,34 @@ +From 5279f4a9eed3ee7d222b76511ea7a22c89e7eefd Mon Sep 17 00:00:00 2001 +From: Bibek Kumar Patro +Date: Wed, 13 Sep 2023 12:37:02 +0530 +Subject: mtd: rawnand: qcom: Unmap the right resource upon probe failure + +From: Bibek Kumar Patro + +commit 5279f4a9eed3ee7d222b76511ea7a22c89e7eefd upstream. + +We currently provide the physical address of the DMA region +rather than the output of dma_map_resource() which is obviously wrong. + +Fixes: 7330fc505af4 ("mtd: rawnand: qcom: stop using phys_to_dma()") +Cc: stable@vger.kernel.org +Reviewed-by: Manivannan Sadhasivam +Signed-off-by: Bibek Kumar Patro +Signed-off-by: Miquel Raynal +Link: https://lore.kernel.org/linux-mtd/20230913070702.12707-1-quic_bibekkum@quicinc.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mtd/nand/raw/qcom_nandc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mtd/nand/raw/qcom_nandc.c ++++ b/drivers/mtd/nand/raw/qcom_nandc.c +@@ -2972,7 +2972,7 @@ err_nandc_alloc: + err_aon_clk: + clk_disable_unprepare(nandc->core_clk); + err_core_clk: +- dma_unmap_resource(dev, res->start, resource_size(res), ++ dma_unmap_resource(dev, nandc->base_dma, resource_size(res), + DMA_BIDIRECTIONAL, 0); + return ret; + } diff --git a/queue-5.4/mtd-spinand-micron-correct-bitmask-for-ecc-status.patch b/queue-5.4/mtd-spinand-micron-correct-bitmask-for-ecc-status.patch new file mode 100644 index 00000000000..a8db5a1e10b --- /dev/null +++ b/queue-5.4/mtd-spinand-micron-correct-bitmask-for-ecc-status.patch @@ -0,0 +1,32 @@ +From 9836a987860e33943945d4b257729a4f94eae576 Mon Sep 17 00:00:00 2001 +From: Martin Kurbanov +Date: Tue, 5 Sep 2023 17:56:37 +0300 +Subject: mtd: spinand: micron: correct bitmask for ecc status + +From: Martin Kurbanov + +commit 9836a987860e33943945d4b257729a4f94eae576 upstream. + +Valid bitmask is 0x70 in the status register. + +Fixes: a508e8875e13 ("mtd: spinand: Add initial support for Micron MT29F2G01ABAGD") +Signed-off-by: Martin Kurbanov +Reviewed-by: Frieder Schrempf +Signed-off-by: Miquel Raynal +Link: https://lore.kernel.org/linux-mtd/20230905145637.139068-1-mmkurbanov@sberdevices.ru +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mtd/nand/spi/micron.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/mtd/nand/spi/micron.c ++++ b/drivers/mtd/nand/spi/micron.c +@@ -12,7 +12,7 @@ + + #define SPINAND_MFR_MICRON 0x2c + +-#define MICRON_STATUS_ECC_MASK GENMASK(7, 4) ++#define MICRON_STATUS_ECC_MASK GENMASK(6, 4) + #define MICRON_STATUS_ECC_NO_BITFLIPS (0 << 4) + #define MICRON_STATUS_ECC_1TO3_BITFLIPS (1 << 4) + #define MICRON_STATUS_ECC_4TO6_BITFLIPS (3 << 4) diff --git a/queue-5.4/revert-pinctrl-avoid-unsafe-code-pattern-in-find_pinctrl.patch b/queue-5.4/revert-pinctrl-avoid-unsafe-code-pattern-in-find_pinctrl.patch new file mode 100644 index 00000000000..17ddea546f8 --- /dev/null +++ b/queue-5.4/revert-pinctrl-avoid-unsafe-code-pattern-in-find_pinctrl.patch @@ -0,0 +1,77 @@ +From 62140a1e4dec4594d5d1e1d353747bf2ef434e8b Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Tue, 17 Oct 2023 17:18:06 +0300 +Subject: Revert "pinctrl: avoid unsafe code pattern in find_pinctrl()" + +From: Andy Shevchenko + +commit 62140a1e4dec4594d5d1e1d353747bf2ef434e8b upstream. + +The commit breaks MMC enumeration on the Intel Merrifield +plaform. + +Before: +[ 36.439057] mmc0: SDHCI controller on PCI [0000:00:01.0] using ADMA +[ 36.450924] mmc2: SDHCI controller on PCI [0000:00:01.3] using ADMA +[ 36.459355] mmc1: SDHCI controller on PCI [0000:00:01.2] using ADMA +[ 36.706399] mmc0: new DDR MMC card at address 0001 +[ 37.058972] mmc2: new ultra high speed DDR50 SDIO card at address 0001 +[ 37.278977] mmcblk0: mmc0:0001 H4G1d 3.64 GiB +[ 37.297300] mmcblk0: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 + +After: +[ 36.436704] mmc2: SDHCI controller on PCI [0000:00:01.3] using ADMA +[ 36.436720] mmc1: SDHCI controller on PCI [0000:00:01.0] using ADMA +[ 36.463685] mmc0: SDHCI controller on PCI [0000:00:01.2] using ADMA +[ 36.720627] mmc1: new DDR MMC card at address 0001 +[ 37.068181] mmc2: new ultra high speed DDR50 SDIO card at address 0001 +[ 37.279998] mmcblk1: mmc1:0001 H4G1d 3.64 GiB +[ 37.302670] mmcblk1: p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 + +This reverts commit c153a4edff6ab01370fcac8e46f9c89cca1060c2. + +Signed-off-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20231017141806.535191-1-andriy.shevchenko@linux.intel.com +Signed-off-by: Linus Walleij +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pinctrl/core.c | 16 +++++++--------- + 1 file changed, 7 insertions(+), 9 deletions(-) + +--- a/drivers/pinctrl/core.c ++++ b/drivers/pinctrl/core.c +@@ -1005,20 +1005,17 @@ static int add_setting(struct pinctrl *p + + static struct pinctrl *find_pinctrl(struct device *dev) + { +- struct pinctrl *entry, *p = NULL; ++ struct pinctrl *p; + + mutex_lock(&pinctrl_list_mutex); +- +- list_for_each_entry(entry, &pinctrl_list, node) { +- if (entry->dev == dev) { +- p = entry; +- kref_get(&p->users); +- break; ++ list_for_each_entry(p, &pinctrl_list, node) ++ if (p->dev == dev) { ++ mutex_unlock(&pinctrl_list_mutex); ++ return p; + } +- } + + mutex_unlock(&pinctrl_list_mutex); +- return p; ++ return NULL; + } + + static void pinctrl_free(struct pinctrl *p, bool inlist); +@@ -1127,6 +1124,7 @@ struct pinctrl *pinctrl_get(struct devic + p = find_pinctrl(dev); + if (p) { + dev_dbg(dev, "obtain a copy of previously claimed pinctrl\n"); ++ kref_get(&p->users); + return p; + } + diff --git a/queue-5.4/series b/queue-5.4/series index d99badf8632..675a20283f9 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -100,3 +100,10 @@ drm-panel-orientation-quirks-add-quirk-for-one-mix-2.patch btrfs-fix-some-wmaybe-uninitialized-warnings-in-ioct.patch hid-multitouch-add-required-quirk-for-synaptics-0xcd.patch bluetooth-hci_event-fix-using-memcmp-when-comparing-.patch +mtd-rawnand-qcom-unmap-the-right-resource-upon-probe-failure.patch +mtd-spinand-micron-correct-bitmask-for-ecc-status.patch +mtd-physmap-core-restore-map_rom-fallback.patch +mmc-core-sdio-hold-retuning-if-sdio-in-1-bit-mode.patch +mmc-core-capture-correct-oemid-bits-for-emmc-cards.patch +revert-pinctrl-avoid-unsafe-code-pattern-in-find_pinctrl.patch +acpi-irq-fix-incorrect-return-value-in-acpi_register_gsi.patch