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

Commit 1ddca057 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'mmc-fixes-for-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc

Pull MMC fixes from Chris Ball:
 - Disable use of MSI in sdhci-pci, which caused multiple chipsets to
   stop working in 3.4-rc1.  I'll wait to turn this on again until we
   have a chipset whitelist for it.
 - Fix a libertas SDIO powered-resume regression introduced in 3.3;
   thanks to Neil Brown and Rafael Wysocki for this fix.
 - Fix module reloading on omap_hsmmc.
 - Stop trusting the spec/card's specified maximum data timeout length,
   and use three seconds instead.  Previously we used 300ms.

Also cleanups and fixes for s3c, atmel, sh_mmcif and omap_hsmmc.

* tag 'mmc-fixes-for-3.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: (28 commits)
  mmc: use really long write timeout to deal with crappy cards
  mmc: sdhci-dove: Fix compile error by including module.h
  mmc: Prevent 1.8V switch for SD hosts that don't support UHS modes.
  Revert "mmc: sdhci-pci: Add MSI support"
  Revert "mmc: sdhci-pci: add quirks for broken MSI on O2Micro controllers"
  mmc: core: fix power class selection
  mmc: omap_hsmmc: fix module re-insertion
  mmc: omap_hsmmc: convert to module_platform_driver
  mmc: omap_hsmmc: make it behave well as a module
  mmc: omap_hsmmc: trivial cleanups
  mmc: omap_hsmmc: context save after enabling runtime pm
  mmc: omap_hsmmc: use runtime put sync in probe error patch
  mmc: sdio: Use empty system suspend/resume callbacks at the bus level
  mmc: bus: print bus speed mode of UHS-I card
  mmc: sdhci-pci: add quirks for broken MSI on O2Micro controllers
  mmc: sh_mmcif: Simplify calculation of mmc->f_min
  mmc: sh_mmcif: mmc->f_max should be half of the bus clock
  mmc: sh_mmcif: double clock speed
  mmc: block: Remove use of mmc_blk_set_blksize
  mmc: atmel-mci: add support for odd clock dividers
  ...
parents f68e556e 3bdc9ba8
Loading
Loading
Loading
Loading
+1 −26
Original line number Original line Diff line number Diff line
@@ -1623,24 +1623,6 @@ static int mmc_blk_alloc_parts(struct mmc_card *card, struct mmc_blk_data *md)
	return ret;
	return ret;
}
}


static int
mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card)
{
	int err;

	mmc_claim_host(card->host);
	err = mmc_set_blocklen(card, 512);
	mmc_release_host(card->host);

	if (err) {
		pr_err("%s: unable to set block size to 512: %d\n",
			md->disk->disk_name, err);
		return -EINVAL;
	}

	return 0;
}

static void mmc_blk_remove_req(struct mmc_blk_data *md)
static void mmc_blk_remove_req(struct mmc_blk_data *md)
{
{
	struct mmc_card *card;
	struct mmc_card *card;
@@ -1768,7 +1750,6 @@ static const struct mmc_fixup blk_fixups[] =
static int mmc_blk_probe(struct mmc_card *card)
static int mmc_blk_probe(struct mmc_card *card)
{
{
	struct mmc_blk_data *md, *part_md;
	struct mmc_blk_data *md, *part_md;
	int err;
	char cap_str[10];
	char cap_str[10];


	/*
	/*
@@ -1781,10 +1762,6 @@ static int mmc_blk_probe(struct mmc_card *card)
	if (IS_ERR(md))
	if (IS_ERR(md))
		return PTR_ERR(md);
		return PTR_ERR(md);


	err = mmc_blk_set_blksize(md, card);
	if (err)
		goto out;

	string_get_size((u64)get_capacity(md->disk) << 9, STRING_UNITS_2,
	string_get_size((u64)get_capacity(md->disk) << 9, STRING_UNITS_2,
			cap_str, sizeof(cap_str));
			cap_str, sizeof(cap_str));
	pr_info("%s: %s %s %s %s\n",
	pr_info("%s: %s %s %s %s\n",
@@ -1809,7 +1786,7 @@ static int mmc_blk_probe(struct mmc_card *card)
 out:
 out:
	mmc_blk_remove_parts(card, md);
	mmc_blk_remove_parts(card, md);
	mmc_blk_remove_req(md);
	mmc_blk_remove_req(md);
	return err;
	return 0;
}
}


static void mmc_blk_remove(struct mmc_card *card)
static void mmc_blk_remove(struct mmc_card *card)
@@ -1845,8 +1822,6 @@ static int mmc_blk_resume(struct mmc_card *card)
	struct mmc_blk_data *md = mmc_get_drvdata(card);
	struct mmc_blk_data *md = mmc_get_drvdata(card);


	if (md) {
	if (md) {
		mmc_blk_set_blksize(md, card);

		/*
		/*
		 * Resume involves the card going into idle state,
		 * Resume involves the card going into idle state,
		 * so current partition is always the main one.
		 * so current partition is always the main one.
+15 −2
Original line number Original line Diff line number Diff line
@@ -267,6 +267,15 @@ int mmc_add_card(struct mmc_card *card)
{
{
	int ret;
	int ret;
	const char *type;
	const char *type;
	const char *uhs_bus_speed_mode = "";
	static const char *const uhs_speeds[] = {
		[UHS_SDR12_BUS_SPEED] = "SDR12 ",
		[UHS_SDR25_BUS_SPEED] = "SDR25 ",
		[UHS_SDR50_BUS_SPEED] = "SDR50 ",
		[UHS_SDR104_BUS_SPEED] = "SDR104 ",
		[UHS_DDR50_BUS_SPEED] = "DDR50 ",
	};



	dev_set_name(&card->dev, "%s:%04x", mmc_hostname(card->host), card->rca);
	dev_set_name(&card->dev, "%s:%04x", mmc_hostname(card->host), card->rca);


@@ -296,6 +305,10 @@ int mmc_add_card(struct mmc_card *card)
		break;
		break;
	}
	}


	if (mmc_sd_card_uhs(card) &&
		(card->sd_bus_speed < ARRAY_SIZE(uhs_speeds)))
		uhs_bus_speed_mode = uhs_speeds[card->sd_bus_speed];

	if (mmc_host_is_spi(card->host)) {
	if (mmc_host_is_spi(card->host)) {
		pr_info("%s: new %s%s%s card on SPI\n",
		pr_info("%s: new %s%s%s card on SPI\n",
			mmc_hostname(card->host),
			mmc_hostname(card->host),
@@ -303,13 +316,13 @@ int mmc_add_card(struct mmc_card *card)
			mmc_card_ddr_mode(card) ? "DDR " : "",
			mmc_card_ddr_mode(card) ? "DDR " : "",
			type);
			type);
	} else {
	} else {
		pr_info("%s: new %s%s%s%s card at address %04x\n",
		pr_info("%s: new %s%s%s%s%s card at address %04x\n",
			mmc_hostname(card->host),
			mmc_hostname(card->host),
			mmc_card_uhs(card) ? "ultra high speed " :
			mmc_card_uhs(card) ? "ultra high speed " :
			(mmc_card_highspeed(card) ? "high speed " : ""),
			(mmc_card_highspeed(card) ? "high speed " : ""),
			(mmc_card_hs200(card) ? "HS200 " : ""),
			(mmc_card_hs200(card) ? "HS200 " : ""),
			mmc_card_ddr_mode(card) ? "DDR " : "",
			mmc_card_ddr_mode(card) ? "DDR " : "",
			type, card->rca);
			uhs_bus_speed_mode, type, card->rca);
	}
	}


#ifdef CONFIG_DEBUG_FS
#ifdef CONFIG_DEBUG_FS
+7 −3
Original line number Original line Diff line number Diff line
@@ -527,10 +527,14 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)


		if (data->flags & MMC_DATA_WRITE)
		if (data->flags & MMC_DATA_WRITE)
			/*
			/*
			 * The limit is really 250 ms, but that is
			 * The MMC spec "It is strongly recommended
			 * insufficient for some crappy cards.
			 * for hosts to implement more than 500ms
			 */
			 * timeout value even if the card indicates
			limit_us = 300000;
			 * the 250ms maximum busy length."  Even the
			 * previous value of 300ms is known to be
			 * insufficient for some cards.
			 */
			limit_us = 3000000;
		else
		else
			limit_us = 100000;
			limit_us = 100000;


+17 −13
Original line number Original line Diff line number Diff line
@@ -695,6 +695,11 @@ static int mmc_select_powerclass(struct mmc_card *card,
		else if (host->ios.clock <= 200000000)
		else if (host->ios.clock <= 200000000)
			index = EXT_CSD_PWR_CL_200_195;
			index = EXT_CSD_PWR_CL_200_195;
		break;
		break;
	case MMC_VDD_27_28:
	case MMC_VDD_28_29:
	case MMC_VDD_29_30:
	case MMC_VDD_30_31:
	case MMC_VDD_31_32:
	case MMC_VDD_32_33:
	case MMC_VDD_32_33:
	case MMC_VDD_33_34:
	case MMC_VDD_33_34:
	case MMC_VDD_34_35:
	case MMC_VDD_34_35:
@@ -1111,11 +1116,10 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
		ext_csd_bits = (bus_width == MMC_BUS_WIDTH_8) ?
		ext_csd_bits = (bus_width == MMC_BUS_WIDTH_8) ?
				EXT_CSD_BUS_WIDTH_8 : EXT_CSD_BUS_WIDTH_4;
				EXT_CSD_BUS_WIDTH_8 : EXT_CSD_BUS_WIDTH_4;
		err = mmc_select_powerclass(card, ext_csd_bits, ext_csd);
		err = mmc_select_powerclass(card, ext_csd_bits, ext_csd);
		if (err) {
		if (err)
			pr_err("%s: power class selection to bus width %d failed\n",
			pr_warning("%s: power class selection to bus width %d"
				mmc_hostname(card->host), 1 << bus_width);
				   " failed\n", mmc_hostname(card->host),
			goto err;
				   1 << bus_width);
		}
	}
	}


	/*
	/*
@@ -1147,7 +1151,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
			err = mmc_select_powerclass(card, ext_csd_bits[idx][0],
			err = mmc_select_powerclass(card, ext_csd_bits[idx][0],
						    ext_csd);
						    ext_csd);
			if (err)
			if (err)
				pr_err("%s: power class selection to "
				pr_warning("%s: power class selection to "
					   "bus width %d failed\n",
					   "bus width %d failed\n",
					   mmc_hostname(card->host),
					   mmc_hostname(card->host),
					   1 << bus_width);
					   1 << bus_width);
@@ -1178,7 +1182,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
			err = mmc_select_powerclass(card, ext_csd_bits[idx][1],
			err = mmc_select_powerclass(card, ext_csd_bits[idx][1],
						    ext_csd);
						    ext_csd);
			if (err)
			if (err)
				pr_err("%s: power class selection to "
				pr_warning("%s: power class selection to "
					   "bus width %d ddr %d failed\n",
					   "bus width %d ddr %d failed\n",
					   mmc_hostname(card->host),
					   mmc_hostname(card->host),
					   1 << bus_width, ddr);
					   1 << bus_width, ddr);
+9 −3
Original line number Original line Diff line number Diff line
@@ -192,9 +192,15 @@ static int sdio_bus_remove(struct device *dev)
	return ret;
	return ret;
}
}


#ifdef CONFIG_PM_RUNTIME
#ifdef CONFIG_PM

static int pm_no_operation(struct device *dev)
{
	return 0;
}


static const struct dev_pm_ops sdio_bus_pm_ops = {
static const struct dev_pm_ops sdio_bus_pm_ops = {
	SET_SYSTEM_SLEEP_PM_OPS(pm_no_operation, pm_no_operation)
	SET_RUNTIME_PM_OPS(
	SET_RUNTIME_PM_OPS(
		pm_generic_runtime_suspend,
		pm_generic_runtime_suspend,
		pm_generic_runtime_resume,
		pm_generic_runtime_resume,
@@ -204,11 +210,11 @@ static const struct dev_pm_ops sdio_bus_pm_ops = {


#define SDIO_PM_OPS_PTR	(&sdio_bus_pm_ops)
#define SDIO_PM_OPS_PTR	(&sdio_bus_pm_ops)


#else /* !CONFIG_PM_RUNTIME */
#else /* !CONFIG_PM */


#define SDIO_PM_OPS_PTR	NULL
#define SDIO_PM_OPS_PTR	NULL


#endif /* !CONFIG_PM_RUNTIME */
#endif /* !CONFIG_PM */


static struct bus_type sdio_bus_type = {
static struct bus_type sdio_bus_type = {
	.name		= "sdio",
	.name		= "sdio",
Loading