Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff06b55e authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull MMC fixes from Ulf Hansson:
 "MMC core:
   - mmc: core: Avoid hang when claiming host

  MMC host:
   - dw_mmc: Avoid hang when accessing registers
   - dw_mmc: Fix out-of-bounds access for slot's caps
   - dw_mmc-k3: Fix out-of-bounds access through DT alias
   - sdhci-pci: Fix S0i3 for Intel BYT-based controllers"

* tag 'mmc-v4.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
  mmc: core: Avoid hanging to claim host for mmc via some nested calls
  mmc: dw_mmc: Avoid accessing registers in runtime suspended state
  mmc: dw_mmc: Fix out-of-bounds access for slot's caps
  mmc: dw_mmc: Factor out dw_mci_init_slot_caps
  mmc: dw_mmc-k3: Fix out-of-bounds access through DT alias
  mmc: sdhci-pci: Fix S0i3 for Intel BYT-based controllers
parents a5c05b74 3a574919
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -848,7 +848,6 @@ int mmc_interrupt_hpi(struct mmc_card *card)
		return 1;
		return 1;
	}
	}


	mmc_claim_host(card->host);
	err = mmc_send_status(card, &status);
	err = mmc_send_status(card, &status);
	if (err) {
	if (err) {
		pr_err("%s: Get card status fail\n", mmc_hostname(card->host));
		pr_err("%s: Get card status fail\n", mmc_hostname(card->host));
@@ -890,7 +889,6 @@ int mmc_interrupt_hpi(struct mmc_card *card)
	} while (!err);
	} while (!err);


out:
out:
	mmc_release_host(card->host);
	return err;
	return err;
}
}


@@ -932,9 +930,7 @@ static int mmc_read_bkops_status(struct mmc_card *card)
	int err;
	int err;
	u8 *ext_csd;
	u8 *ext_csd;


	mmc_claim_host(card->host);
	err = mmc_get_ext_csd(card, &ext_csd);
	err = mmc_get_ext_csd(card, &ext_csd);
	mmc_release_host(card->host);
	if (err)
	if (err)
		return err;
		return err;


+1 −0
Original line number Original line Diff line number Diff line
@@ -487,6 +487,7 @@ static unsigned long exynos_dwmmc_caps[4] = {


static const struct dw_mci_drv_data exynos_drv_data = {
static const struct dw_mci_drv_data exynos_drv_data = {
	.caps			= exynos_dwmmc_caps,
	.caps			= exynos_dwmmc_caps,
	.num_caps		= ARRAY_SIZE(exynos_dwmmc_caps),
	.init			= dw_mci_exynos_priv_init,
	.init			= dw_mci_exynos_priv_init,
	.set_ios		= dw_mci_exynos_set_ios,
	.set_ios		= dw_mci_exynos_set_ios,
	.parse_dt		= dw_mci_exynos_parse_dt,
	.parse_dt		= dw_mci_exynos_parse_dt,
+4 −0
Original line number Original line Diff line number Diff line
@@ -135,6 +135,9 @@ static int dw_mci_hi6220_parse_dt(struct dw_mci *host)
	if (priv->ctrl_id < 0)
	if (priv->ctrl_id < 0)
		priv->ctrl_id = 0;
		priv->ctrl_id = 0;


	if (priv->ctrl_id >= TIMING_MODE)
		return -EINVAL;

	host->priv = priv;
	host->priv = priv;
	return 0;
	return 0;
}
}
@@ -207,6 +210,7 @@ static int dw_mci_hi6220_execute_tuning(struct dw_mci_slot *slot, u32 opcode)


static const struct dw_mci_drv_data hi6220_data = {
static const struct dw_mci_drv_data hi6220_data = {
	.caps			= dw_mci_hi6220_caps,
	.caps			= dw_mci_hi6220_caps,
	.num_caps		= ARRAY_SIZE(dw_mci_hi6220_caps),
	.switch_voltage		= dw_mci_hi6220_switch_voltage,
	.switch_voltage		= dw_mci_hi6220_switch_voltage,
	.set_ios		= dw_mci_hi6220_set_ios,
	.set_ios		= dw_mci_hi6220_set_ios,
	.parse_dt		= dw_mci_hi6220_parse_dt,
	.parse_dt		= dw_mci_hi6220_parse_dt,
+1 −0
Original line number Original line Diff line number Diff line
@@ -319,6 +319,7 @@ static const struct dw_mci_drv_data rk2928_drv_data = {


static const struct dw_mci_drv_data rk3288_drv_data = {
static const struct dw_mci_drv_data rk3288_drv_data = {
	.caps			= dw_mci_rk3288_dwmmc_caps,
	.caps			= dw_mci_rk3288_dwmmc_caps,
	.num_caps		= ARRAY_SIZE(dw_mci_rk3288_dwmmc_caps),
	.set_ios		= dw_mci_rk3288_set_ios,
	.set_ios		= dw_mci_rk3288_set_ios,
	.execute_tuning		= dw_mci_rk3288_execute_tuning,
	.execute_tuning		= dw_mci_rk3288_execute_tuning,
	.parse_dt		= dw_mci_rk3288_parse_dt,
	.parse_dt		= dw_mci_rk3288_parse_dt,
+1 −0
Original line number Original line Diff line number Diff line
@@ -195,6 +195,7 @@ static unsigned long zx_dwmmc_caps[3] = {


static const struct dw_mci_drv_data zx_drv_data = {
static const struct dw_mci_drv_data zx_drv_data = {
	.caps			= zx_dwmmc_caps,
	.caps			= zx_dwmmc_caps,
	.num_caps		= ARRAY_SIZE(zx_dwmmc_caps),
	.execute_tuning		= dw_mci_zx_execute_tuning,
	.execute_tuning		= dw_mci_zx_execute_tuning,
	.prepare_hs400_tuning	= dw_mci_zx_prepare_hs400_tuning,
	.prepare_hs400_tuning	= dw_mci_zx_prepare_hs400_tuning,
	.parse_dt               = dw_mci_zx_parse_dt,
	.parse_dt               = dw_mci_zx_parse_dt,
Loading