Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'mmc-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc

Pull MMC fixes from Ulf Hansson:
"MMC core:
- Cancel recovery work on cleanup to avoid NULL pointer dereference
- Fix error path in the read/write error recovery path
- Fix kernel panic when remove non-standard SDIO card
- Fix WRITE_ZEROES handling for CQE

MMC host:
- sdhci_am654: Fixup Kconfig dependency for REGMAP_MMIO
- sdhci-esdhc-imx: Avoid warning of misconfigured bus-width
- sdhci-pci: Disable broken HS400 ES mode for ASUS BIOS on Jasper
Lake"

* tag 'mmc-v6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
mmc: sdhci_am654: 'select', not 'depends' REGMAP_MMIO
mmc: core: Fix WRITE_ZEROES CQE handling
mmc: core: Fix kernel panic when remove non-standard SDIO card
mmc: sdhci-pci-core: Disable ES for ASUS BIOS on Jasper Lake
mmc: sdhci-esdhc-imx: Propagate ESDHC_FLAG_HS400* only on 8bit bus
mmc: queue: Cancel recovery work on cleanup
mmc: block: Remove error check of hw_reset on reset

+57 -29
+26 -18
drivers/mmc/core/block.c
··· 134 134 * track of the current selected device partition. 135 135 */ 136 136 unsigned int part_curr; 137 + #define MMC_BLK_PART_INVALID UINT_MAX /* Unknown partition active */ 137 138 int area_type; 138 139 139 140 /* debugfs files (only in main mmc_blk_data) */ ··· 988 987 return ms; 989 988 } 990 989 990 + /* 991 + * Attempts to reset the card and get back to the requested partition. 992 + * Therefore any error here must result in cancelling the block layer 993 + * request, it must not be reattempted without going through the mmc_blk 994 + * partition sanity checks. 995 + */ 991 996 static int mmc_blk_reset(struct mmc_blk_data *md, struct mmc_host *host, 992 997 int type) 993 998 { 994 999 int err; 1000 + struct mmc_blk_data *main_md = dev_get_drvdata(&host->card->dev); 995 1001 996 1002 if (md->reset_done & type) 997 1003 return -EEXIST; 998 1004 999 1005 md->reset_done |= type; 1000 1006 err = mmc_hw_reset(host->card); 1007 + /* 1008 + * A successful reset will leave the card in the main partition, but 1009 + * upon failure it might not be, so set it to MMC_BLK_PART_INVALID 1010 + * in that case. 1011 + */ 1012 + main_md->part_curr = err ? MMC_BLK_PART_INVALID : main_md->part_type; 1013 + if (err) 1014 + return err; 1001 1015 /* Ensure we switch back to the correct partition */ 1002 - if (err) { 1003 - struct mmc_blk_data *main_md = 1004 - dev_get_drvdata(&host->card->dev); 1005 - int part_err; 1006 - 1007 - main_md->part_curr = main_md->part_type; 1008 - part_err = mmc_blk_part_switch(host->card, md->part_type); 1009 - if (part_err) { 1010 - /* 1011 - * We have failed to get back into the correct 1012 - * partition, so we need to abort the whole request. 1013 - */ 1014 - return -ENODEV; 1015 - } 1016 - } 1017 - return err; 1016 + if (mmc_blk_part_switch(host->card, md->part_type)) 1017 + /* 1018 + * We have failed to get back into the correct 1019 + * partition, so we need to abort the whole request. 1020 + */ 1021 + return -ENODEV; 1022 + return 0; 1018 1023 } 1019 1024 1020 1025 static inline void mmc_blk_reset_success(struct mmc_blk_data *md, int type) ··· 1878 1871 return; 1879 1872 1880 1873 /* Reset before last retry */ 1881 - if (mqrq->retries + 1 == MMC_MAX_RETRIES) 1882 - mmc_blk_reset(md, card->host, type); 1874 + if (mqrq->retries + 1 == MMC_MAX_RETRIES && 1875 + mmc_blk_reset(md, card->host, type)) 1876 + return; 1883 1877 1884 1878 /* Command errors fail fast, so use all MMC_MAX_RETRIES */ 1885 1879 if (brq->sbc.error || brq->cmd.error)
+8
drivers/mmc/core/queue.c
··· 48 48 case REQ_OP_DRV_OUT: 49 49 case REQ_OP_DISCARD: 50 50 case REQ_OP_SECURE_ERASE: 51 + case REQ_OP_WRITE_ZEROES: 51 52 return MMC_ISSUE_SYNC; 52 53 case REQ_OP_FLUSH: 53 54 return mmc_cqe_can_dcmd(host) ? MMC_ISSUE_DCMD : MMC_ISSUE_SYNC; ··· 493 492 */ 494 493 if (blk_queue_quiesced(q)) 495 494 blk_mq_unquiesce_queue(q); 495 + 496 + /* 497 + * If the recovery completes the last (and only remaining) request in 498 + * the queue, and the card has been removed, we could end up here with 499 + * the recovery not quite finished yet, so cancel it. 500 + */ 501 + cancel_work_sync(&mq->recovery_work); 496 502 497 503 blk_mq_free_tag_set(&mq->tag_set); 498 504
+2 -1
drivers/mmc/core/sdio_bus.c
··· 291 291 { 292 292 struct sdio_func *func = dev_to_sdio_func(dev); 293 293 294 - sdio_free_func_cis(func); 294 + if (!(func->card->quirks & MMC_QUIRK_NONSTD_SDIO)) 295 + sdio_free_func_cis(func); 295 296 296 297 kfree(func->info); 297 298 kfree(func->tmpbuf);
+2 -1
drivers/mmc/host/Kconfig
··· 1075 1075 1076 1076 config MMC_SDHCI_AM654 1077 1077 tristate "Support for the SDHCI Controller in TI's AM654 SOCs" 1078 - depends on MMC_SDHCI_PLTFM && OF && REGMAP_MMIO 1078 + depends on MMC_SDHCI_PLTFM && OF 1079 1079 select MMC_SDHCI_IO_ACCESSORS 1080 1080 select MMC_CQHCI 1081 + select REGMAP_MMIO 1081 1082 help 1082 1083 This selects the Secure Digital Host Controller Interface (SDHCI) 1083 1084 support present in TI's AM654 SOCs. The controller supports
+8 -6
drivers/mmc/host/sdhci-esdhc-imx.c
··· 1660 1660 host->mmc_host_ops.execute_tuning = usdhc_execute_tuning; 1661 1661 } 1662 1662 1663 + err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data); 1664 + if (err) 1665 + goto disable_ahb_clk; 1666 + 1663 1667 if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING) 1664 1668 sdhci_esdhc_ops.platform_execute_tuning = 1665 1669 esdhc_executing_tuning; ··· 1671 1667 if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536) 1672 1668 host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; 1673 1669 1674 - if (imx_data->socdata->flags & ESDHC_FLAG_HS400) 1670 + if (host->caps & MMC_CAP_8_BIT_DATA && 1671 + imx_data->socdata->flags & ESDHC_FLAG_HS400) 1675 1672 host->mmc->caps2 |= MMC_CAP2_HS400; 1676 1673 1677 1674 if (imx_data->socdata->flags & ESDHC_FLAG_BROKEN_AUTO_CMD23) 1678 1675 host->quirks2 |= SDHCI_QUIRK2_ACMD23_BROKEN; 1679 1676 1680 - if (imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) { 1677 + if (host->caps & MMC_CAP_8_BIT_DATA && 1678 + imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) { 1681 1679 host->mmc->caps2 |= MMC_CAP2_HS400_ES; 1682 1680 host->mmc_host_ops.hs400_enhanced_strobe = 1683 1681 esdhc_hs400_enhanced_strobe; ··· 1700 1694 if (err) 1701 1695 goto disable_ahb_clk; 1702 1696 } 1703 - 1704 - err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data); 1705 - if (err) 1706 - goto disable_ahb_clk; 1707 1697 1708 1698 sdhci_esdhc_imx_hwinit(host); 1709 1699
+11 -3
drivers/mmc/host/sdhci-pci-core.c
··· 914 914 dmi_match(DMI_SYS_VENDOR, "IRBIS")); 915 915 } 916 916 917 + static bool jsl_broken_hs400es(struct sdhci_pci_slot *slot) 918 + { 919 + return slot->chip->pdev->device == PCI_DEVICE_ID_INTEL_JSL_EMMC && 920 + dmi_match(DMI_BIOS_VENDOR, "ASUSTeK COMPUTER INC."); 921 + } 922 + 917 923 static int glk_emmc_probe_slot(struct sdhci_pci_slot *slot) 918 924 { 919 925 int ret = byt_emmc_probe_slot(slot); ··· 928 922 slot->host->mmc->caps2 |= MMC_CAP2_CQE; 929 923 930 924 if (slot->chip->pdev->device != PCI_DEVICE_ID_INTEL_GLK_EMMC) { 931 - slot->host->mmc->caps2 |= MMC_CAP2_HS400_ES; 932 - slot->host->mmc_host_ops.hs400_enhanced_strobe = 933 - intel_hs400_enhanced_strobe; 925 + if (!jsl_broken_hs400es(slot)) { 926 + slot->host->mmc->caps2 |= MMC_CAP2_HS400_ES; 927 + slot->host->mmc_host_ops.hs400_enhanced_strobe = 928 + intel_hs400_enhanced_strobe; 929 + } 934 930 slot->host->mmc->caps2 |= MMC_CAP2_CQE_DCMD; 935 931 } 936 932