Skip to content

Commit 203fc31

Browse files
committed
Merge tag 'mmc-v6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC fixes from Ulf Hansson: "MMC core: - Fix error propagation for the non-block-device I/O paths MMC host: - sdhci-cadence: Fix an error path during probe - sdhci-esdhc-imx: Fix support for the 'no-mmc-hs400' DT property" * tag 'mmc-v6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-esdhc-imx: make "no-mmc-hs400" works mmc: sdhci-cadence: Fix an error handling path in sdhci_cdns_probe() mmc: block: ensure error propagation for non-blk
2 parents 9d64600 + 81dce14 commit 203fc31

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

drivers/mmc/core/block.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ static ssize_t power_ro_lock_store(struct device *dev,
264264
goto out_put;
265265
}
266266
req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_BOOT_WP;
267+
req_to_mmc_queue_req(req)->drv_op_result = -EIO;
267268
blk_execute_rq(req, false);
268269
ret = req_to_mmc_queue_req(req)->drv_op_result;
269270
blk_mq_free_request(req);
@@ -651,6 +652,7 @@ static int mmc_blk_ioctl_cmd(struct mmc_blk_data *md,
651652
idatas[0] = idata;
652653
req_to_mmc_queue_req(req)->drv_op =
653654
rpmb ? MMC_DRV_OP_IOCTL_RPMB : MMC_DRV_OP_IOCTL;
655+
req_to_mmc_queue_req(req)->drv_op_result = -EIO;
654656
req_to_mmc_queue_req(req)->drv_op_data = idatas;
655657
req_to_mmc_queue_req(req)->ioc_count = 1;
656658
blk_execute_rq(req, false);
@@ -722,6 +724,7 @@ static int mmc_blk_ioctl_multi_cmd(struct mmc_blk_data *md,
722724
}
723725
req_to_mmc_queue_req(req)->drv_op =
724726
rpmb ? MMC_DRV_OP_IOCTL_RPMB : MMC_DRV_OP_IOCTL;
727+
req_to_mmc_queue_req(req)->drv_op_result = -EIO;
725728
req_to_mmc_queue_req(req)->drv_op_data = idata;
726729
req_to_mmc_queue_req(req)->ioc_count = n;
727730
blk_execute_rq(req, false);
@@ -2806,6 +2809,7 @@ static int mmc_dbg_card_status_get(void *data, u64 *val)
28062809
if (IS_ERR(req))
28072810
return PTR_ERR(req);
28082811
req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_GET_CARD_STATUS;
2812+
req_to_mmc_queue_req(req)->drv_op_result = -EIO;
28092813
blk_execute_rq(req, false);
28102814
ret = req_to_mmc_queue_req(req)->drv_op_result;
28112815
if (ret >= 0) {
@@ -2844,6 +2848,7 @@ static int mmc_ext_csd_open(struct inode *inode, struct file *filp)
28442848
goto out_free;
28452849
}
28462850
req_to_mmc_queue_req(req)->drv_op = MMC_DRV_OP_GET_EXT_CSD;
2851+
req_to_mmc_queue_req(req)->drv_op_result = -EIO;
28472852
req_to_mmc_queue_req(req)->drv_op_data = &ext_csd;
28482853
blk_execute_rq(req, false);
28492854
err = req_to_mmc_queue_req(req)->drv_op_result;

drivers/mmc/host/sdhci-cadence.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,11 @@ static int sdhci_cdns_probe(struct platform_device *pdev)
540540

541541
if (host->mmc->caps & MMC_CAP_HW_RESET) {
542542
priv->rst_hw = devm_reset_control_get_optional_exclusive(dev, NULL);
543-
if (IS_ERR(priv->rst_hw))
544-
return dev_err_probe(mmc_dev(host->mmc), PTR_ERR(priv->rst_hw),
545-
"reset controller error\n");
543+
if (IS_ERR(priv->rst_hw)) {
544+
ret = dev_err_probe(mmc_dev(host->mmc), PTR_ERR(priv->rst_hw),
545+
"reset controller error\n");
546+
goto free;
547+
}
546548
if (priv->rst_hw)
547549
host->mmc_host_ops.card_hw_reset = sdhci_cdns_mmc_hw_reset;
548550
}

drivers/mmc/host/sdhci-esdhc-imx.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,6 +1634,10 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev,
16341634
if (ret)
16351635
return ret;
16361636

1637+
/* HS400/HS400ES require 8 bit bus */
1638+
if (!(host->mmc->caps & MMC_CAP_8_BIT_DATA))
1639+
host->mmc->caps2 &= ~(MMC_CAP2_HS400 | MMC_CAP2_HS400_ES);
1640+
16371641
if (mmc_gpio_get_cd(host->mmc) >= 0)
16381642
host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
16391643

@@ -1724,26 +1728,20 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
17241728
host->mmc_host_ops.init_card = usdhc_init_card;
17251729
}
17261730

1727-
err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data);
1728-
if (err)
1729-
goto disable_ahb_clk;
1730-
17311731
if (imx_data->socdata->flags & ESDHC_FLAG_MAN_TUNING)
17321732
sdhci_esdhc_ops.platform_execute_tuning =
17331733
esdhc_executing_tuning;
17341734

17351735
if (imx_data->socdata->flags & ESDHC_FLAG_ERR004536)
17361736
host->quirks |= SDHCI_QUIRK_BROKEN_ADMA;
17371737

1738-
if (host->mmc->caps & MMC_CAP_8_BIT_DATA &&
1739-
imx_data->socdata->flags & ESDHC_FLAG_HS400)
1738+
if (imx_data->socdata->flags & ESDHC_FLAG_HS400)
17401739
host->mmc->caps2 |= MMC_CAP2_HS400;
17411740

17421741
if (imx_data->socdata->flags & ESDHC_FLAG_BROKEN_AUTO_CMD23)
17431742
host->quirks2 |= SDHCI_QUIRK2_ACMD23_BROKEN;
17441743

1745-
if (host->mmc->caps & MMC_CAP_8_BIT_DATA &&
1746-
imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) {
1744+
if (imx_data->socdata->flags & ESDHC_FLAG_HS400_ES) {
17471745
host->mmc->caps2 |= MMC_CAP2_HS400_ES;
17481746
host->mmc_host_ops.hs400_enhanced_strobe =
17491747
esdhc_hs400_enhanced_strobe;
@@ -1765,6 +1763,10 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
17651763
goto disable_ahb_clk;
17661764
}
17671765

1766+
err = sdhci_esdhc_imx_probe_dt(pdev, host, imx_data);
1767+
if (err)
1768+
goto disable_ahb_clk;
1769+
17681770
sdhci_esdhc_imx_hwinit(host);
17691771

17701772
err = sdhci_add_host(host);

0 commit comments

Comments
 (0)